public final class HttpClientImpl<I,O> extends HttpClient<I,O>
| Modifier and Type | Method and Description |
|---|---|
<II,OO> HttpClientImpl<II,OO> |
addChannelHandlerAfter(io.netty.util.concurrent.EventExecutorGroup group,
java.lang.String baseName,
java.lang.String name,
rx.functions.Func0<io.netty.channel.ChannelHandler> handlerFactory)
Adds a
ChannelHandler to ChannelPipeline for all connections created by this client. |
<II,OO> HttpClientImpl<II,OO> |
addChannelHandlerAfter(java.lang.String baseName,
java.lang.String name,
rx.functions.Func0<io.netty.channel.ChannelHandler> handlerFactory)
Adds a
ChannelHandler to ChannelPipeline for all connections created by this client. |
<II,OO> HttpClientImpl<II,OO> |
addChannelHandlerBefore(io.netty.util.concurrent.EventExecutorGroup group,
java.lang.String baseName,
java.lang.String name,
rx.functions.Func0<io.netty.channel.ChannelHandler> handlerFactory)
Adds a
ChannelHandler to ChannelPipeline for all connections created by this client. |
<II,OO> HttpClientImpl<II,OO> |
addChannelHandlerBefore(java.lang.String baseName,
java.lang.String name,
rx.functions.Func0<io.netty.channel.ChannelHandler> handlerFactory)
Adds a
ChannelHandler to ChannelPipeline for all connections created by this client. |
<II,OO> HttpClientImpl<II,OO> |
addChannelHandlerFirst(io.netty.util.concurrent.EventExecutorGroup group,
java.lang.String name,
rx.functions.Func0<io.netty.channel.ChannelHandler> handlerFactory)
Adds a
ChannelHandler to ChannelPipeline for all connections created by this client. |
<II,OO> HttpClientImpl<II,OO> |
addChannelHandlerFirst(java.lang.String name,
rx.functions.Func0<io.netty.channel.ChannelHandler> handlerFactory)
Adds a
ChannelHandler to ChannelPipeline for all connections created by this client. |
<II,OO> HttpClientImpl<II,OO> |
addChannelHandlerLast(io.netty.util.concurrent.EventExecutorGroup group,
java.lang.String name,
rx.functions.Func0<io.netty.channel.ChannelHandler> handlerFactory)
Adds a
ChannelHandler to ChannelPipeline for all connections created by this client. |
<II,OO> HttpClientImpl<II,OO> |
addChannelHandlerLast(java.lang.String name,
rx.functions.Func0<io.netty.channel.ChannelHandler> handlerFactory)
Adds a
ChannelHandler to ChannelPipeline for all connections created by this client. |
<T> HttpClientImpl<I,O> |
channelOption(io.netty.channel.ChannelOption<T> option,
T value)
Creates a new client instances, inheriting all configurations from this client and adding a
ChannelOption for the connections created by the newly created client instance. |
HttpClientImpl<I,O> |
channelProvider(io.reactivex.netty.client.ChannelProviderFactory providerFactory)
Creates a new client instance, inheriting all configurations from this client and using the passed
providerFactory. |
static HttpClient<io.netty.buffer.ByteBuf,io.netty.buffer.ByteBuf> |
create(io.reactivex.netty.client.ConnectionProviderFactory<io.netty.buffer.ByteBuf,io.netty.buffer.ByteBuf> providerFactory,
rx.Observable<io.reactivex.netty.client.Host> hostStream) |
static HttpClient<io.netty.buffer.ByteBuf,io.netty.buffer.ByteBuf> |
create(java.net.SocketAddress socketAddress) |
HttpClientRequest<I,O> |
createConnect(java.lang.String uri)
Creates a CONNECT request for the passed URI.
|
HttpClientRequest<I,O> |
createDelete(java.lang.String uri)
Creates a DELETE request for the passed URI.
|
HttpClientRequest<I,O> |
createGet(java.lang.String uri)
Creates a GET request for the passed URI.
|
HttpClientRequest<I,O> |
createHead(java.lang.String uri)
Creates a HEAD request for the passed URI.
|
HttpClientRequest<I,O> |
createOptions(java.lang.String uri)
Creates an OPTIONS request for the passed URI.
|
HttpClientRequest<I,O> |
createPatch(java.lang.String uri)
Creates a PATCH request for the passed URI.
|
HttpClientRequest<I,O> |
createPost(java.lang.String uri)
Creates a POST request for the passed URI.
|
HttpClientRequest<I,O> |
createPut(java.lang.String uri)
Creates a PUT request for the passed URI.
|
HttpClientRequest<I,O> |
createRequest(io.netty.handler.codec.http.HttpMethod method,
java.lang.String uri)
Creates a request for the passed HTTP method and URI.
|
HttpClientRequest<I,O> |
createRequest(io.netty.handler.codec.http.HttpVersion version,
io.netty.handler.codec.http.HttpMethod method,
java.lang.String uri)
Creates a request for the passed HTTP version, method and URI.
|
HttpClientRequest<I,O> |
createTrace(java.lang.String uri)
Creates a TRACE request for the passed URI.
|
HttpClientImpl<I,O> |
enableWireLogging(io.netty.handler.logging.LogLevel wireLoggingLevel)
Creates a new client instances, inheriting all configurations from this client and enabling wire logging at the
passed level for the newly created client instance.
|
HttpClientImpl<I,O> |
followRedirects(boolean follow)
Creates a new client instances, inheriting all configurations from this client and enabling/disabling redirects
for all requests created by the newly created client instance.
|
HttpClientImpl<I,O> |
followRedirects(int maxRedirects)
Creates a new client instances, inheriting all configurations from this client and following the passed number of
max HTTP redirects.
|
HttpClientInterceptorChain<I,O> |
intercept()
Starts the process of adding interceptors to this client.
|
<II,OO> HttpClientImpl<II,OO> |
pipelineConfigurator(rx.functions.Action1<io.netty.channel.ChannelPipeline> pipelineConfigurator)
Creates a new client instances, inheriting all configurations from this client and using the passed
action to configure all the connections created by the newly created client instance.
|
HttpClientImpl<I,O> |
readTimeOut(int timeOut,
java.util.concurrent.TimeUnit timeUnit)
Creates a new client instances, inheriting all configurations from this client and adding the passed read timeout
for all requests created by the newly created client instance.
|
HttpClientImpl<I,O> |
secure(rx.functions.Func1<io.netty.buffer.ByteBufAllocator,javax.net.ssl.SSLEngine> sslEngineFactory)
Creates a new client instance, inheriting all configurations from this client and using the passed
sslEngineFactory for all secured connections created by the newly created client instance. |
HttpClientImpl<I,O> |
secure(io.reactivex.netty.ssl.SslCodec sslCodec)
Creates a new client instance, inheriting all configurations from this client and using the passed
sslCodec for all secured connections created by the newly created client instance. |
HttpClientImpl<I,O> |
secure(javax.net.ssl.SSLEngine sslEngine)
Creates a new client instance, inheriting all configurations from this client and using the passed
sslEngine for all secured connections created by the newly created client instance. |
rx.Subscription |
subscribe(HttpClientEventsListener listener) |
HttpClientImpl<I,O> |
unsafeSecure()
Creates a new client instance, inheriting all configurations from this client and using a trust-all
TrustManagerFactoryfor all secured connections created by the newly created client instance. |
newClient, newClient, newClientpublic HttpClientRequest<I,O> createGet(java.lang.String uri)
InterceptingHttpClientcreateGet in class InterceptingHttpClient<I,O>uri - The URI for the request. The URI should be absolute and should not contain the scheme, host and port.HttpClientRequest.public HttpClientRequest<I,O> createPost(java.lang.String uri)
InterceptingHttpClientcreatePost in class InterceptingHttpClient<I,O>uri - The URI for the request. The URI should be absolute and should not contain the scheme, host and port.HttpClientRequest.public HttpClientRequest<I,O> createPut(java.lang.String uri)
InterceptingHttpClientcreatePut in class InterceptingHttpClient<I,O>uri - The URI for the request. The URI should be absolute and should not contain the scheme, host and port.HttpClientRequest.public HttpClientRequest<I,O> createDelete(java.lang.String uri)
InterceptingHttpClientcreateDelete in class InterceptingHttpClient<I,O>uri - The URI for the request. The URI should be absolute and should not contain the scheme, host and port.HttpClientRequest.public HttpClientRequest<I,O> createHead(java.lang.String uri)
InterceptingHttpClientcreateHead in class InterceptingHttpClient<I,O>uri - The URI for the request. The URI should be absolute and should not contain the scheme, host and port.HttpClientRequest.public HttpClientRequest<I,O> createOptions(java.lang.String uri)
InterceptingHttpClientcreateOptions in class InterceptingHttpClient<I,O>uri - The URI for the request. The URI should be absolute and should not contain the scheme, host and port.HttpClientRequest.public HttpClientRequest<I,O> createPatch(java.lang.String uri)
InterceptingHttpClientcreatePatch in class InterceptingHttpClient<I,O>uri - The URI for the request. The URI should be absolute and should not contain the scheme, host and port.HttpClientRequest.public HttpClientRequest<I,O> createTrace(java.lang.String uri)
InterceptingHttpClientcreateTrace in class InterceptingHttpClient<I,O>uri - The URI for the request. The URI should be absolute and should not contain the scheme, host and port.HttpClientRequest.public HttpClientRequest<I,O> createConnect(java.lang.String uri)
InterceptingHttpClientcreateConnect in class InterceptingHttpClient<I,O>uri - The URI for the request. The URI should be absolute and should not contain the scheme, host and port.HttpClientRequest.public HttpClientRequest<I,O> createRequest(io.netty.handler.codec.http.HttpMethod method, java.lang.String uri)
InterceptingHttpClientcreateRequest in class InterceptingHttpClient<I,O>method - Http Method.uri - The URI for the request. The URI should be absolute and should not contain the scheme, host and port.HttpClientRequest.public HttpClientRequest<I,O> createRequest(io.netty.handler.codec.http.HttpVersion version, io.netty.handler.codec.http.HttpMethod method, java.lang.String uri)
InterceptingHttpClientcreateRequest in class InterceptingHttpClient<I,O>version - HTTP versionmethod - Http Method.uri - The URI for the request. The URI should be absolute and should not contain the scheme, host and port.HttpClientRequest.public HttpClientInterceptorChain<I,O> intercept()
InterceptingHttpClientintercept in class InterceptingHttpClient<I,O>public HttpClientImpl<I,O> readTimeOut(int timeOut, java.util.concurrent.TimeUnit timeUnit)
HttpClientreadTimeOut in class HttpClient<I,O>timeOut - Read timeout duration.timeUnit - Timeunit for the timeout.HttpClient instance.public HttpClientImpl<I,O> followRedirects(int maxRedirects)
HttpClientfollowRedirects in class HttpClient<I,O>maxRedirects - Maximum number of redirects to follow for any request.HttpClient instance.public HttpClientImpl<I,O> followRedirects(boolean follow)
HttpClientfollowRedirects in class HttpClient<I,O>follow - true to follow redirects. false to disable any redirects.HttpClient instance.public <T> HttpClientImpl<I,O> channelOption(io.netty.channel.ChannelOption<T> option, T value)
HttpClientChannelOption for the connections created by the newly created client instance.channelOption in class HttpClient<I,O>option - Option to add.value - Value for the option.HttpClient instance.public <II,OO> HttpClientImpl<II,OO> addChannelHandlerFirst(java.lang.String name, rx.functions.Func0<io.netty.channel.ChannelHandler> handlerFactory)
HttpClientChannelHandler to ChannelPipeline for all connections created by this client. The specified
handler is added at the first position of the pipeline as specified by
ChannelPipeline.addFirst(String, ChannelHandler)
For better flexibility of pipeline modification, the method HttpClient.pipelineConfigurator(Action1) will be more
convenient.addChannelHandlerFirst in class HttpClient<I,O>name - Name of the handler.handlerFactory - Factory to create handler instance to add.HttpClient instance.public <II,OO> HttpClientImpl<II,OO> addChannelHandlerFirst(io.netty.util.concurrent.EventExecutorGroup group, java.lang.String name, rx.functions.Func0<io.netty.channel.ChannelHandler> handlerFactory)
HttpClientChannelHandler to ChannelPipeline for all connections created by this client. The specified
handler is added at the first position of the pipeline as specified by
ChannelPipeline.addFirst(EventExecutorGroup, String, ChannelHandler)
For better flexibility of pipeline modification, the method HttpClient.pipelineConfigurator(Action1) will be more
convenient.addChannelHandlerFirst in class HttpClient<I,O>group - the EventExecutorGroup which will be used to execute the ChannelHandler
methodsname - the name of the handler to appendhandlerFactory - Factory to create handler instance to add.HttpClient instance.public <II,OO> HttpClientImpl<II,OO> addChannelHandlerLast(java.lang.String name, rx.functions.Func0<io.netty.channel.ChannelHandler> handlerFactory)
HttpClientChannelHandler to ChannelPipeline for all connections created by this client. The specified
handler is added at the last position of the pipeline as specified by
ChannelPipeline.addLast(String, ChannelHandler)
For better flexibility of pipeline modification, the method HttpClient.pipelineConfigurator(Action1) will be more
convenient.addChannelHandlerLast in class HttpClient<I,O>name - Name of the handler.handlerFactory - Factory to create handler instance to add.HttpClient instance.public <II,OO> HttpClientImpl<II,OO> addChannelHandlerLast(io.netty.util.concurrent.EventExecutorGroup group, java.lang.String name, rx.functions.Func0<io.netty.channel.ChannelHandler> handlerFactory)
HttpClientChannelHandler to ChannelPipeline for all connections created by this client. The specified
handler is added at the last position of the pipeline as specified by
ChannelPipeline.addLast(EventExecutorGroup, String, ChannelHandler)
For better flexibility of pipeline modification, the method HttpClient.pipelineConfigurator(Action1) will be more
convenient.addChannelHandlerLast in class HttpClient<I,O>group - the EventExecutorGroup which will be used to execute the ChannelHandler
methodsname - the name of the handler to appendhandlerFactory - Factory to create handler instance to add.HttpClient instance.public <II,OO> HttpClientImpl<II,OO> addChannelHandlerBefore(java.lang.String baseName, java.lang.String name, rx.functions.Func0<io.netty.channel.ChannelHandler> handlerFactory)
HttpClientChannelHandler to ChannelPipeline for all connections created by this client. The specified
handler is added before an existing handler with the passed baseName in the pipeline as specified by
ChannelPipeline.addBefore(String, String, ChannelHandler)
For better flexibility of pipeline modification, the method HttpClient.pipelineConfigurator(Action1) will be more
convenient.addChannelHandlerBefore in class HttpClient<I,O>baseName - the name of the existing handlername - Name of the handler.handlerFactory - Factory to create handler instance to add.HttpClient instance.public <II,OO> HttpClientImpl<II,OO> addChannelHandlerBefore(io.netty.util.concurrent.EventExecutorGroup group, java.lang.String baseName, java.lang.String name, rx.functions.Func0<io.netty.channel.ChannelHandler> handlerFactory)
HttpClientChannelHandler to ChannelPipeline for all connections created by this client. The specified
handler is added before an existing handler with the passed baseName in the pipeline as specified by
ChannelPipeline.addBefore(EventExecutorGroup, String, String, ChannelHandler)
For better flexibility of pipeline modification, the method HttpClient.pipelineConfigurator(Action1) will be more
convenient.addChannelHandlerBefore in class HttpClient<I,O>group - the EventExecutorGroup which will be used to execute the ChannelHandler
methodsbaseName - the name of the existing handlername - the name of the handler to appendhandlerFactory - Factory to create handler instance to add.HttpClient instance.public <II,OO> HttpClientImpl<II,OO> addChannelHandlerAfter(java.lang.String baseName, java.lang.String name, rx.functions.Func0<io.netty.channel.ChannelHandler> handlerFactory)
HttpClientChannelHandler to ChannelPipeline for all connections created by this client. The specified
handler is added after an existing handler with the passed baseName in the pipeline as specified by
ChannelPipeline.addAfter(String, String, ChannelHandler)addChannelHandlerAfter in class HttpClient<I,O>baseName - the name of the existing handlername - Name of the handler.handlerFactory - Factory to create handler instance to add.HttpClient instance.public <II,OO> HttpClientImpl<II,OO> addChannelHandlerAfter(io.netty.util.concurrent.EventExecutorGroup group, java.lang.String baseName, java.lang.String name, rx.functions.Func0<io.netty.channel.ChannelHandler> handlerFactory)
HttpClientChannelHandler to ChannelPipeline for all connections created by this client. The specified
handler is added after an existing handler with the passed baseName in the pipeline as specified by
ChannelPipeline.addAfter(EventExecutorGroup, String, String, ChannelHandler)
For better flexibility of pipeline modification, the method HttpClient.pipelineConfigurator(Action1) will be more
convenient.addChannelHandlerAfter in class HttpClient<I,O>group - the EventExecutorGroup which will be used to execute the ChannelHandler
methodsbaseName - the name of the existing handlername - the name of the handler to appendhandlerFactory - Factory to create handler instance to add.HttpClient instance.public <II,OO> HttpClientImpl<II,OO> pipelineConfigurator(rx.functions.Action1<io.netty.channel.ChannelPipeline> pipelineConfigurator)
HttpClientpipelineConfigurator in class HttpClient<I,O>pipelineConfigurator - Action to configure ChannelPipeline.HttpClient instance.public HttpClientImpl<I,O> secure(rx.functions.Func1<io.netty.buffer.ByteBufAllocator,javax.net.ssl.SSLEngine> sslEngineFactory)
HttpClientsslEngineFactory for all secured connections created by the newly created client instance.
If the SSLEngine instance can be statically, created, HttpClient.secure(SSLEngine) can be used.secure in class HttpClient<I,O>sslEngineFactory - Factory for all secured connections created by the newly created client instance.HttpClient instance.public HttpClientImpl<I,O> secure(javax.net.ssl.SSLEngine sslEngine)
HttpClientsslEngine for all secured connections created by the newly created client instance.
If the SSLEngine instance can not be statically, created, HttpClient.secure(Func1) )} can be used.secure in class HttpClient<I,O>sslEngine - SSLEngine for all secured connections created by the newly created client instance.HttpClient instance.public HttpClientImpl<I,O> secure(io.reactivex.netty.ssl.SslCodec sslCodec)
HttpClientsslCodec for all secured connections created by the newly created client instance.
This is required only when the SslHandler used by SslCodec is to be modified before adding to
the ChannelPipeline. For most of the cases, HttpClient.secure(Func1) or HttpClient.secure(SSLEngine) will be
enough.secure in class HttpClient<I,O>sslCodec - SslCodec for all secured connections created by the newly created client instance.HttpClient instance.public HttpClientImpl<I,O> unsafeSecure()
HttpClientTrustManagerFactoryfor all secured connections created by the newly created client instance.
This is only for testing and should not be used for real production clients.unsafeSecure in class HttpClient<I,O>HttpClient instance.public HttpClientImpl<I,O> enableWireLogging(io.netty.handler.logging.LogLevel wireLoggingLevel)
HttpClientenableWireLogging in class HttpClient<I,O>wireLoggingLevel - Logging level at which the wire logs will be logged. The wire logging will only be done if
logging is enabled at this level for LoggingHandlerHttpClient instance.public HttpClientImpl<I,O> channelProvider(io.reactivex.netty.client.ChannelProviderFactory providerFactory)
HttpClientproviderFactory.channelProvider in class HttpClient<I,O>providerFactory - Channel provider factory.HttpClient instance.public rx.Subscription subscribe(HttpClientEventsListener listener)
public static HttpClient<io.netty.buffer.ByteBuf,io.netty.buffer.ByteBuf> create(io.reactivex.netty.client.ConnectionProviderFactory<io.netty.buffer.ByteBuf,io.netty.buffer.ByteBuf> providerFactory, rx.Observable<io.reactivex.netty.client.Host> hostStream)
public static HttpClient<io.netty.buffer.ByteBuf,io.netty.buffer.ByteBuf> create(java.net.SocketAddress socketAddress)