Package com.cumulocity.sdk.client
Class PlatformParameters
- java.lang.Object
-
- com.cumulocity.sdk.client.PlatformParameters
-
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
PlatformImpl
public class PlatformParameters extends Object implements AutoCloseable
Keeps credentials and client configuration. Creates processor responsible for handling buffered requests. Important to call close() method on shutdown to finish processing.
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_PAGE_SIZE
-
Constructor Summary
Constructors Constructor Description PlatformParameters()
PlatformParameters(String host, CumulocityCredentials credentials, ClientConfiguration clientConfiguration)
PlatformParameters(String host, CumulocityCredentials credentials, ClientConfiguration clientConfiguration, int pageSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
RestConnector
createRestConnector()
String
getApplicationKey()
int
getChunkedEncodingSize()
String
getHost()
HttpClientConfig
getHttpClientConfig()
int
getPageSize()
String
getProxyHost()
String
getProxyPassword()
int
getProxyPort()
String
getProxyUserId()
String
getRequestOrigin()
ResponseMapper
getResponseMapper()
String
getTenantId()
String
getTfaToken()
String
getUser()
boolean
isAlwaysCloseConnection()
boolean
isForceInitialHost()
boolean
registerInterceptor(HttpClientInterceptor interceptor)
boolean
requireResponseBody()
void
setAlwaysCloseConnection(boolean alwaysCloseConnection)
Set header to the http client to close connection always.void
setChunkedEncodingSize(int chunkedEncodingSize)
void
setForceInitialHost(boolean forceInitialHost)
void
setHost(String host)
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 Detail
-
DEFAULT_PAGE_SIZE
public static final int DEFAULT_PAGE_SIZE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PlatformParameters
public PlatformParameters()
-
PlatformParameters
public PlatformParameters(String host, CumulocityCredentials credentials, ClientConfiguration clientConfiguration)
-
PlatformParameters
public PlatformParameters(String host, CumulocityCredentials credentials, ClientConfiguration clientConfiguration, int pageSize)
-
-
Method Detail
-
createRestConnector
public RestConnector createRestConnector()
-
getPageSize
public int getPageSize()
-
getHost
public String getHost()
-
getTenantId
public String getTenantId()
-
getUser
public String getUser()
-
getProxyHost
public String getProxyHost()
-
setProxyHost
public void setProxyHost(String proxyHost)
-
getProxyPort
public int getProxyPort()
-
setProxyPort
public void setProxyPort(int proxyPort)
-
getProxyUserId
public String getProxyUserId()
-
setProxyUserId
public void setProxyUserId(String proxyUserId)
-
getProxyPassword
public String getProxyPassword()
-
setProxyPassword
public void setProxyPassword(String proxyPassword)
-
getApplicationKey
public String 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
public HttpClientConfig getHttpClientConfig()
-
setHttpClientConfig
public 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() );- 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
public String getTfaToken()
-
setTfaToken
public void setTfaToken(String tfaToken)
-
setHost
public void setHost(String host)
-
getRequestOrigin
public String getRequestOrigin()
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
-
registerInterceptor
public boolean registerInterceptor(HttpClientInterceptor interceptor)
-
unregisterInterceptor
public boolean unregisterInterceptor(HttpClientInterceptor interceptor)
-
getResponseMapper
public ResponseMapper getResponseMapper()
-
setResponseMapper
public void setResponseMapper(ResponseMapper responseMapper)
-
setChunkedEncodingSize
public void setChunkedEncodingSize(int chunkedEncodingSize)
-
getChunkedEncodingSize
public int getChunkedEncodingSize()
-
-