public final class Client
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
Client.TransportListener |
| Constructor and Description |
|---|
Client() |
Client(ClientConfig clientConfig) |
Client(ClientConfig clientConfig,
io.netty.buffer.ByteBufAllocator byteBufAllocator,
io.netty.channel.EventLoopGroup eventLoopGroup,
java.lang.Class<? extends io.netty.channel.socket.SocketChannel> socketChannelClass) |
| Modifier and Type | Method and Description |
|---|---|
static ClientBuilder |
builder() |
void |
close() |
void |
close(Transport transport) |
void |
continuation(Transport transport,
Request request)
For following redirects, construct a new transport.
|
Transport |
execute(Request request) |
<T> java.util.concurrent.CompletableFuture<T> |
execute(Request request,
java.util.function.Function<io.netty.handler.codec.http.FullHttpResponse,T> supplier) |
io.netty.buffer.ByteBufAllocator |
getByteBufAllocator() |
ClientConfig |
getClientConfig() |
io.netty.channel.EventLoopGroup |
getEventLoopGroup() |
BoundedChannelPool<HttpAddress> |
getPool() |
boolean |
hasPooledConnections() |
void |
logDiagnostics(java.util.logging.Level level) |
io.netty.channel.Channel |
newChannel() |
io.netty.channel.Channel |
newChannel(HttpAddress httpAddress) |
Transport |
newTransport() |
Transport |
newTransport(HttpAddress httpAddress) |
Transport |
newTransport(org.xbib.net.URL url,
io.netty.handler.codec.http.HttpVersion httpVersion) |
Transport |
pooledExecute(Request request) |
Transport |
prepareRequest(Request request) |
void |
releaseChannel(io.netty.channel.Channel channel) |
void |
retry(Transport transport,
Request request)
Retry request by following a back-off strategy.
|
void |
setTransportListener(Client.TransportListener transportListener) |
void |
shutdown() |
void |
shutdownGracefully() |
public Client()
public Client(ClientConfig clientConfig)
public Client(ClientConfig clientConfig, io.netty.buffer.ByteBufAllocator byteBufAllocator, io.netty.channel.EventLoopGroup eventLoopGroup, java.lang.Class<? extends io.netty.channel.socket.SocketChannel> socketChannelClass)
public static ClientBuilder builder()
public ClientConfig getClientConfig()
public io.netty.buffer.ByteBufAllocator getByteBufAllocator()
public io.netty.channel.EventLoopGroup getEventLoopGroup()
public void setTransportListener(Client.TransportListener transportListener)
public boolean hasPooledConnections()
public BoundedChannelPool<HttpAddress> getPool()
public void logDiagnostics(java.util.logging.Level level)
public Transport newTransport()
public Transport newTransport(org.xbib.net.URL url, io.netty.handler.codec.http.HttpVersion httpVersion)
public Transport newTransport(HttpAddress httpAddress)
public io.netty.channel.Channel newChannel(HttpAddress httpAddress) throws java.io.IOException
java.io.IOExceptionpublic io.netty.channel.Channel newChannel()
throws java.io.IOException
java.io.IOExceptionpublic void releaseChannel(io.netty.channel.Channel channel)
throws java.io.IOException
java.io.IOExceptionpublic Transport execute(Request request) throws java.io.IOException
java.io.IOExceptionpublic <T> java.util.concurrent.CompletableFuture<T> execute(Request request, java.util.function.Function<io.netty.handler.codec.http.FullHttpResponse,T> supplier) throws java.io.IOException
java.io.IOExceptionpublic Transport pooledExecute(Request request) throws java.io.IOException
java.io.IOExceptionpublic void continuation(Transport transport, Request request) throws java.io.IOException
For following redirects, construct a new transport.
transport - the previous transportrequest - the new request for continuing the request.java.io.IOExceptionpublic void retry(Transport transport, Request request) throws java.io.IOException
Retry request by following a back-off strategy.
transport - the transport to retryrequest - the request to retryjava.io.IOException - if retry failedpublic void close(Transport transport) throws java.io.IOException
java.io.IOExceptionpublic void close()
throws java.io.IOException
java.io.IOExceptionpublic void shutdownGracefully()
throws java.io.IOException
java.io.IOExceptionpublic void shutdown()