Class AbstractInternalEndpointClient

java.lang.Object
es.kukenan.smartfi.microservice.communication.service.api.AbstractEndpointClient
es.kukenan.smartfi.microservice.communication.service.api.AbstractInternalEndpointClient
Direct Known Subclasses:
BackofficeEndpoints, LabsMobileEndpoints

public class AbstractInternalEndpointClient extends AbstractEndpointClient
Base class with core funcionality for any endpoint implementation.
  • Field Details

  • Constructor Details

    • AbstractInternalEndpointClient

      public AbstractInternalEndpointClient(String endpointBasePath)
      Base constructor.
      Parameters:
      endpointBasePath - the base path of this endpoint.
  • Method Details

    • extractResponseData

      protected <T> T extractResponseData(org.springframework.http.ResponseEntity<T> responseEntity)
      Extract the response data from the given ResponseEntity.
      Type Parameters:
      T - MinsaitResponse type.
      Parameters:
      responseEntity - ResponseEntity.
      Returns:
      minsait response data.
    • addAuthorization

      private void addAuthorization(org.springframework.http.HttpHeaders httpHeaders)
      Add authorization parameters to the given http headers.
      Parameters:
      httpHeaders - http headers to update with the correct credentials to invoke Core API.
    • defaultRequestHeaders

      public org.springframework.http.HttpHeaders defaultRequestHeaders(String contentType, String userId)
      Create the default request HTTP headers used in any Core API method.
      Overrides:
      defaultRequestHeaders in class AbstractEndpointClient
      Parameters:
      contentType - request body content type. Can be null.
      userId - user identifier, mandatory.
      Returns:
      the default request HTTP headers used in any Core API method.
    • defaultRequestHeaders

      protected org.springframework.http.HttpHeaders defaultRequestHeaders(String contentType, String userId, String userIp)