Package com.cumulocity.sdk.client
Class PlatformParameters
java.lang.Object
com.cumulocity.sdk.client.PlatformParameters
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
PlatformImpl
Keeps credentials and client configuration.
Creates processor responsible for handling buffered requests.
Important to call close() method on shutdown to finish processing.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionPlatformParameters
(String host, CumulocityCredentials credentials, ClientConfiguration clientConfiguration) PlatformParameters
(String host, CumulocityCredentials credentials, ClientConfiguration clientConfiguration, int pageSize) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
int
getHost()
int
int
getUser()
boolean
boolean
boolean
registerInterceptor
(HttpClientInterceptor interceptor) boolean
void
setAlwaysCloseConnection
(boolean alwaysCloseConnection) Set header to the http client to close connection always.void
setChunkedEncodingSize
(int chunkedEncodingSize) void
setForceInitialHost
(boolean forceInitialHost) void
void
setHttpClientConfig
(HttpClientConfig httpClientConfig) Pass the configuration for underlying http client Example: platform.setHttpClientConfig( HttpClientConfig.httpConfig() .pool(ConnectionPoolConfig.connectionPool() .perHost(100) .max(200) .awaitTimeout(60000) .build()) .build() );void
setProxyHost
(String proxyHost) void
setProxyPassword
(String proxyPassword) void
setProxyPort
(int proxyPort) void
setProxyUserId
(String proxyUserId) void
setRequireResponseBody
(boolean requireResponseBody) void
setResponseMapper
(ResponseMapper responseMapper) void
setTfaToken
(Supplier<String> tfaToken) void
setTfaToken
(String tfaToken) boolean
unregisterInterceptor
(HttpClientInterceptor interceptor)
-
Field Details
-
DEFAULT_PAGE_SIZE
public static final int DEFAULT_PAGE_SIZE- See Also:
-
-
Constructor Details
-
PlatformParameters
public PlatformParameters() -
PlatformParameters
public PlatformParameters(String host, CumulocityCredentials credentials, ClientConfiguration clientConfiguration) -
PlatformParameters
public PlatformParameters(String host, CumulocityCredentials credentials, ClientConfiguration clientConfiguration, int pageSize)
-
-
Method Details
-
createRestConnector
-
getPageSize
public int getPageSize() -
getHost
-
getTenantId
-
getUser
-
getProxyHost
-
setProxyHost
-
getProxyPort
public int getProxyPort() -
setProxyPort
public void setProxyPort(int proxyPort) -
getProxyUserId
-
setProxyUserId
-
getProxyPassword
-
setProxyPassword
-
getApplicationKey
-
setRequireResponseBody
public void setRequireResponseBody(boolean requireResponseBody) -
requireResponseBody
public boolean requireResponseBody() -
isForceInitialHost
public boolean isForceInitialHost() -
setForceInitialHost
public void setForceInitialHost(boolean forceInitialHost) -
isAlwaysCloseConnection
public boolean isAlwaysCloseConnection() -
getHttpClientConfig
-
setHttpClientConfig
Pass the configuration for underlying http client Example: platform.setHttpClientConfig( HttpClientConfig.httpConfig() .pool(ConnectionPoolConfig.connectionPool() .perHost(100) .max(200) .awaitTimeout(60000) .build()) .build() );- Parameters:
httpClientConfig
- http client configuration
-
setAlwaysCloseConnection
public void setAlwaysCloseConnection(boolean alwaysCloseConnection) Set header to the http client to close connection always.- Parameters:
alwaysCloseConnection
- specifies if header value should be set
-
getTfaToken
-
setTfaToken
-
setTfaToken
-
setHost
-
getRequestOrigin
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
registerInterceptor
-
unregisterInterceptor
-
getResponseMapper
-
setResponseMapper
-
setChunkedEncodingSize
public void setChunkedEncodingSize(int chunkedEncodingSize) -
getChunkedEncodingSize
public int getChunkedEncodingSize()
-