Class HttpConnectOptions
java.lang.Object
io.vertx.core.http.HttpConnectOptions
- Direct Known Subclasses:
RequestOptions
Options describing how an
HttpClient will connect to a server.- Author:
- Julien Viet
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longThe default connect timeout =-1L(disabled)static final StringThe default value for host name =nullstatic final IntegerThe default value for port =nullstatic final HttpVersionThe default value for protocol version =nullstatic final ProxyOptionsThe default value for proxy options =nullstatic final SocketAddressThe default value for server method =nullstatic final BooleanThe default value for SSL =null -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructorCopy constructorHttpConnectOptions(JsonObject json) Create options from JSON -
Method Summary
Modifier and TypeMethodDescriptionlonggetHost()Get the host name to be used by the client request.getPort()Get the port to be used by the client request.Get the proxy options override for connectionsGet the server address to be used by the client request.protected voidinit()isSsl()setConnectTimeout(long timeout) Sets the amount of time after which, if the request is not obtained from the client within the timeout period, theFuture<HttpClientRequest>obtained from the client is failed with aTimeoutException.Set the host name to be used by the client request.Set the port to be used by the client request.setProtocolVersion(HttpVersion protocolVersion) Set the desired HTTP protocol version for this connection.setProxyOptions(ProxyOptions proxyOptions) Override theHttpClientOptions.setProxyOptions(ProxyOptions)proxy options for connections.Set the server address to be used by the client request.Set whether SSL/TLS is enabled.setSslOptions(ClientSSLOptions sslOptions) Set the SSL options to use.toJson()
-
Field Details
-
DEFAULT_PROTOCOL_VERSION
The default value for protocol version =null -
DEFAULT_PROXY_OPTIONS
The default value for proxy options =null -
DEFAULT_SERVER
The default value for server method =null -
DEFAULT_HOST
The default value for host name =null -
DEFAULT_PORT
The default value for port =null -
DEFAULT_SSL
The default value for SSL =null -
DEFAULT_CONNECT_TIMEOUT
public static final long DEFAULT_CONNECT_TIMEOUTThe default connect timeout =-1L(disabled)- See Also:
-
-
Constructor Details
-
HttpConnectOptions
public HttpConnectOptions()Default constructor -
HttpConnectOptions
Copy constructor- Parameters:
other- the options to copy
-
HttpConnectOptions
-
-
Method Details
-
init
protected void init() -
getProtocolVersion
- Returns:
- the connection desired protocol or
nullto use the default agent configured protocol
-
setProtocolVersion
Set the desired HTTP protocol version for this connection.- Parameters:
protocolVersion- the desired protocol version- Returns:
- a reference to this, so the API can be used fluently
-
getProxyOptions
Get the proxy options override for connections- Returns:
- proxy options override
-
setProxyOptions
Override theHttpClientOptions.setProxyOptions(ProxyOptions)proxy options for connections.- Parameters:
proxyOptions- proxy options override object- Returns:
- a reference to this, so the API can be used fluently
-
getServer
Get the server address to be used by the client request.- Returns:
- the server address
-
setServer
Set the server address to be used by the client request.When the server address is
null, the address will be resolved after thehostproperty by the Vert.x resolver.Use this when you want to connect to a specific server address without name resolution.
- Returns:
- a reference to this, so the API can be used fluently
-
getHost
-
setHost
Set the host name to be used by the client request.- Returns:
- a reference to this, so the API can be used fluently
-
getPort
-
setPort
Set the port to be used by the client request.- Returns:
- a reference to this, so the API can be used fluently
-
isSsl
- Returns:
- is SSL/TLS enabled?
-
setSsl
Set whether SSL/TLS is enabled.- Parameters:
ssl- true if enabled- Returns:
- a reference to this, so the API can be used fluently
-
getSslOptions
- Returns:
- the SSL options
-
setSslOptions
Set the SSL options to use.When none is provided, the client SSL options will be used instead.
- Parameters:
sslOptions- the SSL options to use- Returns:
- a reference to this, so the API can be used fluently
-
getConnectTimeout
public long getConnectTimeout()- Returns:
- the amount of time after which, if the request is not obtained from the client within the timeout period,
the
Future<HttpClientRequest>obtained from the client is failed with aTimeoutException
-
setConnectTimeout
Sets the amount of time after which, if the request is not obtained from the client within the timeout period, theFuture<HttpClientRequest>obtained from the client is failed with aTimeoutException. Note this is not related to the TCPHttpClientOptions.setConnectTimeout(int)option, when a request is made against a pooled HTTP client, the timeout applies to the duration to obtain a connection from the pool to serve the request, the timeout might fire because the server does not respond in time or the pool is too busy to serve a request.- Parameters:
timeout- the amount of time in milliseconds.- Returns:
- a reference to this, so the API can be used fluently
-
toJson
-