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, instantiateUri
public 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)
ObfuscationCapable
null
body obfuscator to use.setBodyObfuscator
in interface ObfuscationCapable
public void setHeaderObfuscator(HeaderObfuscator headerObfuscator)
ObfuscationCapable
null
header obfuscator to use.setHeaderObfuscator
in interface ObfuscationCapable
public void enableLogging(CommunicatorLogger communicatorLogger)
LoggingCapable
enableLogging
in interface LoggingCapable
public void disableLogging()
LoggingCapable
disableLogging
in interface LoggingCapable
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public V1Client v1()
Copyright © 2024 Worldline Global Collect. All rights reserved.