Top Description Constructors Methods
org.apache.hc.client5.http.nio

public abstract Class AsyncConnectionEndpoint

extends Object
implements ModalCloseable
Class Inheritance
All Implemented Interfaces
org.apache.hc.core5.io.ModalCloseable, java.io.Closeable, java.lang.AutoCloseable
Known Direct Subclasses
org.apache.hc.client5.http.impl.nio.PoolingAsyncClientConnectionManager.InternalConnectionEndpoint
Annotations
@Contract
threading:SAFE
Imports
java.io.IOException, java.util.concurrent.Future, org.apache.hc.core5.annotation.Contract, .ThreadingBehavior, org.apache.hc.core5.concurrent.BasicFuture, .FutureCallback, org.apache.hc.core5.http.nio.AsyncClientExchangeHandler, .AsyncPushConsumer, .AsyncRequestProducer, .AsyncResponseConsumer, .HandlerFactory, org.apache.hc.core5.http.nio.support.BasicClientExchangeHandler, org.apache.hc.core5.http.protocol.HttpContext, .HttpCoreContext, org.apache.hc.core5.io.CloseMode, .ModalCloseable, org.apache.hc.core5.util.Timeout

Client connection endpoint that can be used to execute message exchanges.
Since
5.0

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public final void
close()

Implements java.io.Closeable.close.

Closes this stream and releases any system resources associated with it.
public abstract void
execute(String
unique operation ID or null.
id
,
AsyncClientExchangeHandler
the message exchange handler.
exchangeHandler
,
HandlerFactory<AsyncPushConsumer>
the push handler factory.
pushHandlerFactory
,
HttpContext
the execution context.
context
)

Initiates a message exchange using the given handler.

public void
execute(final String
unique operation ID or null.
id
,
final AsyncClientExchangeHandler
the message exchange handler.
exchangeHandler
,
final HttpContext
the execution context.
context
)

Initiates a message exchange using the given handler.

public final <
the result representation.
T
>
Future<T>

Returns:

the result future.
execute
(final String
unique operation ID or null.
id
,
final AsyncRequestProducer
the request producer.
requestProducer
,
final AsyncResponseConsumer<T>
the response consumer.
responseConsumer
,
final HandlerFactory<AsyncPushConsumer>
the push handler factory.
pushHandlerFactory
,
final HttpContext
the execution context.
context
,
final FutureCallback<T>
the result callback.
callback
)

Initiates message exchange using the given request producer and response consumer.

public final <
the result representation.
T
>
Future<T>

Returns:

the result future.
execute
(final String
unique operation ID or null.
id
,
final AsyncRequestProducer
the request producer.
requestProducer
,
final AsyncResponseConsumer<T>
the response consumer.
responseConsumer
,
final HttpContext
the execution context.
context
,
final FutureCallback<T>
the result callback.
callback
)

Initiates message exchange using the given request producer and response consumer.

public final <
the result representation.
T
>
Future<T>

Returns:

the result future.
execute
(final String
unique operation ID or null.
id
,
final AsyncRequestProducer
the request producer.
requestProducer
,
final AsyncResponseConsumer<T>
the response consumer.
responseConsumer
,
final HandlerFactory<AsyncPushConsumer>
the push handler factory.
pushHandlerFactory
,
final FutureCallback<T>
the result callback.
callback
)

Initiates message exchange using the given request producer and response consumer.

public final <
the result representation.
T
>
Future<T>

Returns:

the result future.
execute
(final String
unique operation ID or null.
id
,
final AsyncRequestProducer
the request producer.
requestProducer
,
final AsyncResponseConsumer<T>
the response consumer.
responseConsumer
,
final FutureCallback<T>
the result callback.
callback
)

Initiates message exchange using the given request producer and response consumer.

public abstract boolean
isConnected()

Determines if the connection to the remote endpoint is still open and valid.

public abstract void
setSocketTimeout(Timeout
the socket timeout.
timeout
)

Sets socket timeout.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

AsyncConnectionEndpointback to summary
public AsyncConnectionEndpoint()

Method Detail

closeback to summary
public final void close() throws IOException

Implements java.io.Closeable.close.

Doc from java.io.Closeable.close.

Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.

As noted in AutoCloseable#close(), cases where the close may fail require careful attention. It is strongly advised to relinquish the underlying resources and to internally mark the Closeable as closed, prior to throwing the IOException.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs
executeback to summary
public abstract void execute(String id, AsyncClientExchangeHandler exchangeHandler, HandlerFactory<AsyncPushConsumer> pushHandlerFactory, HttpContext context)

Initiates a message exchange using the given handler.

Parameters
id:String

unique operation ID or null.

exchangeHandler:AsyncClientExchangeHandler

the message exchange handler.

pushHandlerFactory:HandlerFactory<AsyncPushConsumer>

the push handler factory.

context:HttpContext

the execution context.

executeback to summary
public void execute(final String id, final AsyncClientExchangeHandler exchangeHandler, final HttpContext context)

Initiates a message exchange using the given handler.

Parameters
id:String

unique operation ID or null.

exchangeHandler:AsyncClientExchangeHandler

the message exchange handler.

context:HttpContext

the execution context.

executeback to summary
public final <T> Future<T> execute(final String id, final AsyncRequestProducer requestProducer, final AsyncResponseConsumer<T> responseConsumer, final HandlerFactory<AsyncPushConsumer> pushHandlerFactory, final HttpContext context, final FutureCallback<T> callback)

Initiates message exchange using the given request producer and response consumer.

Parameters
<T>
the result representation.
id:String

unique operation ID or null.

requestProducer:AsyncRequestProducer

the request producer.

responseConsumer:AsyncResponseConsumer<T>

the response consumer.

pushHandlerFactory:HandlerFactory<AsyncPushConsumer>

the push handler factory.

context:HttpContext

the execution context.

callback:FutureCallback<T>

the result callback.

Returns:Future<T>

the result future.

executeback to summary
public final <T> Future<T> execute(final String id, final AsyncRequestProducer requestProducer, final AsyncResponseConsumer<T> responseConsumer, final HttpContext context, final FutureCallback<T> callback)

Initiates message exchange using the given request producer and response consumer.

Parameters
<T>
the result representation.
id:String

unique operation ID or null.

requestProducer:AsyncRequestProducer

the request producer.

responseConsumer:AsyncResponseConsumer<T>

the response consumer.

context:HttpContext

the execution context.

callback:FutureCallback<T>

the result callback.

Returns:Future<T>

the result future.

executeback to summary
public final <T> Future<T> execute(final String id, final AsyncRequestProducer requestProducer, final AsyncResponseConsumer<T> responseConsumer, final HandlerFactory<AsyncPushConsumer> pushHandlerFactory, final FutureCallback<T> callback)

Initiates message exchange using the given request producer and response consumer.

Parameters
<T>
the result representation.
id:String

unique operation ID or null.

requestProducer:AsyncRequestProducer

the request producer.

responseConsumer:AsyncResponseConsumer<T>

the response consumer.

pushHandlerFactory:HandlerFactory<AsyncPushConsumer>

the push handler factory.

callback:FutureCallback<T>

the result callback.

Returns:Future<T>

the result future.

executeback to summary
public final <T> Future<T> execute(final String id, final AsyncRequestProducer requestProducer, final AsyncResponseConsumer<T> responseConsumer, final FutureCallback<T> callback)

Initiates message exchange using the given request producer and response consumer.

Parameters
<T>
the result representation.
id:String

unique operation ID or null.

requestProducer:AsyncRequestProducer

the request producer.

responseConsumer:AsyncResponseConsumer<T>

the response consumer.

callback:FutureCallback<T>

the result callback.

Returns:Future<T>

the result future.

isConnectedback to summary
public abstract boolean isConnected()

Determines if the connection to the remote endpoint is still open and valid.

setSocketTimeoutback to summary
public abstract void setSocketTimeout(Timeout timeout)

Sets socket timeout.

Parameters
timeout:Timeout

the socket timeout.