Class AbstractEndpointClient
java.lang.Object
es.kukenan.smartfi.microservice.transfer.service.backoffice.AbstractEndpointClient
- Direct Known Subclasses:
AbstractCoreEndpoint,AbstractInternalEndpointClient
Base class with core functionality for any endpoint implementation.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate es.kukenan.smartfi.common.context.RequestContextManagerRequest context manager.private es.kukenan.smartfi.common.context.config.ContextPropagationPropertiesContext propagation properties. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected URICreate a URI object from the given Minstait relative endpoint path.protected URICreate a URI object from the given relative endpoint path.protected org.springframework.http.HttpHeadersCreate the default request HTTP headers used in any API method.protected <T> ThandleConnectionException(Supplier<T> supplier) Performs the operation encapsulated in the supplier instance to handle connection exceptions.protected Stringmessage(org.springframework.web.client.ResourceAccessException e) Construct an error message from a givenResourceAccessException.
-
Field Details
-
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
-
AbstractEndpointClient
public AbstractEndpointClient()
-
-
Method Details
-
createUri
Create a URI object from the given Minstait relative endpoint path.- Parameters:
uriPath- Minstait relative endpoint path.- Returns:
- URI object with absolute endpoint path.
-
createUri
Create a URI object from the given relative endpoint path.- Parameters:
uriPath- relative endpoint path.queryParams- Query PArams to add at endpoint path.- Returns:
- URI object with absolute endpoint path.
-
handleConnectionException
Performs the operation encapsulated in the supplier instance to handle connection exceptions.- Type Parameters:
T- the result type of the operation.- Parameters:
supplier- an operation encapsulated a the supplier instance.- Returns:
- the result of the operation if no exception has been thrown.
-
message
Construct an error message from a givenResourceAccessException.- Parameters:
e- aResourceAccessException.- Returns:
- a message describing the exception reason.
-
defaultRequestHeaders
protected org.springframework.http.HttpHeaders defaultRequestHeaders()Create the default request HTTP headers used in any API method.- Returns:
- the default request HTTP headers
-