public class Client extends ApiResource implements Closeable, LoggingCapable, ObfuscationCapable
This client and all its child clients are bound to one specific value for the X-GCS-ClientMetaInfo header.
To get a new client with a different header value, use withClientMetaInfo(String).
Thread-safe.
clientMetaInfo, communicator| Constructor and Description |
|---|
Client(Communicator communicator) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Releases any system resources associated with this object.
|
void |
closeExpiredConnections()
Utility method that delegates the call to this client's communicator.
|
void |
closeIdleConnections(long idleTime,
TimeUnit timeUnit)
Utility method that delegates the call to this client's communicator.
|
void |
disableLogging()
Turns off logging.
|
void |
enableLogging(CommunicatorLogger communicatorLogger)
Turns on logging using the given communicator logger.
|
void |
setBodyObfuscator(BodyObfuscator bodyObfuscator)
Sets the current non-
null body obfuscator to use. |
void |
setHeaderObfuscator(HeaderObfuscator headerObfuscator)
Sets the current non-
null header obfuscator to use. |
V1Client |
v1() |
Client |
withClientMetaInfo(String clientMetaInfo)
Returns a new
Client which uses the passed meta data for the
X-GCS-ClientMetaInfo header. |
getClientHeaders, instantiateUripublic Client(Communicator communicator)
public Client withClientMetaInfo(String clientMetaInfo)
Client which uses the passed meta data for the
X-GCS-ClientMetaInfo header.clientMetaInfo - JSON string containing the meta data for the clientMarshallerSyntaxException - if the given clientMetaInfo is not a valid JSON stringpublic void closeIdleConnections(long idleTime,
TimeUnit timeUnit)
public void closeExpiredConnections()
public void setBodyObfuscator(BodyObfuscator bodyObfuscator)
ObfuscationCapablenull body obfuscator to use.setBodyObfuscator in interface ObfuscationCapablepublic void setHeaderObfuscator(HeaderObfuscator headerObfuscator)
ObfuscationCapablenull header obfuscator to use.setHeaderObfuscator in interface ObfuscationCapablepublic void enableLogging(CommunicatorLogger communicatorLogger)
LoggingCapableenableLogging in interface LoggingCapablepublic void disableLogging()
LoggingCapabledisableLogging in interface LoggingCapablepublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic V1Client v1()
Copyright © 2025 Worldline Global Collect. All rights reserved.