Package io.netty.handler.codec.haproxy
Class HAProxyMessage
- java.lang.Object
-
- io.netty.util.AbstractReferenceCounted
-
- io.netty.handler.codec.haproxy.HAProxyMessage
-
- All Implemented Interfaces:
ReferenceCounted
public final class HAProxyMessage extends AbstractReferenceCounted
Message container for decoded HAProxy proxy protocol parameters
-
-
Constructor Summary
Constructors Constructor Description HAProxyMessage(HAProxyProtocolVersion protocolVersion, HAProxyCommand command, HAProxyProxiedProtocol proxiedProtocol, java.lang.String sourceAddress, java.lang.String destinationAddress, int sourcePort, int destinationPort)Creates a new instance of HAProxyMessage.HAProxyMessage(HAProxyProtocolVersion protocolVersion, HAProxyCommand command, HAProxyProxiedProtocol proxiedProtocol, java.lang.String sourceAddress, java.lang.String destinationAddress, int sourcePort, int destinationPort, java.util.List<? extends HAProxyTLV> tlvs)Creates a new instance of HAProxyMessage.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HAProxyCommandcommand()Returns theHAProxyCommandof thisHAProxyMessage.protected voiddeallocate()Called onceAbstractReferenceCounted.refCnt()is equals 0.java.lang.StringdestinationAddress()Returns the human-readable destination address of thisHAProxyMessage.intdestinationPort()Returns the UDP/TCP destination port of thisHAProxyMessage.HAProxyProtocolVersionprotocolVersion()Returns theHAProxyProtocolVersionof thisHAProxyMessage.HAProxyProxiedProtocolproxiedProtocol()Returns theHAProxyProxiedProtocolof thisHAProxyMessage.booleanrelease()Decreases the reference count by1and deallocates this object if the reference count reaches at0.booleanrelease(int decrement)Decreases the reference count by the specifieddecrementand deallocates this object if the reference count reaches at0.HAProxyMessageretain()Increases the reference count by1.HAProxyMessageretain(int increment)Increases the reference count by the specifiedincrement.java.lang.StringsourceAddress()Returns the human-readable source address of thisHAProxyMessageornullif HAProxy performs health check withsend-proxy-v2.intsourcePort()Returns the UDP/TCP source port of thisHAProxyMessage.java.util.List<HAProxyTLV>tlvs()Returns a list ofHAProxyTLVor an empty list if no TLVs are present.java.lang.StringtoString()HAProxyMessagetouch()Records the current access location of this object for debugging purposes.HAProxyMessagetouch(java.lang.Object hint)Records the current access location of this object with an additional arbitrary information for debugging purposes.-
Methods inherited from class io.netty.util.AbstractReferenceCounted
refCnt, setRefCnt
-
-
-
-
Constructor Detail
-
HAProxyMessage
public HAProxyMessage(HAProxyProtocolVersion protocolVersion, HAProxyCommand command, HAProxyProxiedProtocol proxiedProtocol, java.lang.String sourceAddress, java.lang.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, java.lang.String sourceAddress, java.lang.String destinationAddress, int sourcePort, int destinationPort, java.util.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 theHAProxyProtocolVersionof thisHAProxyMessage.
-
command
public HAProxyCommand command()
Returns theHAProxyCommandof thisHAProxyMessage.
-
proxiedProtocol
public HAProxyProxiedProtocol proxiedProtocol()
Returns theHAProxyProxiedProtocolof thisHAProxyMessage.
-
sourceAddress
public java.lang.String sourceAddress()
Returns the human-readable source address of thisHAProxyMessageornullif HAProxy performs health check withsend-proxy-v2.
-
destinationAddress
public java.lang.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 java.util.List<HAProxyTLV> tlvs()
Returns a list ofHAProxyTLVor an empty list if no TLVs are present.TLVs are only available for the Proxy Protocol V2
-
touch
public HAProxyMessage touch()
Description copied from interface:ReferenceCountedRecords the current access location of this object for debugging purposes. If this object is determined to be leaked, the information recorded by this operation will be provided to you viaResourceLeakDetector. This method is a shortcut totouch(null).- Specified by:
touchin interfaceReferenceCounted- Overrides:
touchin classAbstractReferenceCounted
-
touch
public HAProxyMessage touch(java.lang.Object hint)
Description copied from interface:ReferenceCountedRecords the current access location of this object with an additional arbitrary information for debugging purposes. If this object is determined to be leaked, the information recorded by this operation will be provided to you viaResourceLeakDetector.
-
retain
public HAProxyMessage retain()
Description copied from interface:ReferenceCountedIncreases the reference count by1.- Specified by:
retainin interfaceReferenceCounted- Overrides:
retainin classAbstractReferenceCounted
-
retain
public HAProxyMessage retain(int increment)
Description copied from interface:ReferenceCountedIncreases the reference count by the specifiedincrement.- Specified by:
retainin interfaceReferenceCounted- Overrides:
retainin classAbstractReferenceCounted
-
release
public boolean release()
Description copied from interface:ReferenceCountedDecreases the reference count by1and deallocates this object if the reference count reaches at0.- Specified by:
releasein interfaceReferenceCounted- Overrides:
releasein classAbstractReferenceCounted- Returns:
trueif and only if the reference count became0and this object has been deallocated
-
release
public boolean release(int decrement)
Description copied from interface:ReferenceCountedDecreases the reference count by the specifieddecrementand deallocates this object if the reference count reaches at0.- Specified by:
releasein interfaceReferenceCounted- Overrides:
releasein classAbstractReferenceCounted- Returns:
trueif and only if the reference count became0and this object has been deallocated
-
deallocate
protected void deallocate()
Description copied from class:AbstractReferenceCountedCalled onceAbstractReferenceCounted.refCnt()is equals 0.- Specified by:
deallocatein classAbstractReferenceCounted
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-