Package org.apache.http.nio
Interface NHttpClientConnection
- All Superinterfaces:
AutoCloseable
,Closeable
,HttpConnection
,IOControl
,NHttpConnection
- All Known Subinterfaces:
NHttpClientIOTarget
- All Known Implementing Classes:
DefaultNHttpClientConnection
Abstract non-blocking client-side HTTP connection interface. It can be used
to submit HTTP requests and asynchronously receive HTTP responses.
- Since:
- 4.0
- See Also:
-
Field Summary
Fields inherited from interface org.apache.http.nio.NHttpConnection
ACTIVE, CLOSED, CLOSING
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returnstrue
if an HTTP request has been submitted to the target server.void
Resets input state.void
Resets output state.void
submitRequest
(HttpRequest request) SubmitsHttpRequest
to be sent to the target server.Methods inherited from interface org.apache.http.HttpConnection
close, getMetrics, getSocketTimeout, isOpen, isStale, setSocketTimeout, shutdown
Methods inherited from interface org.apache.http.nio.IOControl
requestInput, requestOutput, shutdown, suspendInput, suspendOutput
Methods inherited from interface org.apache.http.nio.NHttpConnection
getContext, getHttpRequest, getHttpResponse, getStatus
-
Method Details
-
submitRequest
SubmitsHttpRequest
to be sent to the target server.- Parameters:
request
- HTTP request- Throws:
IOException
- if I/O error occurs while submitting the requestHttpException
- if the HTTP request violates the HTTP protocol.
-
isRequestSubmitted
boolean isRequestSubmitted()Returnstrue
if an HTTP request has been submitted to the target server.- Returns:
true
if an HTTP request has been submitted,false
otherwise.
-
resetOutput
void resetOutput()Resets output state. This method can be used to prematurely terminate processing of the outgoing HTTP request. -
resetInput
void resetInput()Resets input state. This method can be used to prematurely terminate processing of the incoming HTTP response.
-