public static class AnywhereAPI.Builder
extends java.lang.Object
AnywhereAPI. The Builder provides all
the options for customizing the AnywhereAPI as you see fit.| Constructor and Description |
|---|
Builder(java.lang.String serverUrl)
Constructs a Builder, setting the initial value of the server to the specified value.
|
| Modifier and Type | Method and Description |
|---|---|
AnywhereAPI |
build()
Generates an
AnywhereAPI with the configured parameters. |
AnywhereAPI.Builder |
insecureSSL()
Indicates that all SSL connections should be trusted.
|
AnywhereAPI.Builder |
keepAliveDuration(long keepAliveDuration,
java.util.concurrent.TimeUnit timeUnit)
Sets the amount of time a connection remains idle before closing.
|
AnywhereAPI.Builder |
maxIdleConnections(int maxIdleConnections)
Sets the maximum number of idle connections for this connector.
|
AnywhereAPI.Builder |
proxy(java.net.Proxy proxy)
Sets the proxy to use.
|
AnywhereAPI.Builder |
proxy(java.lang.String hostname,
int port)
Sets the proxy to use, based on the provided hostname and port.
|
AnywhereAPI.Builder |
readTimeoutDuration(long readTimeoutDuration,
java.util.concurrent.TimeUnit timeUnit)
Sets the amount of time to wait between bytes read before timing out
|
AnywhereAPI.Builder |
server(java.lang.String server)
Updates the server URL.
|
AnywhereAPI.Builder |
skipHostnameVerification()
Do not perform hostname verification against the certificate returned by the server
|
AnywhereAPI.Builder |
useCertificateChain(java.security.cert.X509Certificate[] certChain)
Identifies the certChain that will be used to check and authenticate SSL certificates
once a connection to HCP Anywhere has been established.
|
AnywhereAPI.Builder |
useKeyStore(java.security.KeyStore keyStore)
Identifies the KeyStore that will be used to check and authenticate SSL certificates once
a connection to HCP Anywhere has been established.
|
AnywhereAPI.Builder |
useSSLContext(javax.net.ssl.SSLContext sslContext)
Identifies the SSLContext that will be used to check for and authenticate SSL certificates
|
AnywhereAPI.Builder |
writeTimeoutDuration(long writeTimeoutDuration,
java.util.concurrent.TimeUnit timeUnit)
Sets the amount of time to wait between bytes written before timing out
|
public Builder(java.lang.String serverUrl)
throws AnywhereException
serverUrl - should include the protocol, server hostname or IP, and port if requiredAnywhereExceptionpublic AnywhereAPI build()
AnywhereAPI with the configured parameters.public AnywhereAPI.Builder server(java.lang.String server) throws AnywhereException
server - should include the protocol, server hostname or IP, and port if required.AnywhereExceptionpublic AnywhereAPI.Builder maxIdleConnections(int maxIdleConnections)
maxIdleConnections - maximum number of idle connections for this connectorpublic AnywhereAPI.Builder keepAliveDuration(long keepAliveDuration, java.util.concurrent.TimeUnit timeUnit)
keepAliveDuration - amount of time a connection remains idle before closingtimeUnit - the unit of time (e.g., minutes, hours, etc.)public AnywhereAPI.Builder useKeyStore(java.security.KeyStore keyStore) throws java.security.KeyManagementException, java.security.NoSuchAlgorithmException, java.security.KeyStoreException
keyStore - KeyStore to be used to check and authenticate SSL certificatesjava.security.KeyManagementExceptionjava.security.NoSuchAlgorithmExceptionjava.security.KeyStoreExceptionpublic AnywhereAPI.Builder useCertificateChain(java.security.cert.X509Certificate[] certChain) throws java.security.KeyManagementException, java.security.NoSuchAlgorithmException, java.security.KeyStoreException, java.security.cert.CertificateException, java.io.IOException
certChain - certChain to be used to check and authenticate SSL certificatesjava.security.KeyManagementExceptionjava.security.NoSuchAlgorithmExceptionjava.security.KeyStoreExceptionjava.io.IOExceptionjava.security.cert.CertificateExceptionpublic AnywhereAPI.Builder insecureSSL() throws java.security.KeyManagementException, java.security.NoSuchAlgorithmException
java.security.KeyManagementExceptionjava.security.NoSuchAlgorithmExceptionpublic AnywhereAPI.Builder useSSLContext(javax.net.ssl.SSLContext sslContext) throws java.security.KeyManagementException, java.security.NoSuchAlgorithmException
sslContext - The sslContext used to check and authenticate SSL certificatesjava.security.KeyManagementExceptionjava.security.NoSuchAlgorithmExceptionpublic AnywhereAPI.Builder skipHostnameVerification()
public AnywhereAPI.Builder readTimeoutDuration(long readTimeoutDuration, java.util.concurrent.TimeUnit timeUnit)
readTimeoutDuration - The amount of time to wait between bytes read before timing
outtimeUnit - the unit of time (e.g., minutes, hours, etc.)public AnywhereAPI.Builder writeTimeoutDuration(long writeTimeoutDuration, java.util.concurrent.TimeUnit timeUnit)
writeTimeoutDuration - The amount of time to wait between bytes written before
timing outtimeUnit - the unit of time (e.g., minutes, hours, etc.)public AnywhereAPI.Builder proxy(java.lang.String hostname, int port)
proxy(Proxy)hostname - The hostname of the proxyport - The port of the proxypublic AnywhereAPI.Builder proxy(java.net.Proxy proxy)
proxy(String, int)proxy - The proxy to use