Package io.netty.handler.codec.haproxy
Class HAProxyMessage
- java.lang.Object
-
- io.netty.util.AbstractReferenceCounted
-
- io.netty.handler.codec.haproxy.HAProxyMessage
-
- All Implemented Interfaces:
io.netty.util.ReferenceCounted
public final class HAProxyMessage extends io.netty.util.AbstractReferenceCounted
Message container for decoded HAProxy proxy protocol parameters
-
-
Constructor Summary
Constructors Constructor Description HAProxyMessage(HAProxyProtocolVersion protocolVersion, HAProxyCommand command, HAProxyProxiedProtocol proxiedProtocol, String sourceAddress, String destinationAddress, int sourcePort, int destinationPort)
Creates a new instance of HAProxyMessage.HAProxyMessage(HAProxyProtocolVersion protocolVersion, HAProxyCommand command, HAProxyProxiedProtocol proxiedProtocol, String sourceAddress, String destinationAddress, int sourcePort, int destinationPort, List<? extends HAProxyTLV> tlvs)
Creates a new instance of HAProxyMessage.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HAProxyCommand
command()
Returns theHAProxyCommand
of thisHAProxyMessage
.protected void
deallocate()
String
destinationAddress()
Returns the human-readable destination address of thisHAProxyMessage
.int
destinationPort()
Returns the UDP/TCP destination port of thisHAProxyMessage
.HAProxyProtocolVersion
protocolVersion()
Returns theHAProxyProtocolVersion
of thisHAProxyMessage
.HAProxyProxiedProtocol
proxiedProtocol()
Returns theHAProxyProxiedProtocol
of thisHAProxyMessage
.boolean
release()
boolean
release(int decrement)
HAProxyMessage
retain()
HAProxyMessage
retain(int increment)
String
sourceAddress()
Returns the human-readable source address of thisHAProxyMessage
ornull
if HAProxy performs health check withsend-proxy-v2
.int
sourcePort()
Returns the UDP/TCP source port of thisHAProxyMessage
.List<HAProxyTLV>
tlvs()
Returns a list ofHAProxyTLV
or an empty list if no TLVs are present.String
toString()
HAProxyMessage
touch()
HAProxyMessage
touch(Object hint)
-
-
-
Constructor Detail
-
HAProxyMessage
public HAProxyMessage(HAProxyProtocolVersion protocolVersion, HAProxyCommand command, HAProxyProxiedProtocol proxiedProtocol, String sourceAddress, String destinationAddress, int sourcePort, int destinationPort)
Creates a new instance of HAProxyMessage.- Parameters:
protocolVersion
- the protocol version.command
- the command.proxiedProtocol
- the protocol containing the address family and transport protocol.sourceAddress
- the source address.destinationAddress
- the destination address.sourcePort
- the source port. This value must be 0 for unix, unspec addresses.destinationPort
- the destination port. This value must be 0 for unix, unspec addresses.
-
HAProxyMessage
public HAProxyMessage(HAProxyProtocolVersion protocolVersion, HAProxyCommand command, HAProxyProxiedProtocol proxiedProtocol, String sourceAddress, String destinationAddress, int sourcePort, int destinationPort, List<? extends HAProxyTLV> tlvs)
Creates a new instance of HAProxyMessage.- Parameters:
protocolVersion
- the protocol version.command
- the command.proxiedProtocol
- the protocol containing the address family and transport protocol.sourceAddress
- the source address.destinationAddress
- the destination address.sourcePort
- the source port. This value must be 0 for unix, unspec addresses.destinationPort
- the destination port. This value must be 0 for unix, unspec addresses.tlvs
- the list of tlvs.
-
-
Method Detail
-
protocolVersion
public HAProxyProtocolVersion protocolVersion()
Returns theHAProxyProtocolVersion
of thisHAProxyMessage
.
-
command
public HAProxyCommand command()
Returns theHAProxyCommand
of thisHAProxyMessage
.
-
proxiedProtocol
public HAProxyProxiedProtocol proxiedProtocol()
Returns theHAProxyProxiedProtocol
of thisHAProxyMessage
.
-
sourceAddress
public String sourceAddress()
Returns the human-readable source address of thisHAProxyMessage
ornull
if HAProxy performs health check withsend-proxy-v2
.
-
destinationAddress
public String destinationAddress()
Returns the human-readable destination address of thisHAProxyMessage
.
-
sourcePort
public int sourcePort()
Returns the UDP/TCP source port of thisHAProxyMessage
.
-
destinationPort
public int destinationPort()
Returns the UDP/TCP destination port of thisHAProxyMessage
.
-
tlvs
public List<HAProxyTLV> tlvs()
Returns a list ofHAProxyTLV
or an empty list if no TLVs are present.TLVs are only available for the Proxy Protocol V2
-
touch
public HAProxyMessage touch()
- Specified by:
touch
in interfaceio.netty.util.ReferenceCounted
- Overrides:
touch
in classio.netty.util.AbstractReferenceCounted
-
touch
public HAProxyMessage touch(Object hint)
-
retain
public HAProxyMessage retain()
- Specified by:
retain
in interfaceio.netty.util.ReferenceCounted
- Overrides:
retain
in classio.netty.util.AbstractReferenceCounted
-
retain
public HAProxyMessage retain(int increment)
- Specified by:
retain
in interfaceio.netty.util.ReferenceCounted
- Overrides:
retain
in classio.netty.util.AbstractReferenceCounted
-
release
public boolean release()
- Specified by:
release
in interfaceio.netty.util.ReferenceCounted
- Overrides:
release
in classio.netty.util.AbstractReferenceCounted
-
release
public boolean release(int decrement)
- Specified by:
release
in interfaceio.netty.util.ReferenceCounted
- Overrides:
release
in classio.netty.util.AbstractReferenceCounted
-
deallocate
protected void deallocate()
- Specified by:
deallocate
in classio.netty.util.AbstractReferenceCounted
-
-