Package org.apache.hc.client5.http.io
Class ConnectionEndpoint
- java.lang.Object
-
- org.apache.hc.client5.http.io.ConnectionEndpoint
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,org.apache.hc.core5.io.ModalCloseable
- Direct Known Subclasses:
BasicHttpClientConnectionManager.InternalConnectionEndpoint,PoolingHttpClientConnectionManager.InternalConnectionEndpoint
@Contract(threading=SAFE) public abstract class ConnectionEndpoint extends java.lang.Object implements org.apache.hc.core5.io.ModalCloseableClient 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
-
-
Constructor Summary
Constructors Constructor Description ConnectionEndpoint()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract org.apache.hc.core5.http.ClassicHttpResponseexecute(java.lang.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)Executes HTTP request using the provided request executor.abstract booleanisConnected()Determines 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.
-
-
-
Method Detail
-
execute
public abstract org.apache.hc.core5.http.ClassicHttpResponse execute(java.lang.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 java.io.IOException, org.apache.hc.core5.http.HttpExceptionExecutes 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.executor- the request executor.context- the execution context.- Throws:
java.io.IOExceptionorg.apache.hc.core5.http.HttpException
-
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
-
-