Class HttpService
java.lang.Object
com.michelin.cert.redscan.utils.datalake.DatalakeStorageItem
com.michelin.cert.redscan.utils.models.services.HttpService
- All Implemented Interfaces:
Sendable
Http Service model.
- Author:
- Maxime ESCOURBIAC
-
Field Summary
Fields inherited from class com.michelin.cert.redscan.utils.datalake.DatalakeStorageItem
blocked, data, index, parent -
Constructor Summary
ConstructorsConstructorDescriptionHTTP Service Constructor.HttpService(String domain, String ip, String port, boolean isSsl) HTTP Service Constructor.HttpService(String domain, String ip, String port, String parent, boolean isSsl) HTTP Service Constructor. -
Method Summary
Modifier and TypeMethodDescription<T extends DatalakeStorageItem>
TfromDatalake(kong.unirest.json.JSONObject object) Create DatalakeStorageItem instance from Datalake data.voidConvert json string to object.HTTP Service domain.Get Fanout exchange name.getId()Item ID.getIp()HTTP Service ip.getPort()HTTP Service port.booleanisSsl()HTTP Service protocol (http, https).voidHTTP Service domain.voidHTTP Service ip.voidHTTP Service port.voidsetSsl(boolean isSsl) HTTP Service protocol (http, https).toJson()Convert the object to json string.toUrl()Convert the HTTP Service to url.booleanupsert()Upsert the item in Elastic searchContent.Methods inherited from class com.michelin.cert.redscan.utils.datalake.DatalakeStorageItem
block, create, delete, find, find, findAll, findAll, findAll, findAll, findAllContent, findAllContent, findAllContent, findAllContent, findContent, fromDate, getBlocked, getBlockId, getData, getIndex, getLastScanDate, getParent, isBlocked, removeField, search, search, search, search, searchContent, searchContent, searchContent, searchContent, setBlocked, setData, setIndex, setLastScanDate, setParent, toDate, unblock, upsertField
-
Constructor Details
-
HttpService
public HttpService()HTTP Service Constructor. -
HttpService
HTTP Service Constructor.- Parameters:
domain- Service domain.ip- Service ip.port- Service port.isSsl- HTTP/HTTPS
-
HttpService
HTTP Service Constructor.- Parameters:
domain- Service domain.ip- Service ip.port- Service port.parent- Parent Service.isSsl- HTTP/HTTPS.
-
-
Method Details
-
toUrl
Convert the HTTP Service to url.- Returns:
- The String representation of the HTTP service.
-
fromJson
Description copied from interface:SendableConvert json string to object. -
toJson
Description copied from interface:SendableConvert the object to json string. -
getId
Description copied from class:DatalakeStorageItemItem ID.- Specified by:
getIdin classDatalakeStorageItem- Returns:
- Item ID.
-
getFanoutExchangeName
Description copied from interface:SendableGet Fanout exchange name.- Specified by:
getFanoutExchangeNamein interfaceSendable- Returns:
- Fanout exchange name.
-
fromDatalake
Description copied from class:DatalakeStorageItemCreate DatalakeStorageItem instance from Datalake data. Be careful to verify if the JSON object parameter is not null. If object is null => return null.- Specified by:
fromDatalakein classDatalakeStorageItem- Type Parameters:
T- DatalakeStorageItem children.- Parameters:
object- Datalake data.- Returns:
- DatalakeStorageItem instantiated.
-
upsert
Description copied from class:DatalakeStorageItemUpsert the item in Elastic searchContent. This operation cannot be mutualized and must be defined in each children classes.- Specified by:
upsertin classDatalakeStorageItem- Returns:
- True if the upsert is successful.
- Throws:
DatalakeStorageException- Exception with the storage.
-
getDomain
HTTP Service domain.- Returns:
- HTTP Service domain.
-
setDomain
HTTP Service domain.- Parameters:
domain- HTTP Service domain.
-
getIp
HTTP Service ip.- Returns:
- HTTP Service ip.
-
setIp
HTTP Service ip.- Parameters:
ip- HTTP Service ip.
-
getPort
HTTP Service port.- Returns:
- HTTP Service port.
-
setPort
HTTP Service port.- Parameters:
port- HTTP Service port.
-
isSsl
public boolean isSsl()HTTP Service protocol (http, https).- Returns:
- HTTP Service protocol (http, https).
-
setSsl
public void setSsl(boolean isSsl) HTTP Service protocol (http, https).- Parameters:
isSsl- HTTP Service protocol (http, https)
-