public final class Config extends Object
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
int |
getConnectTimeout() |
String |
getEndpointNATResolution() |
EndpointURLResolver |
getEndpointURLResolver() |
HostnameVerifier |
getHostNameVerifier() |
int |
getMaxConnections() |
int |
getMaxConnectionsPerRoute() |
ProxyHost |
getProxy() |
int |
getReadTimeout() |
ServiceVersionResolver |
getResolver() |
SSLContext |
getSslContext() |
ServiceVersionResolver |
getV2Resolver() |
int |
hashCode() |
boolean |
isBehindNAT() |
boolean |
isIgnoreSSLVerification() |
static Config |
newConfig() |
Config |
withConnectionTimeout(int connectTimeout)
Sets the connection timeout in milliseconds
|
Config |
withEndpointNATResolution(String natHostOrIP)
If connecting to an OpenStack deployment is in front of a NAT or Proxy then this option can be provided to dynamically change
the service endpoints hostname/IP to the one NAT is using.
|
Config |
withEndpointURLResolver(EndpointURLResolver endpointURLResolver)
Sets the Endpoint URL resolver for providing the URL resolution strategy
|
Config |
withHostnameVerifier(HostnameVerifier hostnameVerifier)
Sets the Hostname Verifier to use with SSL
|
Config |
withMaxConnections(int maxConnections)
This sets the max allowed connections for connectors who are using a connection pool.
|
Config |
withMaxConnectionsPerRoute(int maxConnectionsPerRoute)
This sets the max allowed connections per routefor connectors who are using a connection pool.
|
Config |
withProxy(ProxyHost proxy)
Indicates the connector should be using a Proxy host
|
Config |
withReadTimeout(int readTimeout)
Sets the read timeout in milliseconds
|
Config |
withResolver(ServiceVersionResolver resolver)
Sets the Service version resolver to use in determining which API version to use with a particular OpenStack service
|
Config |
withSSLContext(SSLContext sslContext)
Associates the initialized SSL Context to use when querying secure endpoints
|
Config |
withSSLVerificationDisabled()
If no SSL Context has been specified and this SSL Verification is disabled we will by pass certificate checks (useful for self signed certificates).
|
public static final Config DEFAULT
public static Config newConfig()
public Config withResolver(ServiceVersionResolver resolver)
resolver
- the version 2 version resolverpublic Config withEndpointURLResolver(EndpointURLResolver endpointURLResolver)
endpointURLResolver
- the endpoint URL resolverpublic Config withConnectionTimeout(int connectTimeout)
connectTimeout
- timeout in millisecondspublic Config withReadTimeout(int readTimeout)
readTimeout
- timeout in millisecondspublic Config withSSLContext(SSLContext sslContext)
sslContext
- public Config withMaxConnections(int maxConnections)
maxConnections
- the max connections allowedpublic Config withMaxConnectionsPerRoute(int maxConnectionsPerRoute)
maxConnectionsPerRoute
- the max connections per routepublic Config withProxy(ProxyHost proxy)
(ex: ProxyHost.of("http://myproxy", 8080)) );
proxy
- the proxy hostpublic Config withEndpointNATResolution(String natHostOrIP)
Example:
Setting NAT IP to: 24.24.24.24
Would be substitued in any endpoint for any service. Let's assume we're looking for Heat endpoint
which is returning 192.168.0.2:8000
The result would be translated dynamically to 24.24.24.24:8000 so we can access via NAT
natHostOrIP
- the FQDN Host or IP Addresspublic Config withHostnameVerifier(HostnameVerifier hostnameVerifier)
hostnameVerifier
- the hostname verifierpublic Config withSSLVerificationDisabled()
public ServiceVersionResolver getResolver()
public ServiceVersionResolver getV2Resolver()
public EndpointURLResolver getEndpointURLResolver()
public int getConnectTimeout()
public int getReadTimeout()
public SSLContext getSslContext()
public HostnameVerifier getHostNameVerifier()
public boolean isIgnoreSSLVerification()
public String getEndpointNATResolution()
public boolean isBehindNAT()
public int getMaxConnections()
public int getMaxConnectionsPerRoute()
public ProxyHost getProxy()
Copyright © 2017. All rights reserved.