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

public final Class HAProxyMessageEncoder

extends MessageToByteEncoder<HAProxyMessage>
Class Inheritance
Annotations
@Sharable
Imports
io.netty.buffer.ByteBuf, io.netty.channel.ChannelHandler.Sharable, .ChannelHandlerContext, io.netty.handler.codec.MessageToByteEncoder, io.netty.util.CharsetUtil, .NetUtil, java.util.List

Encodes an HAProxy proxy protocol message
See Also
Proxy Protocol Specification

Field Summary

Modifier and TypeField and Description
public static final HAProxyMessageEncoder
pack-priv static final int
pack-priv static final int
private static final int

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
protected void
encode(ChannelHandlerContext ctx, HAProxyMessage
the message to encode
msg
,
ByteBuf
the ByteBuf into which the encoded message will be written
out
)

Implements abstract io.netty.handler.codec.MessageToByteEncoder.encode.

Encode a message into a ByteBuf.
private static void
encodeTlv(HAProxyTLV haProxyTLV, ByteBuf out)

private static void
encodeTlvs(List<HAProxyTLV> haProxyTLVs, ByteBuf out)

private static void
private static void
Inherited from io.netty.handler.codec.MessageToByteEncoder:
acceptOutboundMessageallocateBufferisPreferDirectwrite

Field Detail

INSTANCEback to summary
public static final HAProxyMessageEncoder INSTANCE
TOTAL_UNIX_ADDRESS_BYTES_LENGTHback to summary
pack-priv static final int TOTAL_UNIX_ADDRESS_BYTES_LENGTH
UNIX_ADDRESS_BYTES_LENGTHback to summary
pack-priv static final int UNIX_ADDRESS_BYTES_LENGTH
V2_VERSION_BITMASKback to summary
private static final int V2_VERSION_BITMASK

Constructor Detail

HAProxyMessageEncoderback to summary
private HAProxyMessageEncoder()

Method Detail

encodeback to summary
protected void encode(ChannelHandlerContext ctx, HAProxyMessage msg, ByteBuf out) throws Exception

Implements abstract io.netty.handler.codec.MessageToByteEncoder.encode.

Doc from io.netty.handler.codec.MessageToByteEncoder.encode.

Encode a message into a ByteBuf. This method will be called for each written message that can be handled by this encoder.

Parameters
ctx:ChannelHandlerContext

the ChannelHandlerContext which this MessageToByteEncoder belongs to

msg:HAProxyMessage

the message to encode

out:ByteBuf

the ByteBuf into which the encoded message will be written

Annotations
@Override
Exceptions
Exception:
is thrown if an error occurs
encodeTlvback to summary
private static void encodeTlv(HAProxyTLV haProxyTLV, ByteBuf out)
encodeTlvsback to summary
private static void encodeTlvs(List<HAProxyTLV> haProxyTLVs, ByteBuf out)
encodeV1back to summary
private static void encodeV1(HAProxyMessage msg, ByteBuf out)
encodeV2back to summary
private static void encodeV2(HAProxyMessage msg, ByteBuf out)