Package com.microsoft.azure.kusto.data
Class HttpClientProperties.HttpClientPropertiesBuilder
- java.lang.Object
-
- com.microsoft.azure.kusto.data.HttpClientProperties.HttpClientPropertiesBuilder
-
- Enclosing class:
- HttpClientProperties
public static class HttpClientProperties.HttpClientPropertiesBuilder extends Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HttpClientPropertiesbuild()HttpClientProperties.HttpClientPropertiesBuilderkeepAlive(boolean keepAlive)Set whether or not a custom connection keep-alive time should be used.HttpClientProperties.HttpClientPropertiesBuildermaxConnectionsPerRoute(Integer maxConnections)Sets the maximum number of connections the client may keep open at the same time for the same route (endpoint).HttpClientProperties.HttpClientPropertiesBuildermaxConnectionsTotal(Integer maxConnectionsTotal)Sets the total maximum number of connections the client may keep open at the same time.HttpClientProperties.HttpClientPropertiesBuildermaxIdleTime(Integer maxIdleTime)Set the maximum time persistent connections can stay idle while kept alive in the connection pool.HttpClientProperties.HttpClientPropertiesBuildermaxKeepAliveTime(Integer maxKeepAliveTime)Sets the time a connection can remain idle as part of the keep-alive strategy.HttpClientProperties.HttpClientPropertiesBuilderproxy(org.apache.http.HttpHost proxy)Sets a proxy server to use for the client.
-
-
-
Method Detail
-
maxIdleTime
public HttpClientProperties.HttpClientPropertiesBuilder maxIdleTime(Integer maxIdleTime)
Set the maximum time persistent connections can stay idle while kept alive in the connection pool. Connections whose inactivity period exceeds this value will get closed and evicted from the pool. Defaults to 120 seconds (2 minutes).- Parameters:
maxIdleTime- the maximum idle time expressed in seconds- Returns:
- the builder instance
-
keepAlive
public HttpClientProperties.HttpClientPropertiesBuilder keepAlive(boolean keepAlive)
Set whether or not a custom connection keep-alive time should be used. If set tofalse, the HTTP client will use the default connection keep-alive strategy, which is to use only the server instructions (if any) set in theKeep-Aliveresponse header. If set totrue, the HTTP client will use a custom connection keep-alive strategy which uses the server instructions set in theKeep-Aliveresponse header; if the response doesn't contain aKeep-Aliveheader, the client will use a default keep-alive period which is configurable via maxKeepAliveTime(Integer).- Parameters:
keepAlive- set tofalseto use a default keep-alive strategy or totrueto use a custom one- Returns:
- the builder instance
- See Also:
maxKeepAliveTime(Integer), Keep-Alive
-
maxKeepAliveTime
public HttpClientProperties.HttpClientPropertiesBuilder maxKeepAliveTime(Integer maxKeepAliveTime)
Sets the time a connection can remain idle as part of the keep-alive strategy. This value is only used if keepAlive(boolean) is set totrue. Defaults to 120 seconds (2 minutes).- Parameters:
maxKeepAliveTime- the maximum time a connection may remain idle, expressed in seconds- Returns:
- the builder instance
-
maxConnectionsTotal
public HttpClientProperties.HttpClientPropertiesBuilder maxConnectionsTotal(Integer maxConnectionsTotal)
Sets the total maximum number of connections the client may keep open at the same time.- Parameters:
maxConnectionsTotal- the total maximum number of connections- Returns:
- the builder instance
-
maxConnectionsPerRoute
public HttpClientProperties.HttpClientPropertiesBuilder maxConnectionsPerRoute(Integer maxConnections)
Sets the maximum number of connections the client may keep open at the same time for the same route (endpoint).- Parameters:
maxConnections- the maximum number of connections per route- Returns:
- the builder instance
-
proxy
public HttpClientProperties.HttpClientPropertiesBuilder proxy(org.apache.http.HttpHost proxy)
Sets a proxy server to use for the client.- Parameters:
proxy- the proxy server- Returns:
- the builder instance
-
build
public HttpClientProperties build()
-
-