Package org.eclipse.jetty.server
Class ProxyConnectionFactory.ProxyV1ConnectionFactory.ProxyProtocolV1Connection
- java.lang.Object
-
- org.eclipse.jetty.io.AbstractConnection
-
- org.eclipse.jetty.server.ProxyConnectionFactory.ProxyV1ConnectionFactory.ProxyProtocolV1Connection
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,Connection,Connection.UpgradeFrom,Connection.UpgradeTo
- Enclosing class:
- ProxyConnectionFactory.ProxyV1ConnectionFactory
private static class ProxyConnectionFactory.ProxyV1ConnectionFactory.ProxyProtocolV1Connection extends AbstractConnection implements Connection.UpgradeFrom, Connection.UpgradeTo
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.io.Connection
Connection.Listener, Connection.UpgradeFrom, Connection.UpgradeTo
-
-
Field Summary
Fields Modifier and Type Field Description private java.nio.ByteBuffer_bufferprivate java.lang.StringBuilder_builderprivate Connector_connectorprivate java.lang.String[]_fieldsprivate int_indexprivate int_lengthprivate ConnectionFactory_nextprivate static intCR_INDEXprivate static intLF_INDEX
-
Constructor Summary
Constructors Modifier Constructor Description privateProxyProtocolV1Connection(EndPoint endp, Connector connector, ConnectionFactory next)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidonFillable()Callback method invoked when the endpoint is ready to be read.voidonOpen()Callback method invoked when this connection is opened.java.nio.ByteBufferonUpgradeFrom()Invoked during anupgradeto produce a buffer containing bytes that have not been consumed by this connection, and that must be consumed by the upgrade-to connection.voidonUpgradeTo(java.nio.ByteBuffer buffer)Invoked during anupgradeto receive a buffer containing bytes that have not been consumed by the upgrade-from connection, and that must be consumed by this connection.private booleanparse()private voidreleaseAndClose()private voidupgrade()-
Methods inherited from class org.eclipse.jetty.io.AbstractConnection
addListener, close, failedCallback, fillInterested, getBytesIn, getBytesOut, getCreatedTimeStamp, getEndPoint, getExecutor, getInputBufferSize, getMessagesIn, getMessagesOut, isFillInterested, onClose, onFillInterestedFailed, onIdleExpired, onReadTimeout, removeListener, setInputBufferSize, toConnectionString, toString, tryFillInterested, tryFillInterested
-
-
-
-
Field Detail
-
CR_INDEX
private static final int CR_INDEX
- See Also:
- Constant Field Values
-
LF_INDEX
private static final int LF_INDEX
- See Also:
- Constant Field Values
-
_connector
private final Connector _connector
-
_next
private final ConnectionFactory _next
-
_buffer
private final java.nio.ByteBuffer _buffer
-
_builder
private final java.lang.StringBuilder _builder
-
_fields
private final java.lang.String[] _fields
-
_index
private int _index
-
_length
private int _length
-
-
Constructor Detail
-
ProxyProtocolV1Connection
private ProxyProtocolV1Connection(EndPoint endp, Connector connector, ConnectionFactory next)
-
-
Method Detail
-
onFillable
public void onFillable()
Description copied from class:AbstractConnectionCallback method invoked when the endpoint is ready to be read.
- Specified by:
onFillablein classAbstractConnection- See Also:
AbstractConnection.fillInterested()
-
onOpen
public void onOpen()
Description copied from interface:ConnectionCallback method invoked when this connection is opened.
Creators of the connection implementation are responsible for calling this method.
- Specified by:
onOpenin interfaceConnection- Overrides:
onOpenin classAbstractConnection
-
onUpgradeFrom
public java.nio.ByteBuffer onUpgradeFrom()
Description copied from interface:Connection.UpgradeFromInvoked during an
upgradeto produce a buffer containing bytes that have not been consumed by this connection, and that must be consumed by the upgrade-to connection.- Specified by:
onUpgradeFromin interfaceConnection.UpgradeFrom- Returns:
- a buffer of unconsumed bytes to pass to the upgrade-to connection. The buffer does not belong to any pool and should be discarded after having consumed its bytes. The returned buffer may be null if there are no unconsumed bytes.
-
onUpgradeTo
public void onUpgradeTo(java.nio.ByteBuffer buffer)
Description copied from interface:Connection.UpgradeToInvoked during an
upgradeto receive a buffer containing bytes that have not been consumed by the upgrade-from connection, and that must be consumed by this connection.- Specified by:
onUpgradeToin interfaceConnection.UpgradeTo- Parameters:
buffer- a non-null buffer of unconsumed bytes received from the upgrade-from connection. The buffer does not belong to any pool and should be discarded after having consumed its bytes.
-
parse
private boolean parse() throws java.io.IOException- Returns:
- true when parsing is done, false when more bytes are needed.
- Throws:
java.io.IOException
-
releaseAndClose
private void releaseAndClose()
-
upgrade
private void upgrade()
-
-