Class SimpleClientAbstract<S extends Closeable>
java.lang.Object
io.clonecloudstore.common.quarkus.client.SimpleClientAbstract<S>
- Type Parameters:
S
- the type for the Rest Service as Quarkus definition
- All Implemented Interfaces:
Closeable
,AutoCloseable
- Direct Known Subclasses:
AccessorBucketApiClient
,AccessorBucketInternalApiClient
,ClientAbstract
,OwnershipApiClient
,TopologyApiClient
Client Abstraction
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final ClientResponseExceptionMapper
static final String
static final String
static final String
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
SimpleClientAbstract
(SimpleClientFactoryAbstract<S> factory, URI uri) Constructor used by the Factory -
Method Summary
Modifier and TypeMethodDescriptionstatic void
acceptCompression
(boolean acceptCompression) static void
bodyCompressed
(boolean compressedBody) void
close()
static boolean
static Object
protected SimpleClientFactoryAbstract
<S> static String
getOpId()
Get the current Operation Idprotected S
Get the associated ServiceRestprotected URI
getUri()
Get the URI defined from constructionstatic boolean
static boolean
void
reopen()
Close and reopens Quarkus Rest clientvoid
Reset OpId to emptyvoid
Clean all Query contextstatic void
setCompressionStatusFromHeaders
(Boolean compressed) Set Compression status received from headersstatic void
setDtoFromHeaders
(Object result) Set object received from headersstatic void
setHeadersMap
(Map<String, String> headersMap) static String
setMdcOpId
(String opId) Check opId and put it in MDCvoid
Set the current Operation Id
-
Field Details
-
MDC_COMPRESSED_CONTENT
- See Also:
-
MDC_COMPRESSED_RESPONSE
- See Also:
-
MDC_QUERY_HEADERS
- See Also:
-
exceptionMapper
-
-
Constructor Details
-
SimpleClientAbstract
Constructor used by the Factory
-
-
Method Details
-
getFactory
- Returns:
- the Factory used by this client
-
reopen
public void reopen()Close and reopens Quarkus Rest client -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
setOpId
Set the current Operation Id -
bodyCompressed
public static void bodyCompressed(boolean compressedBody) - Parameters:
compressedBody
- True, client provides compressed body
-
isBodyCompressed
public static boolean isBodyCompressed()- Returns:
- True if the client provides compressed body
-
acceptCompression
public static void acceptCompression(boolean acceptCompression) - Parameters:
acceptCompression
- True, client requires compressed response
-
isAcceptCompression
public static boolean isAcceptCompression()- Returns:
- True if the client requires compressed response
-
setHeadersMap
- Parameters:
headersMap
- the apiBusinessIn as map to setup as headers
-
getHeadersMap
- Returns:
- True if the client requires compressed response
-
setDtoFromHeaders
Set object received from headers -
setCompressionStatusFromHeaders
Set Compression status received from headers -
getDtoFromHeaders
- Returns:
- received Object from Headers
-
getCompressionStatusFromHeaders
public static boolean getCompressionStatusFromHeaders()- Returns:
- received Compression status from Headers
-
resetQueryContext
public void resetQueryContext()Clean all Query context -
setMdcOpId
Check opId and put it in MDC- Returns:
- the value to use
-
getMdcOpId
- Returns:
- the current OpId or a new one if none
-
getOpId
Get the current Operation Id -
resetMdcOpId
public void resetMdcOpId()Reset OpId to empty -
getService
Get the associated ServiceRest -
getUri
Get the URI defined from construction
-