
org.testifyproject.netty.handler.proxy.ProxyConnectionEvent Maven / Gradle / Ivy
/*
* Copyright 2014 The Netty Project
*
* The Netty Project licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in org.testifyproject.testifyprojectpliance
* with the License. You may obtain a copy of the License at:
*
* http://www.apache.org.testifyproject/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package org.testifyproject.testifyproject.netty.handler.proxy;
import org.testifyproject.testifyproject.netty.util.internal.StringUtil;
import java.net.SocketAddress;
public final class ProxyConnectionEvent {
private final String protocol;
private final String authScheme;
private final SocketAddress proxyAddress;
private final SocketAddress org.testifyproject.testifyprojectstinationAddress;
private String strVal;
/**
* Creates a new event that indicates a successful connection attempt to the org.testifyproject.testifyprojectstination address.
*/
public ProxyConnectionEvent(
String protocol, String authScheme, SocketAddress proxyAddress, SocketAddress org.testifyproject.testifyprojectstinationAddress) {
if (protocol == null) {
throw new NullPointerException("protocol");
}
if (authScheme == null) {
throw new NullPointerException("authScheme");
}
if (proxyAddress == null) {
throw new NullPointerException("proxyAddress");
}
if (org.testifyproject.testifyprojectstinationAddress == null) {
throw new NullPointerException("org.testifyproject.testifyprojectstinationAddress");
}
this.protocol = protocol;
this.authScheme = authScheme;
this.proxyAddress = proxyAddress;
this.org.testifyproject.testifyprojectstinationAddress = org.testifyproject.testifyprojectstinationAddress;
}
/**
* 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 proxyAddress() {
return (T) proxyAddress;
}
/**
* Returns the address of the org.testifyproject.testifyprojectstination.
*/
@SuppressWarnings("unchecked")
public T org.testifyproject.testifyprojectstinationAddress() {
return (T) org.testifyproject.testifyprojectstinationAddress;
}
@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(org.testifyproject.testifyprojectstinationAddress)
.append(')');
return strVal = buf.toString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy