Top Fields Constructors Methods
org.apache.hc.client5.http.impl.io

pack-priv final Class DefaultManagedHttpClientConnection

extends DefaultBHttpClientConnection
implements ManagedHttpClientConnection, Identifiable
Class Inheritance
All Implemented Interfaces
org.apache.hc.core5.util.Identifiable, org.apache.hc.client5.http.io.ManagedHttpClientConnection, org.apache.hc.core5.http.io.HttpClientConnection, org.apache.hc.core5.http.io.BHttpConnection, org.apache.hc.core5.http.HttpConnection, org.apache.hc.core5.http.SocketModalCloseable, org.apache.hc.core5.io.ModalCloseable, java.io.Closeable, java.lang.AutoCloseable
Imports
java.io.IOException, .InterruptedIOException, java.net.Socket, java.nio.charset.CharsetDecoder, .CharsetEncoder, java.util.concurrent.atomic.AtomicBoolean, javax.net.ssl.SSLSession, .SSLSocket, org.apache.hc.client5.http.io.ManagedHttpClientConnection, org.apache.hc.core5.http.ClassicHttpRequest, .ClassicHttpResponse, .ContentLengthStrategy, .Header, org.apache.hc.core5.http.config.Http1Config, org.apache.hc.core5.http.impl.io.DefaultBHttpClientConnection, .SocketHolder, org.apache.hc.core5.http.io.HttpMessageParserFactory, .HttpMessageWriterFactory, .ResponseOutOfOrderStrategy, org.apache.hc.core5.http.message.RequestLine, .StatusLine, org.apache.hc.core5.io.CloseMode, org.apache.hc.core5.util.Identifiable, .Timeout, org.slf4j.Logger, .LoggerFactory

Field Summary

Modifier and TypeField and Description
private final AtomicBoolean
private static final Logger
private final String
private static final Logger
private Timeout
private static final Logger

Constructor Summary

AccessConstructor and Description
public
DefaultManagedHttpClientConnection(final String id, final CharsetDecoder charDecoder, final CharsetEncoder charEncoder, final Http1Config h1Config, final ContentLengthStrategy incomingContentStrategy, final ContentLengthStrategy outgoingContentStrategy, final ResponseOutOfOrderStrategy responseOutOfOrderStrategy, final HttpMessageWriterFactory<ClassicHttpRequest> requestWriterFactory, final HttpMessageParserFactory<ClassicHttpResponse> responseParserFactory)

public
DefaultManagedHttpClientConnection(final String id, final CharsetDecoder charDecoder, final CharsetEncoder charEncoder, final Http1Config h1Config, final ContentLengthStrategy incomingContentStrategy, final ContentLengthStrategy outgoingContentStrategy, final HttpMessageWriterFactory<ClassicHttpRequest> requestWriterFactory, final HttpMessageParserFactory<ClassicHttpResponse> responseParserFactory)

public

Method Summary

Modifier and TypeMethod and Description
public void
activate()

Implements org.apache.hc.client5.http.io.ManagedHttpClientConnection.activate.

Restores the connection from idle mode.
public void
public void
bind(final Socket
the socket to bind the connection to.
socket
)

Overrides org.apache.hc.core5.http.impl.io.DefaultBHttpClientConnection.bind.

Implements org.apache.hc.client5.http.io.ManagedHttpClientConnection.bind.

Binds this connection to the given socket.
public void
public void
close(final CloseMode
How to close the receiver.
closeMode
)

Overrides org.apache.hc.core5.http.impl.io.BHttpConnectionBase.close.

Implements org.apache.hc.core5.io.ModalCloseable.close.

Closes this process or endpoint and releases any system resources associated with it.
public String
public Socket
public SSLSession
protected void
protected void
public void
passivate()

Implements org.apache.hc.client5.http.io.ManagedHttpClientConnection.passivate.

Puts the connection into idle mode.
public void
Inherited from org.apache.hc.core5.http.impl.io.DefaultBHttpClientConnection:
isConsistentreceiveResponseEntityreceiveResponseHeadersendRequestEntitysendRequestHeaderterminateRequest

Field Detail

closedback to summary
private final AtomicBoolean closed
HEADER_LOGback to summary
private static final Logger HEADER_LOG
idback to summary
private final String id
LOGback to summary
private static final Logger LOG
socketTimeoutback to summary
private Timeout socketTimeout
WIRE_LOGback to summary
private static final Logger WIRE_LOG

Constructor Detail

DefaultManagedHttpClientConnectionback to summary
public DefaultManagedHttpClientConnection(final String id, final CharsetDecoder charDecoder, final CharsetEncoder charEncoder, final Http1Config h1Config, final ContentLengthStrategy incomingContentStrategy, final ContentLengthStrategy outgoingContentStrategy, final ResponseOutOfOrderStrategy responseOutOfOrderStrategy, final HttpMessageWriterFactory<ClassicHttpRequest> requestWriterFactory, final HttpMessageParserFactory<ClassicHttpResponse> responseParserFactory)
DefaultManagedHttpClientConnectionback to summary
public DefaultManagedHttpClientConnection(final String id, final CharsetDecoder charDecoder, final CharsetEncoder charEncoder, final Http1Config h1Config, final ContentLengthStrategy incomingContentStrategy, final ContentLengthStrategy outgoingContentStrategy, final HttpMessageWriterFactory<ClassicHttpRequest> requestWriterFactory, final HttpMessageParserFactory<ClassicHttpResponse> responseParserFactory)
DefaultManagedHttpClientConnectionback to summary
public DefaultManagedHttpClientConnection(final String id)

Method Detail

activateback to summary
public void activate()

Implements org.apache.hc.client5.http.io.ManagedHttpClientConnection.activate.

Doc from org.apache.hc.client5.http.io.ManagedHttpClientConnection.activate.

Restores the connection from idle mode.

Annotations
@Override
bindback to summary
public void bind(final SocketHolder socketHolder) throws IOException

Overrides org.apache.hc.core5.http.impl.io.BHttpConnectionBase.bind.

Annotations
@Override
bindback to summary
public void bind(final Socket socket) throws IOException

Overrides org.apache.hc.core5.http.impl.io.DefaultBHttpClientConnection.bind.

Implements org.apache.hc.client5.http.io.ManagedHttpClientConnection.bind.

Doc from org.apache.hc.client5.http.io.ManagedHttpClientConnection.bind.

Binds this connection to the given socket. The connection is considered open if it is bound and the underlying socket is connection to a remote host.

Parameters
socket:Socket

the socket to bind the connection to.

Annotations
@Override
Exceptions
IOException:

Doc from org.apache.hc.core5.http.impl.io.BHttpConnectionBase.bind.

in case of an I/O error.

closeback to summary
public void close() throws IOException

Overrides org.apache.hc.core5.http.impl.io.BHttpConnectionBase.close.

Implements org.apache.hc.core5.http.HttpConnection.close.

Doc from org.apache.hc.core5.http.HttpConnection.close.

Closes this connection gracefully. This method will attempt to flush the internal output buffer prior to closing the underlying socket. This method MUST NOT be called from a different thread to force shutdown of the connection. Use shutdown instead.

Annotations
@Override
Exceptions
IOException:

Doc from java.io.Closeable.close.

if an I/O error occurs

closeback to summary
public void close(final CloseMode closeMode)

Overrides org.apache.hc.core5.http.impl.io.BHttpConnectionBase.close.

Implements org.apache.hc.core5.io.ModalCloseable.close.

Doc from org.apache.hc.core5.io.ModalCloseable.close.

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

Parameters
closeMode:CloseMode

How to close the receiver.

Annotations
@Override
getIdback to summary
public String getId()

Implements org.apache.hc.core5.util.Identifiable.getId.

Annotations
@Override
getSocketback to summary
public Socket getSocket()

Implements org.apache.hc.client5.http.io.ManagedHttpClientConnection.getSocket.

Doc from org.apache.hc.client5.http.io.ManagedHttpClientConnection.getSocket.

Returns the underlying socket.

Annotations
@Override
getSSLSessionback to summary
public SSLSession getSSLSession()

Overrides org.apache.hc.core5.http.impl.io.BHttpConnectionBase.getSSLSession.

Implements org.apache.hc.client5.http.io.ManagedHttpClientConnection.getSSLSession, org.apache.hc.core5.http.HttpConnection.getSSLSession.

Doc from org.apache.hc.client5.http.io.ManagedHttpClientConnection.getSSLSession.

Obtains the SSL session of the underlying connection, if any. If this connection is open, and the underlying socket is an SSLSocket, the SSL session of that socket is obtained. This is a potentially blocking operation.

Returns:SSLSession

the underlying SSL session if available, null otherwise

Annotations
@Override
onRequestSubmittedback to summary
protected void onRequestSubmitted(final ClassicHttpRequest request)

Overrides org.apache.hc.core5.http.impl.io.DefaultBHttpClientConnection.onRequestSubmitted.

Annotations
@Override
onResponseReceivedback to summary
protected void onResponseReceived(final ClassicHttpResponse response)

Overrides org.apache.hc.core5.http.impl.io.DefaultBHttpClientConnection.onResponseReceived.

Annotations
@Override
passivateback to summary
public void passivate()

Implements org.apache.hc.client5.http.io.ManagedHttpClientConnection.passivate.

Doc from org.apache.hc.client5.http.io.ManagedHttpClientConnection.passivate.

Puts the connection into idle mode.

Annotations
@Override
setSocketTimeoutback to summary
public void setSocketTimeout(final Timeout timeout)

Overrides org.apache.hc.core5.http.impl.io.BHttpConnectionBase.setSocketTimeout.

Implements org.apache.hc.core5.http.SocketModalCloseable.setSocketTimeout.

Doc from org.apache.hc.core5.http.SocketModalCloseable.setSocketTimeout.

Sets the socket timeout value.

Parameters
timeout:Timeout

timeout value

Annotations
@Override