Home / Class/ ProxyConnectionEvent Class — netty Architecture

ProxyConnectionEvent Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  bf6ca9ff_36f1_3dd5_a30c_34f7fa5fb4a8["ProxyConnectionEvent"]
  1554f972_349e_a42c_b28b_e088bbc850d0["ProxyConnectionEvent.java"]
  bf6ca9ff_36f1_3dd5_a30c_34f7fa5fb4a8 -->|defined in| 1554f972_349e_a42c_b28b_e088bbc850d0
  03cf5739_8382_e929_2291_1730ee2dcaeb["ProxyConnectionEvent()"]
  bf6ca9ff_36f1_3dd5_a30c_34f7fa5fb4a8 -->|method| 03cf5739_8382_e929_2291_1730ee2dcaeb
  d4168fb6_e17a_19bc_17ce_32fb46665d8b["String()"]
  bf6ca9ff_36f1_3dd5_a30c_34f7fa5fb4a8 -->|method| d4168fb6_e17a_19bc_17ce_32fb46665d8b
  4ff084c6_a9a8_6c4e_5029_8b65053c6575["T()"]
  bf6ca9ff_36f1_3dd5_a30c_34f7fa5fb4a8 -->|method| 4ff084c6_a9a8_6c4e_5029_8b65053c6575

Relationship Graph

Source Code

handler-proxy/src/main/java/io/netty/handler/proxy/ProxyConnectionEvent.java lines 24–93

public final class ProxyConnectionEvent {

    private final String protocol;
    private final String authScheme;
    private final SocketAddress proxyAddress;
    private final SocketAddress destinationAddress;
    private String strVal;

    /**
     * Creates a new event that indicates a successful connection attempt to the destination address.
     */
    public ProxyConnectionEvent(
            String protocol, String authScheme, SocketAddress proxyAddress, SocketAddress destinationAddress) {
        this.protocol = ObjectUtil.checkNotNull(protocol, "protocol");
        this.authScheme = ObjectUtil.checkNotNull(authScheme, "authScheme");
        this.proxyAddress = ObjectUtil.checkNotNull(proxyAddress, "proxyAddress");
        this.destinationAddress = ObjectUtil.checkNotNull(destinationAddress, "destinationAddress");
    }

    /**
     * Returns the name of the proxy protocol in use.
     */
    public String protocol() {
        return protocol;
    }

    /**
     * Returns the name of the authentication scheme in use.
     */
    public String authScheme() {
        return authScheme;
    }

    /**
     * Returns the address of the proxy server.
     */
    @SuppressWarnings("unchecked")
    public <T extends SocketAddress> T proxyAddress() {
        return (T) proxyAddress;
    }

    /**
     * Returns the address of the destination.
     */
    @SuppressWarnings("unchecked")
    public <T extends SocketAddress> T destinationAddress() {
        return (T) destinationAddress;
    }

    @Override
    public String toString() {
        if (strVal != null) {
            return strVal;
        }

        StringBuilder buf = new StringBuilder(128)
            .append(StringUtil.simpleClassName(this))
            .append('(')
            .append(protocol)
            .append(", ")
            .append(authScheme)
            .append(", ")
            .append(proxyAddress)
            .append(" => ")
            .append(destinationAddress)
            .append(')');

        return strVal = buf.toString();
    }
}

Frequently Asked Questions

What is the ProxyConnectionEvent class?
ProxyConnectionEvent is a class in the netty codebase, defined in handler-proxy/src/main/java/io/netty/handler/proxy/ProxyConnectionEvent.java.
Where is ProxyConnectionEvent defined?
ProxyConnectionEvent is defined in handler-proxy/src/main/java/io/netty/handler/proxy/ProxyConnectionEvent.java at line 24.

Analyze Your Own Codebase

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

Try Supermodel Free