java.lang.Object
com.michelin.cert.redscan.utils.datalake.DatalakeStorageItem
com.michelin.cert.redscan.utils.models.services.HttpService
All Implemented Interfaces:
Sendable

public class HttpService extends DatalakeStorageItem implements Sendable
Http Service model.
Author:
Maxime ESCOURBIAC
  • Constructor Details

    • HttpService

      public HttpService()
      HTTP Service Constructor.
    • HttpService

      public HttpService(String domain, String ip, String port, boolean isSsl)
      HTTP Service Constructor.
      Parameters:
      domain - Service domain.
      ip - Service ip.
      port - Service port.
      isSsl - HTTP/HTTPS
    • HttpService

      public HttpService(String domain, String ip, String port, String parent, boolean isSsl)
      HTTP Service Constructor.
      Parameters:
      domain - Service domain.
      ip - Service ip.
      port - Service port.
      parent - Parent Service.
      isSsl - HTTP/HTTPS.
  • Method Details

    • toUrl

      public String toUrl()
      Convert the HTTP Service to url.
      Returns:
      The String representation of the HTTP service.
    • fromJson

      public void fromJson(String json)
      Description copied from interface: Sendable
      Convert json string to object.
      Specified by:
      fromJson in interface Sendable
      Parameters:
      json - The string representation of the json object.
    • toJson

      public String toJson()
      Description copied from interface: Sendable
      Convert the object to json string.
      Specified by:
      toJson in interface Sendable
      Returns:
      The string representation of the json object.
    • getId

      public String getId()
      Description copied from class: DatalakeStorageItem
      Item ID.
      Specified by:
      getId in class DatalakeStorageItem
      Returns:
      Item ID.
    • getFanoutExchangeName

      public String getFanoutExchangeName()
      Description copied from interface: Sendable
      Get Fanout exchange name.
      Specified by:
      getFanoutExchangeName in interface Sendable
      Returns:
      Fanout exchange name.
    • fromDatalake

      public <T extends DatalakeStorageItem> T fromDatalake(kong.unirest.json.JSONObject object)
      Description copied from class: DatalakeStorageItem
      Create 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:
      fromDatalake in class DatalakeStorageItem
      Type Parameters:
      T - DatalakeStorageItem children.
      Parameters:
      object - Datalake data.
      Returns:
      DatalakeStorageItem instantiated.
    • upsert

      public boolean upsert() throws DatalakeStorageException
      Description copied from class: DatalakeStorageItem
      Upsert the item in Elastic searchContent. This operation cannot be mutualized and must be defined in each children classes.
      Specified by:
      upsert in class DatalakeStorageItem
      Returns:
      True if the upsert is successful.
      Throws:
      DatalakeStorageException - Exception with the storage.
    • getDomain

      public String getDomain()
      HTTP Service domain.
      Returns:
      HTTP Service domain.
    • setDomain

      public void setDomain(String domain)
      HTTP Service domain.
      Parameters:
      domain - HTTP Service domain.
    • getIp

      public String getIp()
      HTTP Service ip.
      Returns:
      HTTP Service ip.
    • setIp

      public void setIp(String ip)
      HTTP Service ip.
      Parameters:
      ip - HTTP Service ip.
    • getPort

      public String getPort()
      HTTP Service port.
      Returns:
      HTTP Service port.
    • setPort

      public void setPort(String port)
      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)