private static class ProxyConnectionFactory.ProxyV1ConnectionFactory.ProxyProtocolV1Connection extends AbstractConnection implements Connection.UpgradeFrom, Connection.UpgradeTo
Connection.Listener, Connection.UpgradeFrom, Connection.UpgradeTo
Modifier and Type | Field and Description |
---|---|
private java.nio.ByteBuffer |
_buffer |
private java.lang.StringBuilder |
_builder |
private Connector |
_connector |
private java.lang.String[] |
_fields |
private int |
_index |
private int |
_length |
private ConnectionFactory |
_next |
private static int |
CR_INDEX |
private static int |
LF_INDEX |
Modifier | Constructor and Description |
---|---|
private |
ProxyProtocolV1Connection(EndPoint endp,
Connector connector,
ConnectionFactory next) |
Modifier and Type | Method and Description |
---|---|
void |
onFillable()
Callback method invoked when the endpoint is ready to be read.
|
void |
onOpen()
Callback method invoked when this connection is opened.
|
java.nio.ByteBuffer |
onUpgradeFrom()
Takes the input buffer from the connection on upgrade.
|
void |
onUpgradeTo(java.nio.ByteBuffer prefilled)
Callback method invoked when this connection is upgraded.
|
private boolean |
parse() |
private void |
releaseAndClose() |
private void |
upgrade() |
addListener, close, failedCallback, fillInterested, getBytesIn, getBytesOut, getCreatedTimeStamp, getEndPoint, getExecutor, getInputBufferSize, getMessagesIn, getMessagesOut, isFillInterested, onClose, onFillInterestedFailed, onIdleExpired, onReadTimeout, removeListener, setInputBufferSize, toConnectionString, toString, tryFillInterested, tryFillInterested
private static final int CR_INDEX
private static final int LF_INDEX
private final Connector _connector
private final ConnectionFactory _next
private final java.nio.ByteBuffer _buffer
private final java.lang.StringBuilder _builder
private final java.lang.String[] _fields
private int _index
private int _length
private ProxyProtocolV1Connection(EndPoint endp, Connector connector, ConnectionFactory next)
public void onFillable()
AbstractConnection
Callback method invoked when the endpoint is ready to be read.
onFillable
in class AbstractConnection
AbstractConnection.fillInterested()
public void onOpen()
Connection
Callback method invoked when this connection is opened.
Creators of the connection implementation are responsible for calling this method.
onOpen
in interface Connection
onOpen
in class AbstractConnection
public java.nio.ByteBuffer onUpgradeFrom()
Connection.UpgradeFrom
Takes the input buffer from the connection on upgrade.
This method is used to take any unconsumed input from a connection during an upgrade.
onUpgradeFrom
in interface Connection.UpgradeFrom
public void onUpgradeTo(java.nio.ByteBuffer prefilled)
Connection.UpgradeTo
Callback method invoked when this connection is upgraded.
This must be called before Connection.onOpen()
.
onUpgradeTo
in interface Connection.UpgradeTo
prefilled
- An optional buffer that can contain prefilled data. Typically this
results from an upgrade of one protocol to the other where the old connection has buffered
data destined for the new connection. The new connection must take ownership of the buffer
and is responsible for returning it to the buffer poolprivate boolean parse() throws java.io.IOException
java.io.IOException
private void releaseAndClose()
private void upgrade()