Class 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 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

      • sourceAddress

        public String sourceAddress()
        Returns the human-readable source address of this HAProxyMessage or null if HAProxy performs health check with send-proxy-v2.
      • destinationAddress

        public String destinationAddress()
        Returns the human-readable destination address of this HAProxyMessage.
      • sourcePort

        public int sourcePort()
        Returns the UDP/TCP source port of this HAProxyMessage.
      • destinationPort

        public int destinationPort()
        Returns the UDP/TCP destination port of this HAProxyMessage.
      • tlvs

        public List<HAProxyTLV> tlvs()
        Returns a list of HAProxyTLV 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 interface io.netty.util.ReferenceCounted
        Overrides:
        touch in class io.netty.util.AbstractReferenceCounted
      • retain

        public HAProxyMessage retain()
        Specified by:
        retain in interface io.netty.util.ReferenceCounted
        Overrides:
        retain in class io.netty.util.AbstractReferenceCounted
      • retain

        public HAProxyMessage retain​(int increment)
        Specified by:
        retain in interface io.netty.util.ReferenceCounted
        Overrides:
        retain in class io.netty.util.AbstractReferenceCounted
      • release

        public boolean release()
        Specified by:
        release in interface io.netty.util.ReferenceCounted
        Overrides:
        release in class io.netty.util.AbstractReferenceCounted
      • release

        public boolean release​(int decrement)
        Specified by:
        release in interface io.netty.util.ReferenceCounted
        Overrides:
        release in class io.netty.util.AbstractReferenceCounted
      • deallocate

        protected void deallocate()
        Specified by:
        deallocate in class io.netty.util.AbstractReferenceCounted