Package software.amazon.awssdk.crt.http
Class Http2StreamManagerOptions
- java.lang.Object
- 
- software.amazon.awssdk.crt.http.Http2StreamManagerOptions
 
- 
 public class Http2StreamManagerOptions extends Object Contains all the configuration options for a Http2StreamManager instance
- 
- 
Field SummaryFields Modifier and Type Field Description static intDEFAULT_CONNECTION_PING_TIMEOUT_MSstatic intDEFAULT_MAXstatic intDEFAULT_MAX_CONNECTIONSstatic intDEFAULT_MAX_WINDOW_SIZE
 - 
Constructor SummaryConstructors Constructor Description Http2StreamManagerOptions()Default constructor
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description HttpClientConnectionManagerOptionsgetConnectionManagerOptions()intgetConnectionPingPeriodMs()intgetConnectionPingTimeoutMs()intgetIdealConcurrentStreamsPerConnection()List<Http2ConnectionSetting>getInitialSettingsList()intgetMaxConcurrentStreamsPerConnection()booleanhasPriorKnowledge()booleanisConnectionManualWindowManagement()booleanshouldCloseConnectionOnServerError()voidvalidateOptions()Validate the stream manager options are valid to use.Http2StreamManagerOptionswithCloseConnectionOnServerError(boolean closeConnectionOnServerError)Set to true to inform stream manager to close connection when response with 500/502/503/504 received.Http2StreamManagerOptionswithConnectionManagerOptions(HttpClientConnectionManagerOptions connectionManagerOptions)Required.Http2StreamManagerOptionswithConnectionManualWindowManagement(boolean connectionManualWindowManagement)Set to true to manually manage the flow-control window of whole HTTP/2 connection.Http2StreamManagerOptionswithConnectionPing(int periodMs, int timeoutMs)Settings to control the period ping to be sent for connections held by stream manager.Http2StreamManagerOptionswithIdealConcurrentStreamsPerConnection(int idealConcurrentStreamsPerConnection)For HTTP/2 stream manager only.Http2StreamManagerOptionswithInitialSettingsList(List<Http2ConnectionSetting> initialSettingsList)For HTTP/2 stream manager only.Http2StreamManagerOptionswithMaxConcurrentStreamsPerConnection(int maxConcurrentStreamsPerConnection)Default is no limit, which will use the limit from the server.Http2StreamManagerOptionswithPriorKnowledge(boolean priorKnowledge)Set to true to use prior knowledge to setup connection.
 
- 
- 
- 
Field Detail- 
DEFAULT_MAX_WINDOW_SIZEpublic static final int DEFAULT_MAX_WINDOW_SIZE - See Also:
- Constant Field Values
 
 - 
DEFAULT_MAXpublic static final int DEFAULT_MAX - See Also:
- Constant Field Values
 
 - 
DEFAULT_MAX_CONNECTIONSpublic static final int DEFAULT_MAX_CONNECTIONS - See Also:
- Constant Field Values
 
 - 
DEFAULT_CONNECTION_PING_TIMEOUT_MSpublic static final int DEFAULT_CONNECTION_PING_TIMEOUT_MS - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
withInitialSettingsListpublic Http2StreamManagerOptions withInitialSettingsList(List<Http2ConnectionSetting> initialSettingsList) For HTTP/2 stream manager only. The initial settings for the HTTP/2 connections made by stream manger. `Http2ConnectionSettingListBuilder` can help to build the settings list. To control the initial stream-level flow-control window, set the INITIAL_WINDOW_SIZE setting in the initial settings.- Parameters:
- initialSettingsList- The List of initial settings
- Returns:
- this
 
 - 
getInitialSettingsListpublic List<Http2ConnectionSetting> getInitialSettingsList() - Returns:
- The List of initial settings
 
 - 
withIdealConcurrentStreamsPerConnectionpublic Http2StreamManagerOptions withIdealConcurrentStreamsPerConnection(int idealConcurrentStreamsPerConnection) For HTTP/2 stream manager only. The ideal number of concurrent streams for a connection. Stream manager will try to create a new connection if one connection reaches this number. But, if the max connections reaches, manager will reuse connections to create the acquired steams as much as possible.- Parameters:
- idealConcurrentStreamsPerConnection- The ideal number of concurrent streams for a connection
- Returns:
- this
 
 - 
getIdealConcurrentStreamsPerConnectionpublic int getIdealConcurrentStreamsPerConnection() - Returns:
- The ideal number of concurrent streams for a connection used for manager
 
 - 
withMaxConcurrentStreamsPerConnectionpublic Http2StreamManagerOptions withMaxConcurrentStreamsPerConnection(int maxConcurrentStreamsPerConnection) Default is no limit, which will use the limit from the server. 0 will be considered as using the default value. The real number of concurrent streams per connection will be controlled by the minimal value of the setting from other end and the value here.- Parameters:
- maxConcurrentStreamsPerConnection- The max number of concurrent streams for a connection
- Returns:
- this
 
 - 
getMaxConcurrentStreamsPerConnectionpublic int getMaxConcurrentStreamsPerConnection() - Returns:
- The max number of concurrent streams for a connection set for manager. It could be different than the real limits, which is the minimal set for manager and the settings from the other side.
 
 - 
isConnectionManualWindowManagementpublic boolean isConnectionManualWindowManagement() - Returns:
- The connection level manual flow control enabled or not.
 
 - 
withConnectionManualWindowManagementpublic Http2StreamManagerOptions withConnectionManualWindowManagement(boolean connectionManualWindowManagement) Set to true to manually manage the flow-control window of whole HTTP/2 connection. The stream level flow-control window is controlled by the manualWindowManagement in connectionManagerOptions.- Parameters:
- connectionManualWindowManagement- Enable connection level manual flow control or not.
- Returns:
- this
 
 - 
getConnectionManagerOptionspublic HttpClientConnectionManagerOptions getConnectionManagerOptions() - Returns:
- The connection manager options for the underlying connection manager.
 
 - 
withConnectionManagerOptionspublic Http2StreamManagerOptions withConnectionManagerOptions(HttpClientConnectionManagerOptions connectionManagerOptions) Required. The configuration options for the connection manager under the hood. It controls the connection specific thing for the stream manager. See `HttpClientConnectionManagerOptions` for details. Note: 1. the windowSize of connection manager will be ignored, as the initial flow-control window size for HTTP/2 stream is controlled by the initial settings. 2. The expectedHttpVersion will also be ignored.- Parameters:
- connectionManagerOptions- The connection manager options for the underlying connection manager
- Returns:
- this
 
 - 
hasPriorKnowledgepublic boolean hasPriorKnowledge() - Returns:
- Prior knowledge is used or not
 
 - 
withPriorKnowledgepublic Http2StreamManagerOptions withPriorKnowledge(boolean priorKnowledge) Set to true to use prior knowledge to setup connection. If any TLS was set, exception will be raised if prior knowledge is set during validation. If NO TLS was set, exception will be raised if prior knowledge is NOT set during validation.- Parameters:
- priorKnowledge- Prior knowledge used or not.
- Returns:
- this
 
 - 
shouldCloseConnectionOnServerErrorpublic boolean shouldCloseConnectionOnServerError() - Returns:
- Connection closed or not when server error happened (500/502/503/504 response status code received).
 
 - 
withCloseConnectionOnServerErrorpublic Http2StreamManagerOptions withCloseConnectionOnServerError(boolean closeConnectionOnServerError) Set to true to inform stream manager to close connection when response with 500/502/503/504 received. Stream manager will stop using the connection with server error will start a new connection for other streams.- Parameters:
- closeConnectionOnServerError- Connection closed or not when server error happened.
- Returns:
- this
 
 - 
withConnectionPingpublic Http2StreamManagerOptions withConnectionPing(int periodMs, int timeoutMs) Settings to control the period ping to be sent for connections held by stream manager.- Parameters:
- periodMs- The period for all the connections held by stream manager to send a PING in milliseconds. If you specify 0, manager will NOT send any PING.
- timeoutMs- Network connection will be closed if a ping response is not received within this amount of time (milliseconds). If you specify 0, a default value will be used. If this is larger than periodMs, it will be capped to be equal.
- Returns:
- this
 
 - 
getConnectionPingPeriodMspublic int getConnectionPingPeriodMs() - Returns:
- The period for all the connections held by stream manager to send a PING in milliseconds.
 
 - 
getConnectionPingTimeoutMspublic int getConnectionPingTimeoutMs() - Returns:
- The time for closing connection if ping not received within this amount of time in milliseconds
 
 - 
validateOptionspublic void validateOptions() Validate the stream manager options are valid to use. Throw exceptions if not.
 
- 
 
-