Class InternalService
java.lang.Object
es.kukenan.smartfi.microservice.firm.service.InternalService
Internal service class.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate es.kukenan.smartfi.common.context.RequestContextManagerRequest context manager.private InternalServicesPropertiesInternal service properties.private es.kukenan.smartfi.common.context.config.ContextPropagationPropertiesContext propagation properties.private org.springframework.web.client.RestTemplateRest template. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate org.springframework.http.HttpHeadersaddHeadersForInternalRequest(String jwtToken, Map<String, String> headersMap) Add headers needed to do internal request.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.generatePath(String hostName, String path) Generate a final Path.
-
Field Details
-
restTemplate
@Autowired private org.springframework.web.client.RestTemplate restTemplateRest template. -
internalServicesProperties
Internal service properties. -
properties
@Autowired private es.kukenan.smartfi.common.context.config.ContextPropagationProperties propertiesContext propagation properties. -
contextManager
@Autowired private es.kukenan.smartfi.common.context.RequestContextManager contextManagerRequest 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
Generate a final Path.- Parameters:
hostName- hostNamepath- path- Returns:
- a full path.
-