Class InternalService

java.lang.Object
es.kukenan.smartfi.microservice.firm.service.InternalService

@Service public class InternalService extends Object
Internal service class.
  • Field Details

    • restTemplate

      @Autowired private org.springframework.web.client.RestTemplate restTemplate
      Rest template.
    • internalServicesProperties

      @Autowired private InternalServicesProperties internalServicesProperties
      Internal service properties.
    • properties

      @Autowired private es.kukenan.smartfi.common.context.config.ContextPropagationProperties properties
      Context propagation properties.
    • contextManager

      @Autowired private es.kukenan.smartfi.common.context.RequestContextManager contextManager
      Request context manager.
  • Constructor Details

    • InternalService

      public InternalService()
  • Method Details

    • doRequestToInternalServices

      public org.springframework.http.ResponseEntity<byte[]> doRequestToInternalServices(String method, String path, byte[] body, String jwtToken, Map<String,String> headers)
      Generate rest template for correct checked otp.
      Parameters:
      method - method of correct otp request.
      path - path of correct otp request.
      body - body of correct otp request.
      jwtToken - Jwt token in session cache.
      headers - http headers for internal request.
      Returns:
      ResponseEntity with response data.
    • addHeadersForInternalRequest

      private org.springframework.http.HttpHeaders addHeadersForInternalRequest(String jwtToken, Map<String,String> headersMap)
      Add headers needed to do internal request.
      Parameters:
      jwtToken - Token for private type internal services.
      headersMap - Map with request header for endpoint saves in otp.
      Returns:
      headers needed for internal request.
    • generatePath

      public String generatePath(String hostName, String path)
      Generate a final Path.
      Parameters:
      hostName - hostName
      path - path
      Returns:
      a full path.