Enum VersionAndCommand
- java.lang.Object
-
- java.lang.Enum<VersionAndCommand>
-
- org.apache.sshd.contrib.server.session.proxyprotocolv2.data.VersionAndCommand
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<VersionAndCommand>
public enum VersionAndCommand extends java.lang.Enum<VersionAndCommand>
Version and command enumeration.The 13th byte is the protocol version and command. The highest four bits contains the version. As of this specification, it must always be sent as \x2 and the receiver must only accept this value.
The lowest four bits represents the command : - \x0 : LOCAL : the connection was established on purpose by the proxy without being relayed. The connection endpoints are the sender and the receiver. Such connections exist when the proxy sends health-checks to the server. The receiver must accept this connection as valid and must use the real connection endpoints and discard the protocol block including the family which is ignored. - \x1 : PROXY : the connection was established on behalf of another node, and reflects the original connection endpoints. The receiver must then use the information provided in the protocol block to get original the address. - other values are unassigned and must not be emitted by senders. Receivers must drop connections presenting unexpected values here.
-
-
Field Summary
Fields Modifier and Type Field Description private byte
value
-
Constructor Summary
Constructors Modifier Constructor Description private
VersionAndCommand(byte value)
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static VersionAndCommand
extractValue(org.slf4j.Logger logger, org.apache.sshd.server.session.ServerSession session, org.apache.sshd.common.util.buffer.Buffer buffer)
static VersionAndCommand
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static VersionAndCommand[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
LOCAL
public static final VersionAndCommand LOCAL
-
PROXY
public static final VersionAndCommand PROXY
-
-
Method Detail
-
values
public static VersionAndCommand[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (VersionAndCommand c : VersionAndCommand.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static VersionAndCommand valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
extractValue
public static VersionAndCommand extractValue(org.slf4j.Logger logger, org.apache.sshd.server.session.ServerSession session, org.apache.sshd.common.util.buffer.Buffer buffer) throws ProxyProtocolException
- Throws:
ProxyProtocolException
-
-