Class ConnectionEndpoint
java.lang.Object
org.apache.hc.client5.http.io.ConnectionEndpoint
- All Implemented Interfaces:
Closeable, AutoCloseable, org.apache.hc.core5.io.ModalCloseable
- Direct Known Subclasses:
BasicHttpClientConnectionManager.InternalConnectionEndpoint, PoolingHttpClientConnectionManager.InternalConnectionEndpoint
@Contract(threading=SAFE)
public abstract class ConnectionEndpoint
extends Object
implements org.apache.hc.core5.io.ModalCloseable
Client endpoint leased from a connection manager. Client points can be used
to execute HTTP requests.
Once the endpoint is no longer needed it MUST be released with ModalCloseable.close(org.apache.hc.core5.io.CloseMode) )}.
- Since:
- 5.0
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.hc.core5.http.ClassicHttpResponseexecute(String id, 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.abstract org.apache.hc.core5.http.ClassicHttpResponseexecute(String id, org.apache.hc.core5.http.ClassicHttpRequest request, org.apache.hc.core5.http.impl.io.HttpRequestExecutor executor, org.apache.hc.core5.http.protocol.HttpContext context) Deprecated.getInfo()Returns information about the endpoint ornullwhen not connected.abstract booleanDetermines if the connection to the remote endpoint is still open and valid.abstract voidsetSocketTimeout(org.apache.hc.core5.util.Timeout timeout) Sets the socket timeout value.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hc.core5.io.ModalCloseable
close
-
Constructor Details
-
ConnectionEndpoint
public ConnectionEndpoint()
-
-
Method Details
-
execute
@Deprecated public abstract org.apache.hc.core5.http.ClassicHttpResponse execute(String id, org.apache.hc.core5.http.ClassicHttpRequest request, org.apache.hc.core5.http.impl.io.HttpRequestExecutor executor, org.apache.hc.core5.http.protocol.HttpContext context) throws IOException, org.apache.hc.core5.http.HttpException - Throws:
IOExceptionorg.apache.hc.core5.http.HttpException
-
execute
public org.apache.hc.core5.http.ClassicHttpResponse execute(String id, org.apache.hc.core5.http.ClassicHttpRequest request, ConnectionEndpoint.RequestExecutor requestExecutor, org.apache.hc.core5.http.protocol.HttpContext context) throws IOException, org.apache.hc.core5.http.HttpException Executes 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).- Parameters:
id- unique operation ID ornull.request- the request message.requestExecutor- the request executor.context- the execution context.- Throws:
IOExceptionorg.apache.hc.core5.http.HttpException- Since:
- 5.4
-
isConnected
public abstract boolean isConnected()Determines if the connection to the remote endpoint is still open and valid. -
setSocketTimeout
public abstract void setSocketTimeout(org.apache.hc.core5.util.Timeout timeout) Sets the socket timeout value.- Parameters:
timeout- timeout value
-
getInfo
Returns information about the endpoint ornullwhen not connected.- Since:
- 5.4
-
execute(String, ClassicHttpRequest, RequestExecutor, HttpContext)