Top Fields Constructors Methods
org.apache.hc.core5.http2.impl.nio

pack-priv abstract Class PrefaceHandlerBase

extends Object
implements HttpConnectionEventHandler
Class Inheritance
All Implemented Interfaces
org.apache.hc.core5.http.impl.nio.HttpConnectionEventHandler, org.apache.hc.core5.http.HttpConnection, org.apache.hc.core5.http.SocketModalCloseable, org.apache.hc.core5.io.ModalCloseable, java.io.Closeable, java.lang.AutoCloseable, org.apache.hc.core5.reactor.IOEventHandler
Known Direct Subclasses
org.apache.hc.core5.http2.impl.nio.ServerH2PrefaceHandler, org.apache.hc.core5.http2.impl.nio.ClientH2PrefaceHandler
Imports
java.io.IOException, java.net.SocketAddress, java.nio.ByteBuffer, java.util.concurrent.atomic.AtomicBoolean, .AtomicReference, javax.net.ssl.SSLSession, org.apache.hc.core5.concurrent.FutureCallback, org.apache.hc.core5.http.ConnectionClosedException, .EndpointDetails, .HttpVersion, .ProtocolVersion, org.apache.hc.core5.http.impl.nio.HttpConnectionEventHandler, org.apache.hc.core5.http.nio.command.CommandSupport, org.apache.hc.core5.io.CloseMode, .SocketTimeoutExceptionFactory, org.apache.hc.core5.reactor.IOSession, .ProtocolIOSession, org.apache.hc.core5.reactor.ssl.TlsDetails, org.apache.hc.core5.util.Args, .Timeout

Field Summary

Modifier and TypeField and Description
private final AtomicBoolean
pack-priv final ProtocolIOSession
private final AtomicReference<HttpConnectionEventHandler>
private final FutureCallback<ProtocolIOSession>

Constructor Summary

AccessConstructor and Description
pack-priv
PrefaceHandlerBase(final ProtocolIOSession ioSession, final FutureCallback<ProtocolIOSession> resultCallback)

Method Summary

Modifier and TypeMethod and Description
public void
close()

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

Closes this connection gracefully.
public void
close(final CloseMode
How to close the receiver.
closeMode
)

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

Closes this process or endpoint and releases any system resources associated with it.
public void
disconnected(final IOSession
the I/O session.
session
)

Implements org.apache.hc.core5.reactor.IOEventHandler.disconnected.

Triggered when the given session has been terminated.
public void
exception(final IOSession
the I/O session.
session
,
final Exception cause)

Implements org.apache.hc.core5.reactor.IOEventHandler.exception.

Triggered when the given session throws a exception.
public EndpointDetails
getEndpointDetails()

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

Returns this connection's endpoint details.
public SocketAddress
getLocalAddress()

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

Returns this connection's local address or null if it is not bound yet.
public ProtocolVersion
getProtocolVersion()

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

Returns this connection's protocol version or null if unknown.
public SocketAddress
getRemoteAddress()

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

Returns this connection's remote address or null if it is not connected yet or unconnected.
public Timeout
public SSLSession
getSSLSession()

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

Returns this connection's SSL session or null if TLS has not been activated.
public boolean
isOpen()

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

Checks if this connection is open.
public void
setSocketTimeout(final Timeout
timeout value
timeout
)

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

Sets the socket timeout value.
pack-priv void
startProtocol(final HttpConnectionEventHandler protocolHandler, final ByteBuffer data)

public void
timeout(final IOSession
the I/O session.
session
,
final Timeout
the timeout.
timeout
)

Implements org.apache.hc.core5.reactor.IOEventHandler.timeout.

Triggered when the given session has timed out.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

completedback to summary
private final AtomicBoolean completed
ioSessionback to summary
pack-priv final ProtocolIOSession ioSession
protocolHandlerRefback to summary
private final AtomicReference<HttpConnectionEventHandler> protocolHandlerRef
resultCallbackback to summary
private final FutureCallback<ProtocolIOSession> resultCallback

Constructor Detail

PrefaceHandlerBaseback to summary
pack-priv PrefaceHandlerBase(final ProtocolIOSession ioSession, final FutureCallback<ProtocolIOSession> resultCallback)

Method Detail

closeback to summary
public void close() throws IOException

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)

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
disconnectedback to summary
public void disconnected(final IOSession session)

Implements org.apache.hc.core5.reactor.IOEventHandler.disconnected.

Doc from org.apache.hc.core5.reactor.IOEventHandler.disconnected.

Triggered when the given session has been terminated.

Parameters
session:IOSession

the I/O session.

Annotations
@Override
exceptionback to summary
public void exception(final IOSession session, final Exception cause)

Implements org.apache.hc.core5.reactor.IOEventHandler.exception.

Doc from org.apache.hc.core5.reactor.IOEventHandler.exception.

Triggered when the given session throws a exception.

Parameters
session:IOSession

the I/O session.

Annotations
@Override
getEndpointDetailsback to summary
public EndpointDetails getEndpointDetails()

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

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

Returns this connection's endpoint details.

Returns:EndpointDetails

this connection's endpoint details.

Annotations
@Override
getLocalAddressback to summary
public SocketAddress getLocalAddress()

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

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

Returns this connection's local address or null if it is not bound yet.

Returns:SocketAddress

this connection's local address or null if it is not bound yet.

Annotations
@Override
getProtocolVersionback to summary
public ProtocolVersion getProtocolVersion()

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

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

Returns this connection's protocol version or null if unknown.

Returns:ProtocolVersion

this connection's protocol version or null if unknown.

Annotations
@Override
getRemoteAddressback to summary
public SocketAddress getRemoteAddress()

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

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

Returns this connection's remote address or null if it is not connected yet or unconnected.

Returns:SocketAddress

this connection's remote address or null if it is not connected yet or unconnected.

Annotations
@Override
getSocketTimeoutback to summary
public Timeout getSocketTimeout()

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

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

Returns the socket timeout value.

Returns:Timeout

timeout value.

Annotations
@Override
getSSLSessionback to summary
public SSLSession getSSLSession()

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

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

Returns this connection's SSL session or null if TLS has not been activated.

Returns:SSLSession

this connection's SSL session or null if TLS has not been activated.

Annotations
@Override
isOpenback to summary
public boolean isOpen()

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

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

Checks if this connection is open.

Returns:boolean

true if it is open, false if it is closed.

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

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
startProtocolback to summary
pack-priv void startProtocol(final HttpConnectionEventHandler protocolHandler, final ByteBuffer data) throws IOException
timeoutback to summary
public void timeout(final IOSession session, final Timeout timeout)

Implements org.apache.hc.core5.reactor.IOEventHandler.timeout.

Doc from org.apache.hc.core5.reactor.IOEventHandler.timeout.

Triggered when the given session has timed out.

Parameters
session:IOSession

the I/O session.

timeout:Timeout

the timeout.

Annotations
@Override