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:
Closeable
,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
FieldsModifier and TypeFieldDescriptionprivate final ByteBuffer
private final StringBuilder
private final Connector
private final String[]
private int
private int
private final ConnectionFactory
private static final int
private static final int
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
ProxyProtocolV1Connection
(EndPoint endp, Connector connector, ConnectionFactory next) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Callback method invoked when the endpoint is ready to be read.void
onOpen()
Callback method invoked when this connection is opened.Invoked during anupgrade
to produce a buffer containing bytes that have not been consumed by this connection, and that must be consumed by the upgrade-to connection.void
onUpgradeTo
(ByteBuffer buffer) Invoked during anupgrade
to receive a buffer containing bytes that have not been consumed by the upgrade-from connection, and that must be consumed by this connection.private boolean
parse()
private void
private void
upgrade()
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 Details
-
CR_INDEX
private static final int CR_INDEX- See Also:
-
LF_INDEX
private static final int LF_INDEX- See Also:
-
_connector
-
_next
-
_buffer
-
_builder
-
_fields
-
_index
private int _index -
_length
private int _length
-
-
Constructor Details
-
ProxyProtocolV1Connection
-
-
Method Details
-
onFillable
public void onFillable()Description copied from class:AbstractConnection
Callback method invoked when the endpoint is ready to be read.
- Specified by:
onFillable
in classAbstractConnection
- See Also:
-
onOpen
public void onOpen()Description copied from interface:Connection
Callback method invoked when this connection is opened.
Creators of the connection implementation are responsible for calling this method.
- Specified by:
onOpen
in interfaceConnection
- Overrides:
onOpen
in classAbstractConnection
-
onUpgradeFrom
Description copied from interface:Connection.UpgradeFrom
Invoked during an
upgrade
to 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:
onUpgradeFrom
in 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
Description copied from interface:Connection.UpgradeTo
Invoked during an
upgrade
to 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:
onUpgradeTo
in 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
- Returns:
- true when parsing is done, false when more bytes are needed.
- Throws:
IOException
-
releaseAndClose
private void releaseAndClose() -
upgrade
private void upgrade()
-