Top Description Inners Fields Constructors Methods
io.netty.contrib.handler.codec.haproxy

public Class HAProxyTLV

extends BufferHolder<HAProxyTLV>
Class Inheritance
Known Direct Subclasses
io.netty.contrib.handler.codec.haproxy.HAProxySSLTLV
Imports
io.netty5.buffer.Buffer, .BufferHolder, io.netty5.util.internal.StringUtil

A Type-Length Value (TLV vector) that can be added to the PROXY protocol to include additional information like SSL information.
See Also
HAProxySSLTLV

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
HAProxyTLV.Type

The registered types a TLV can have regarding the PROXY protocol 1.5 spec

Field Summary

Modifier and TypeField and Description
private final HAProxyTLV.Type
private final byte

Constructor Summary

AccessConstructor and Description
public
HAProxyTLV(byte
the byteValue of the TLV. This is especially important if non-standard TLVs are used
typeByteValue
,
Buffer
the raw content of the TLV
content
)

Creates a new HAProxyTLV

public
HAProxyTLV(HAProxyTLV.Type
the Type of the TLV
type
,
Buffer
the raw content of the TLV
content
)

Creates a new HAProxyTLV

pack-priv
HAProxyTLV(final HAProxyTLV.Type
the Type of the TLV
type
,
final byte
the byteValue of the TLV. This is especially important if non-standard TLVs are used
typeByteValue
,
final Buffer
the raw content of the TLV
content
)

Creates a new HAProxyTLV

Method Summary

Modifier and TypeMethod and Description
pack-priv Buffer
pack-priv int
protected HAProxyTLV
receive(Buffer
The Buffer that is received by the recipient, and needs to be wrapped in a new BufferHolder instance.
buf
)

Implements abstract io.netty5.buffer.BufferHolder.receive.

Called when a sent BufferHolder is received by the recipient.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
pack-priv int

Returns:

the number of bytes.
totalNumBytes
()

The size of this tlv in bytes.

public HAProxyTLV.Type
type()

Returns the Type of this TLV

public byte
typeByteValue()

Returns the type of the TLV as byte

Inherited from io.netty5.buffer.BufferHolder:
closeequalsgetBuffergetBufferVolatilehashCodeisAccessiblereplaceBufferreplaceBufferVolatilesendtouch

Field Detail

typeback to summary
private final HAProxyTLV.Type type
typeByteValueback to summary
private final byte typeByteValue

Constructor Detail

HAProxyTLVback to summary
public HAProxyTLV(byte typeByteValue, Buffer content)

Creates a new HAProxyTLV

Parameters
typeByteValue:byte

the byteValue of the TLV. This is especially important if non-standard TLVs are used

content:Buffer

the raw content of the TLV

HAProxyTLVback to summary
public HAProxyTLV(HAProxyTLV.Type type, Buffer content)

Creates a new HAProxyTLV

Parameters
type:HAProxyTLV.Type

the Type of the TLV

content:Buffer

the raw content of the TLV

HAProxyTLVback to summary
pack-priv HAProxyTLV(final HAProxyTLV.Type type, final byte typeByteValue, final Buffer content)

Creates a new HAProxyTLV

Parameters
type:HAProxyTLV.Type

the Type of the TLV

typeByteValue:byte

the byteValue of the TLV. This is especially important if non-standard TLVs are used

content:Buffer

the raw content of the TLV

Method Detail

contentback to summary
pack-priv Buffer content()
contentNumBytesback to summary
pack-priv int contentNumBytes()
receiveback to summary
protected HAProxyTLV receive(Buffer buf)

Implements abstract io.netty5.buffer.BufferHolder.receive.

Doc from io.netty5.buffer.BufferHolder.receive.

Called when a sent BufferHolder is received by the recipient. The BufferHolder should return a new concrete instance, that wraps the given Buffer object.

Parameters
buf:Buffer

The Buffer that is received by the recipient, and needs to be wrapped in a new BufferHolder instance.

Returns:HAProxyTLV

A new buffer holder instance, containing the given buffer.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
totalNumBytesback to summary
pack-priv int totalNumBytes()

The size of this tlv in bytes.

Returns:int

the number of bytes.

typeback to summary
public HAProxyTLV.Type type()

Returns the Type of this TLV

typeByteValueback to summary
public byte typeByteValue()

Returns the type of the TLV as byte

io.netty.contrib.handler.codec.haproxy back to summary

public final Enum HAProxyTLV.Type

extends Enum<HAProxyTLV.Type>
Class Inheritance

The registered types a TLV can have regarding the PROXY protocol 1.5 spec

Field Summary

Modifier and TypeField and Description
public static final HAProxyTLV.Type
OTHER

A TLV type that is not officially defined in the spec.

public static final HAProxyTLV.Type
public static final HAProxyTLV.Type
public static final HAProxyTLV.Type
public static final HAProxyTLV.Type
public static final HAProxyTLV.Type
public static final HAProxyTLV.Type

Constructor Summary

AccessConstructor and Description
private
Type()

Method Summary

Modifier and TypeMethod and Description
public static byte

Returns:

the byte value of the Type.
byteValueForType
(HAProxyTLV.Type
the Type
type
)

Returns the byte value for the Type as defined in the PROXY protocol 1.5 spec.

public static HAProxyTLV.Type

Returns:

the Type of a TLV
typeForByteValue
(byte
the byte for a type
byteValue
)

Returns the Type for a specific byte value as defined in the PROXY protocol 1.5 spec

If the byte value is not an official one, it will return Type#OTHER.

public static HAProxyTLV.Type
public static HAProxyTLV.Type[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

OTHERback to summary
public static final HAProxyTLV.Type OTHER

A TLV type that is not officially defined in the spec. May be used for nonstandard TLVs

PP2_TYPE_ALPNback to summary
public static final HAProxyTLV.Type PP2_TYPE_ALPN
PP2_TYPE_AUTHORITYback to summary
public static final HAProxyTLV.Type PP2_TYPE_AUTHORITY
PP2_TYPE_NETNSback to summary
public static final HAProxyTLV.Type PP2_TYPE_NETNS
PP2_TYPE_SSLback to summary
public static final HAProxyTLV.Type PP2_TYPE_SSL
PP2_TYPE_SSL_CNback to summary
public static final HAProxyTLV.Type PP2_TYPE_SSL_CN
PP2_TYPE_SSL_VERSIONback to summary
public static final HAProxyTLV.Type PP2_TYPE_SSL_VERSION

Constructor Detail

Typeback to summary
private Type()

Method Detail

byteValueForTypeback to summary
public static byte byteValueForType(HAProxyTLV.Type type)

Returns the byte value for the Type as defined in the PROXY protocol 1.5 spec.

Parameters
type:HAProxyTLV.Type

the Type

Returns:byte

the byte value of the Type.

typeForByteValueback to summary
public static HAProxyTLV.Type typeForByteValue(byte byteValue)

Returns the Type for a specific byte value as defined in the PROXY protocol 1.5 spec

If the byte value is not an official one, it will return Type#OTHER.

Parameters
byteValue:byte

the byte for a type

Returns:HAProxyTLV.Type

the Type of a TLV

valueOfback to summary
public static HAProxyTLV.Type valueOf(String name)
valuesback to summary
public static HAProxyTLV.Type[] values()