Home / Class/ HAProxyMessage Class — netty Architecture

HAProxyMessage Class — netty Architecture

Architecture documentation for the HAProxyMessage class in HAProxyMessage.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  086e8ebe_0b5c_c158_91d0_e3710503e584["HAProxyMessage"]
  437fbbe6_b9bb_e660_c1e6_276ecf536da9["HAProxyMessage.java"]
  086e8ebe_0b5c_c158_91d0_e3710503e584 -->|defined in| 437fbbe6_b9bb_e660_c1e6_276ecf536da9
  f4a83627_4b55_e57a_4cc8_cf8ebe863872["HAProxyMessage()"]
  086e8ebe_0b5c_c158_91d0_e3710503e584 -->|method| f4a83627_4b55_e57a_4cc8_cf8ebe863872
  5d8ff0a3_25a7_a5ad_456b_201f7fd76744["readTlvs()"]
  086e8ebe_0b5c_c158_91d0_e3710503e584 -->|method| 5d8ff0a3_25a7_a5ad_456b_201f7fd76744
  4611fb06_1e41_b734_d613_ca7390c93910["HAProxyTLV()"]
  086e8ebe_0b5c_c158_91d0_e3710503e584 -->|method| 4611fb06_1e41_b734_d613_ca7390c93910
  e8bf5f62_0f61_03b8_d105_4c8b8efe3117["String()"]
  086e8ebe_0b5c_c158_91d0_e3710503e584 -->|method| e8bf5f62_0f61_03b8_d105_4c8b8efe3117
  12f6af6e_6ca5_e26e_9da6_9cfaf23e27fa["portStringToInt()"]
  086e8ebe_0b5c_c158_91d0_e3710503e584 -->|method| 12f6af6e_6ca5_e26e_9da6_9cfaf23e27fa
  5ffc38ec_18a7_5545_cee7_67ab12d7b534["checkAddress()"]
  086e8ebe_0b5c_c158_91d0_e3710503e584 -->|method| 5ffc38ec_18a7_5545_cee7_67ab12d7b534
  9e3cf994_2859_45d4_77bf_0af573a60545["checkPort()"]
  086e8ebe_0b5c_c158_91d0_e3710503e584 -->|method| 9e3cf994_2859_45d4_77bf_0af573a60545
  6dfd8b8d_198a_28fd_ec69_e86dd6222dfc["HAProxyProtocolVersion()"]
  086e8ebe_0b5c_c158_91d0_e3710503e584 -->|method| 6dfd8b8d_198a_28fd_ec69_e86dd6222dfc
  e923f4b1_8771_1a95_fb4b_578b36e61c24["HAProxyCommand()"]
  086e8ebe_0b5c_c158_91d0_e3710503e584 -->|method| e923f4b1_8771_1a95_fb4b_578b36e61c24
  371b0fd9_a9c1_728e_34c6_ddbfb34b5807["HAProxyProxiedProtocol()"]
  086e8ebe_0b5c_c158_91d0_e3710503e584 -->|method| 371b0fd9_a9c1_728e_34c6_ddbfb34b5807
  e201f359_0e3c_94ab_699b_f865996736b8["sourcePort()"]
  086e8ebe_0b5c_c158_91d0_e3710503e584 -->|method| e201f359_0e3c_94ab_699b_f865996736b8
  0fba9ffc_0ba1_b518_677e_befa1db02a89["destinationPort()"]
  086e8ebe_0b5c_c158_91d0_e3710503e584 -->|method| 0fba9ffc_0ba1_b518_677e_befa1db02a89
  f38bae36_38e4_da58_eee5_c873e766d64a["tlvs()"]
  086e8ebe_0b5c_c158_91d0_e3710503e584 -->|method| f38bae36_38e4_da58_eee5_c873e766d64a

Relationship Graph

Source Code

codec-haproxy/src/main/java/io/netty/handler/codec/haproxy/HAProxyMessage.java lines 37–635

public final class HAProxyMessage extends AbstractReferenceCounted {

    // Let's pick some conservative limit here.
    private static final int MAX_NESTING_LEVEL = 128;
    private static final ResourceLeakDetector<HAProxyMessage> leakDetector =
            ResourceLeakDetectorFactory.instance().newResourceLeakDetector(HAProxyMessage.class);

    private final ResourceLeakTracker<HAProxyMessage> leak;
    private final HAProxyProtocolVersion protocolVersion;
    private final HAProxyCommand command;
    private final HAProxyProxiedProtocol proxiedProtocol;
    private final String sourceAddress;
    private final String destinationAddress;
    private final int sourcePort;
    private final int destinationPort;
    private final List<HAProxyTLV> tlvs;

    /**
     * Creates a new instance
     */
    private HAProxyMessage(
            HAProxyProtocolVersion protocolVersion, HAProxyCommand command, HAProxyProxiedProtocol proxiedProtocol,
            String sourceAddress, String destinationAddress, String sourcePort, String destinationPort) {
        this(
                protocolVersion, command, proxiedProtocol,
                sourceAddress, destinationAddress, portStringToInt(sourcePort), portStringToInt(destinationPort));
    }

    /**
     * Creates a new instance of HAProxyMessage.
     * @param protocolVersion the protocol version.
     * @param command the command.
     * @param proxiedProtocol the protocol containing the address family and transport protocol.
     * @param sourceAddress the source address.
     * @param destinationAddress the destination address.
     * @param sourcePort the source port. This value must be 0 for unix, unspec addresses.
     * @param destinationPort the destination port. This value must be 0 for unix, unspec addresses.
     */
    public HAProxyMessage(
            HAProxyProtocolVersion protocolVersion, HAProxyCommand command, HAProxyProxiedProtocol proxiedProtocol,
            String sourceAddress, String destinationAddress, int sourcePort, int destinationPort) {

        this(protocolVersion, command, proxiedProtocol,
             sourceAddress, destinationAddress, sourcePort, destinationPort, Collections.<HAProxyTLV>emptyList());
    }

    /**
     * Creates a new instance of HAProxyMessage.
     * @param protocolVersion the protocol version.
     * @param command the command.
     * @param proxiedProtocol the protocol containing the address family and transport protocol.
     * @param sourceAddress the source address.
     * @param destinationAddress the destination address.
     * @param sourcePort the source port. This value must be 0 for unix, unspec addresses.
     * @param destinationPort the destination port. This value must be 0 for unix, unspec addresses.
     * @param tlvs the list of tlvs.
     */
    public HAProxyMessage(
            HAProxyProtocolVersion protocolVersion, HAProxyCommand command, HAProxyProxiedProtocol proxiedProtocol,
            String sourceAddress, String destinationAddress, int sourcePort, int destinationPort,
            List<? extends HAProxyTLV> tlvs) {

        ObjectUtil.checkNotNull(protocolVersion, "protocolVersion");
        ObjectUtil.checkNotNull(proxiedProtocol, "proxiedProtocol");
        ObjectUtil.checkNotNull(tlvs, "tlvs");
        AddressFamily addrFamily = proxiedProtocol.addressFamily();

        checkAddress(sourceAddress, addrFamily);
        checkAddress(destinationAddress, addrFamily);
        checkPort(sourcePort, addrFamily);
        checkPort(destinationPort, addrFamily);

        this.protocolVersion = protocolVersion;
        this.command = command;
        this.proxiedProtocol = proxiedProtocol;
        this.sourceAddress = sourceAddress;
        this.destinationAddress = destinationAddress;
        this.sourcePort = sourcePort;
        this.destinationPort = destinationPort;
        this.tlvs = Collections.unmodifiableList(tlvs);

Frequently Asked Questions

What is the HAProxyMessage class?
HAProxyMessage is a class in the netty codebase, defined in codec-haproxy/src/main/java/io/netty/handler/codec/haproxy/HAProxyMessage.java.
Where is HAProxyMessage defined?
HAProxyMessage is defined in codec-haproxy/src/main/java/io/netty/handler/codec/haproxy/HAProxyMessage.java at line 37.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free