Package software.amazon.awssdk.crt.http
Class HttpClientConnectionManagerOptions
- java.lang.Object
-
- software.amazon.awssdk.crt.http.HttpClientConnectionManagerOptions
-
public class HttpClientConnectionManagerOptions extends Object
Contains all the configuration options for a HttpConnectionPoolManager instance
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_MAX_BUFFER_SIZEstatic intDEFAULT_MAX_CONNECTIONSstatic intDEFAULT_MAX_WINDOW_SIZE
-
Constructor Summary
Constructors Constructor Description HttpClientConnectionManagerOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetBufferSize()ClientBootstrapgetClientBootstrap()Gets the client bootstrap instance to use to create the pool's connectionslonggetMaxConnectionIdleInMilliseconds()intgetMaxConnections()HttpMonitoringOptionsgetMonitoringOptions()intgetPort()HttpProxyOptionsgetProxyOptions()SocketOptionsgetSocketOptions()TlsContextgetTlsContext()URIgetUri()intgetWindowSize()booleanisManualWindowManagement()If set to true, then the TCP read back pressure mechanism will be enabled.HttpClientConnectionManagerOptionswithBufferSize(int bufferSize)Sets the IO buffer size to use for connections in the connection poolHttpClientConnectionManagerOptionswithClientBootstrap(ClientBootstrap clientBootstrap)Sets the client bootstrap instance to use to create the pool's connectionsHttpClientConnectionManagerOptionswithManualWindowManagement(boolean manualWindowManagement)If set to true, then the TCP read back pressure mechanism will be enabled.HttpClientConnectionManagerOptionswithMaxConnectionIdleInMilliseconds(long maxConnectionIdleInMilliseconds)Sets maximum amount of time, in milliseconds, that the connection can be idle in the manager before getting culled by the managerHttpClientConnectionManagerOptionswithMaxConnections(int maxConnections)Sets the maximum number of connections allowed in the connection poolHttpClientConnectionManagerOptionswithMonitoringOptions(HttpMonitoringOptions monitoringOptions)Sets the monitoring options for connections in the connection poolHttpClientConnectionManagerOptionswithPort(int port)Sets the port to connect to for connections in the connection poolHttpClientConnectionManagerOptionswithProxyOptions(HttpProxyOptions proxyOptions)Sets the proxy options for connections in the connection poolHttpClientConnectionManagerOptionswithSocketOptions(SocketOptions socketOptions)Sets the socket options to use for connections in the connection poolHttpClientConnectionManagerOptionswithTlsContext(TlsContext tlsContext)Sets the tls context to use for connections in the connection poolHttpClientConnectionManagerOptionswithUri(URI uri)Sets the URI to use for connections in the connection poolHttpClientConnectionManagerOptionswithWindowSize(int windowSize)Sets the IO channel window size to use for connections in the connection pool
-
-
-
Field Detail
-
DEFAULT_MAX_BUFFER_SIZE
public static final int DEFAULT_MAX_BUFFER_SIZE
- See Also:
- Constant Field Values
-
DEFAULT_MAX_WINDOW_SIZE
public static final int DEFAULT_MAX_WINDOW_SIZE
- See Also:
- Constant Field Values
-
DEFAULT_MAX_CONNECTIONS
public static final int DEFAULT_MAX_CONNECTIONS
- See Also:
- Constant Field Values
-
-
Method Detail
-
withClientBootstrap
public HttpClientConnectionManagerOptions withClientBootstrap(ClientBootstrap clientBootstrap)
Sets the client bootstrap instance to use to create the pool's connections- Parameters:
clientBootstrap- ClientBootstrap to use- Returns:
- this
-
getClientBootstrap
public ClientBootstrap getClientBootstrap()
Gets the client bootstrap instance to use to create the pool's connections- Returns:
- ClientBootstrap used by this connection manager
-
withSocketOptions
public HttpClientConnectionManagerOptions withSocketOptions(SocketOptions socketOptions)
Sets the socket options to use for connections in the connection pool- Parameters:
socketOptions- The socket options to use for all connections in the manager- Returns:
- this
-
getSocketOptions
public SocketOptions getSocketOptions()
- Returns:
- the socket options to use for connections in the connection pool
-
withTlsContext
public HttpClientConnectionManagerOptions withTlsContext(TlsContext tlsContext)
Sets the tls context to use for connections in the connection pool- Parameters:
tlsContext- The TlsContext to use- Returns:
- this
-
getTlsContext
public TlsContext getTlsContext()
- Returns:
- the tls context used by connections in the connection pool
-
withWindowSize
public HttpClientConnectionManagerOptions withWindowSize(int windowSize)
Sets the IO channel window size to use for connections in the connection pool- Parameters:
windowSize- The initial window size to use for each connection- Returns:
- this
-
getWindowSize
public int getWindowSize()
- Returns:
- the IO channel window size to use for connections in the connection pool
-
withBufferSize
public HttpClientConnectionManagerOptions withBufferSize(int bufferSize)
Sets the IO buffer size to use for connections in the connection pool- Parameters:
bufferSize- Size of I/O buffer per connection- Returns:
- this
-
getBufferSize
public int getBufferSize()
- Returns:
- the IO buffer size to use for connections in the connection pool
-
withUri
public HttpClientConnectionManagerOptions withUri(URI uri)
Sets the URI to use for connections in the connection pool- Parameters:
uri- The endpoint URI to connect to- Returns:
- this
-
getUri
public URI getUri()
- Returns:
- the URI to use for connections in the connection pool
-
withPort
public HttpClientConnectionManagerOptions withPort(int port)
Sets the port to connect to for connections in the connection pool- Parameters:
port- The port to connect to- Returns:
- this
-
getPort
public int getPort()
- Returns:
- the port to connect to for connections in the connection pool
-
withMaxConnections
public HttpClientConnectionManagerOptions withMaxConnections(int maxConnections)
Sets the maximum number of connections allowed in the connection pool- Parameters:
maxConnections- maximum number of connections to pool- Returns:
- this
-
getMaxConnections
public int getMaxConnections()
- Returns:
- the maximum number of connections allowed in the connection pool
-
withProxyOptions
public HttpClientConnectionManagerOptions withProxyOptions(HttpProxyOptions proxyOptions)
Sets the proxy options for connections in the connection pool- Parameters:
proxyOptions- HttpProxyOptions for this connection manager, or null to disable proxying- Returns:
- this
-
getProxyOptions
public HttpProxyOptions getProxyOptions()
- Returns:
- the proxy options for connections in the connection pool
-
isManualWindowManagement
public boolean isManualWindowManagement()
If set to true, then the TCP read back pressure mechanism will be enabled. You should only use this if you're allowing http response body data to escape the callbacks. E.g. you're putting the data into a queue for another thread to process and need to make sure the memory usage is bounded (e.g. reactive streams). If this is enabled, you must call HttpStream.UpdateWindow() for every byte read from the OnIncomingBody callback.- Returns:
- true if manual window management is used, false otherwise
-
withManualWindowManagement
public HttpClientConnectionManagerOptions withManualWindowManagement(boolean manualWindowManagement)
If set to true, then the TCP read back pressure mechanism will be enabled. You should only use this if you're allowing http response body data to escape the callbacks. E.g. you're putting the data into a queue for another thread to process and need to make sure the memory usage is bounded (e.g. reactive streams). If this is enabled, you must call HttpStream.UpdateWindow() for every byte read from the OnIncomingBody callback.- Parameters:
manualWindowManagement- true to enable manual window management, false to use automatic window management- Returns:
- this
-
withMaxConnectionIdleInMilliseconds
public HttpClientConnectionManagerOptions withMaxConnectionIdleInMilliseconds(long maxConnectionIdleInMilliseconds)
Sets maximum amount of time, in milliseconds, that the connection can be idle in the manager before getting culled by the manager- Parameters:
maxConnectionIdleInMilliseconds- How long to allow connections to be idle before reaping them- Returns:
- this
-
getMaxConnectionIdleInMilliseconds
public long getMaxConnectionIdleInMilliseconds()
- Returns:
- How long to allow connections to be idle before reaping them
-
withMonitoringOptions
public HttpClientConnectionManagerOptions withMonitoringOptions(HttpMonitoringOptions monitoringOptions)
Sets the monitoring options for connections in the connection pool- Parameters:
monitoringOptions- Monitoring options for this connection manager, or null to disable monitoring- Returns:
- this
-
getMonitoringOptions
public HttpMonitoringOptions getMonitoringOptions()
- Returns:
- the monitoring options for connections in the connection pool
-
-