Class HAProxyMessage
java.lang.Object
io.netty.util.AbstractReferenceCounted
io.netty.handler.codec.haproxy.HAProxyMessage
- All Implemented Interfaces:
ReferenceCounted
Message container for decoded HAProxy proxy protocol parameters
-
Constructor Summary
ConstructorsConstructorDescriptionHAProxyMessage(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
Modifier and TypeMethodDescriptioncommand()Returns theHAProxyCommandof thisHAProxyMessage.protected voidCalled onceAbstractReferenceCounted.refCnt()is equals 0.Returns the human-readable destination address of thisHAProxyMessage.intReturns the UDP/TCP destination port of thisHAProxyMessage.Returns theHAProxyProtocolVersionof thisHAProxyMessage.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.retain()Increases the reference count by1.retain(int increment) Increases the reference count by the specifiedincrement.Returns the human-readable source address of thisHAProxyMessageornullif HAProxy performs health check withsend-proxy-v2.intReturns the UDP/TCP source port of thisHAProxyMessage.tlvs()Returns a list ofHAProxyTLVor an empty list if no TLVs are present.toString()touch()Records the current access location of this object for debugging purposes.Records the current access location of this object with an additional arbitrary information for debugging purposes.Methods inherited from class AbstractReferenceCounted
refCnt, setRefCnt
-
Constructor Details
-
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 Details
-
protocolVersion
Returns theHAProxyProtocolVersionof thisHAProxyMessage. -
command
Returns theHAProxyCommandof thisHAProxyMessage. -
proxiedProtocol
Returns theHAProxyProxiedProtocolof thisHAProxyMessage. -
sourceAddress
Returns the human-readable source address of thisHAProxyMessageornullif HAProxy performs health check withsend-proxy-v2. -
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
Returns a list ofHAProxyTLVor an empty list if no TLVs are present.TLVs are only available for the Proxy Protocol V2
-
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
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
Description copied from interface:ReferenceCountedIncreases the reference count by1.- Specified by:
retainin interfaceReferenceCounted- Overrides:
retainin classAbstractReferenceCounted
-
retain
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
-