Class BasicHttpClientConnectionManager.InternalConnectionEndpoint
- java.lang.Object
-
- org.apache.hc.client5.http.io.ConnectionEndpoint
-
- org.apache.hc.client5.http.impl.io.BasicHttpClientConnectionManager.InternalConnectionEndpoint
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,ConnectionHolder,org.apache.hc.core5.io.ModalCloseable,org.apache.hc.core5.util.Identifiable
- Enclosing class:
- BasicHttpClientConnectionManager
class BasicHttpClientConnectionManager.InternalConnectionEndpoint extends ConnectionEndpoint implements ConnectionHolder, org.apache.hc.core5.util.Identifiable
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.hc.client5.http.io.ConnectionEndpoint
ConnectionEndpoint.RequestExecutor
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.atomic.AtomicReference<ManagedHttpClientConnection>connRefprivate HttpRouteroute
-
Constructor Summary
Constructors Constructor Description InternalConnectionEndpoint(HttpRoute route, ManagedHttpClientConnection conn)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidclose()voidclose(org.apache.hc.core5.io.CloseMode closeMode)(package private) ManagedHttpClientConnectiondetach()org.apache.hc.core5.http.ClassicHttpResponseexecute(java.lang.String exchangeId, org.apache.hc.core5.http.ClassicHttpRequest request, ConnectionEndpoint.RequestExecutor requestExecutor, org.apache.hc.core5.http.protocol.HttpContext context)Executes HTTP request using the provided request executor.org.apache.hc.core5.http.ClassicHttpResponseexecute(java.lang.String exchangeId, org.apache.hc.core5.http.ClassicHttpRequest request, org.apache.hc.core5.http.impl.io.HttpRequestExecutor requestExecutor, org.apache.hc.core5.http.protocol.HttpContext context)org.apache.hc.core5.http.HttpConnectionget()(package private) ManagedHttpClientConnectiongetConnection()java.lang.StringgetId()EndpointInfogetInfo()Returns information about the endpoint ornullwhen not connected.(package private) HttpRoutegetRoute()(package private) ManagedHttpClientConnectiongetValidatedConnection()booleanisConnected()Determines if the connection to the remote endpoint is still open and valid.voidsetSocketTimeout(org.apache.hc.core5.util.Timeout timeout)Sets the socket timeout value.
-
-
-
Field Detail
-
route
private final HttpRoute route
-
connRef
private final java.util.concurrent.atomic.AtomicReference<ManagedHttpClientConnection> connRef
-
-
Constructor Detail
-
InternalConnectionEndpoint
public InternalConnectionEndpoint(HttpRoute route, ManagedHttpClientConnection conn)
-
-
Method Detail
-
getId
public java.lang.String getId()
- Specified by:
getIdin interfaceorg.apache.hc.core5.util.Identifiable
-
getRoute
HttpRoute getRoute()
-
getConnection
ManagedHttpClientConnection getConnection()
-
getValidatedConnection
ManagedHttpClientConnection getValidatedConnection()
-
detach
ManagedHttpClientConnection detach()
-
isConnected
public boolean isConnected()
Description copied from class:ConnectionEndpointDetermines if the connection to the remote endpoint is still open and valid.- Specified by:
isConnectedin classConnectionEndpoint
-
close
public void close(org.apache.hc.core5.io.CloseMode closeMode)
- Specified by:
closein interfaceorg.apache.hc.core5.io.ModalCloseable
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
setSocketTimeout
public void setSocketTimeout(org.apache.hc.core5.util.Timeout timeout)
Description copied from class:ConnectionEndpointSets the socket timeout value.- Specified by:
setSocketTimeoutin classConnectionEndpoint- Parameters:
timeout- timeout value
-
execute
@Deprecated public org.apache.hc.core5.http.ClassicHttpResponse execute(java.lang.String exchangeId, org.apache.hc.core5.http.ClassicHttpRequest request, org.apache.hc.core5.http.impl.io.HttpRequestExecutor requestExecutor, org.apache.hc.core5.http.protocol.HttpContext context) throws java.io.IOException, org.apache.hc.core5.http.HttpException- Specified by:
executein classConnectionEndpoint- Throws:
java.io.IOExceptionorg.apache.hc.core5.http.HttpException
-
execute
public org.apache.hc.core5.http.ClassicHttpResponse execute(java.lang.String exchangeId, org.apache.hc.core5.http.ClassicHttpRequest request, ConnectionEndpoint.RequestExecutor requestExecutor, org.apache.hc.core5.http.protocol.HttpContext context) throws java.io.IOException, org.apache.hc.core5.http.HttpExceptionDescription copied from class:ConnectionEndpointExecutes HTTP request using the provided request executor.Once the endpoint is no longer needed it MUST be released with
ModalCloseable.close(org.apache.hc.core5.io.CloseMode).- Overrides:
executein classConnectionEndpoint- Parameters:
exchangeId- unique operation ID ornull.request- the request message.requestExecutor- the request executor.context- the execution context.- Throws:
java.io.IOExceptionorg.apache.hc.core5.http.HttpException- Since:
- 5.4
-
getInfo
public EndpointInfo getInfo()
Description copied from class:ConnectionEndpointReturns information about the endpoint ornullwhen not connected.- Overrides:
getInfoin classConnectionEndpoint- Since:
- 5.4
-
get
public org.apache.hc.core5.http.HttpConnection get()
- Specified by:
getin interfaceConnectionHolder
-
-