ice.net.proxy
Class Proxy

java.lang.Object
  extended byice.net.ConnectionRoute
      extended byice.net.Indirect
          extended byice.net.proxy.Proxy
All Implemented Interfaces:
Serializable

public class Proxy
extends Indirect
implements Serializable

This is the implementation of an ConnectionRoute using a proxy.

Version:
1.5 (moved from ice.net)
Author:
Jack van Ooststroom
See Also:
Serialized Form

Field Summary
 
Fields inherited from class ice.net.ConnectionRoute
KNOWN_BAD, KNOWN_GOOD, UNTESTED
 
Constructor Summary
Proxy(String host)
          Constructs a Proxy with the specified host.
Proxy(String host, int port)
          Constructs a Proxy with the specified host and port.
Proxy(String host, int port, String protocol)
          Deprecated. As of 1.5, replaced by Proxy(String, String, int).
Proxy(String host, int port, String protocol, boolean tunneling)
          Deprecated. As of 1.5, replaced by Proxy(String, String, int, boolean).
Proxy(String protocol, String host, int port)
          Constructs a Proxy with the specified protocol, host and port.
Proxy(String protocol, String host, int port, boolean tunneling)
          Constructs a Proxy with the specified protocol, host, port and tunneling.
 
Method Summary
protected  void checkProtocol(String protocol)
          Convenience method to check the specified protocol for validity.
 boolean equals(Object object)
           
 Authentication getAuthentication()
          Returns the authentication of this Proxy.
 String getProtocol()
          Returns the protocol of this Proxy.
 Authentication getProxyAuthentication()
          Deprecated. As of 1.5, replaced by getAuthentication().
 boolean isTunneling()
          Determines whether this Proxy is tunneling.
 void setAuthentication(Authentication authentication)
          Sets this Proxy's authentication to the specified authentication.
 void setProxyAuthentication(Authentication authentication)
          Deprecated. As of 1.5, replaced by setAuthentication(Authentication).
 String toString()
           
 
Methods inherited from class ice.net.Indirect
checkHost, checkPort, getHost, getPort, getStatus, setStatus
 
Methods inherited from class ice.net.ConnectionRoute
checkStatus, getRequestedUrl, setRequestedUrl
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Proxy

public Proxy(String host)
      throws IllegalArgumentException

Constructs a Proxy with the specified host.

Parameters:
host - the host name of the Proxy to be created.
Throws:
IllegalArgumentException - if the specified host is either null or empty.
See Also:
#Indirect(String, int)

Proxy

public Proxy(String host,
             int port)
      throws IllegalArgumentException

Constructs a Proxy with the specified host and port.

Parameters:
host - the host name of the Proxy to be created.
port - the port number of the Proxy to be created.
Throws:
IllegalArgumentException - if one of the following occurs:
See Also:
#Indirect(String, int)

Proxy

public Proxy(String protocol,
             String host,
             int port)
      throws IllegalArgumentException

Constructs a Proxy with the specified protocol, host and port.

Parameters:
protocol - the protocol of the Proxy to be created.
host - the host name of the Proxy to be created.
port - the port number of the Proxy to be created.
Throws:
IllegalArgumentException - if one of the following occurs:
Since:
1.5
See Also:
#Indirect(String, int)

Proxy

public Proxy(String protocol,
             String host,
             int port,
             boolean tunneling)
      throws IllegalArgumentException

Constructs a Proxy with the specified protocol, host, port and tunneling.

Parameters:
protocol - the protocol of the Proxy to be created.
host - the host name of the Proxy to be created.
port - the port number of the Proxy to be created.
tunneling -
Throws:
IllegalArgumentException - if one of the following occurs:
Since:
1.5
See Also:
#Indirect(String, int)

Proxy

public Proxy(String host,
             int port,
             String protocol)
Deprecated. As of 1.5, replaced by Proxy(String, String, int).


Proxy

public Proxy(String host,
             int port,
             String protocol,
             boolean tunneling)
Deprecated. As of 1.5, replaced by Proxy(String, String, int, boolean).

Method Detail

equals

public boolean equals(Object object)
Overrides:
equals in class Indirect

getAuthentication

public final Authentication getAuthentication()

Returns the authentication of this Proxy.

Returns:
the authentication.
Since:
1.5
See Also:
setAuthentication(Authentication)

getProtocol

public final String getProtocol()

Returns the protocol of this Proxy.

Note: this returns the protocol of the Proxy connection route, not the requested protocol!

Returns:
the protocol.

getProxyAuthentication

public Authentication getProxyAuthentication()
Deprecated. As of 1.5, replaced by getAuthentication().


isTunneling

public final boolean isTunneling()

Determines whether this Proxy is tunneling.

Returns:
true if this Proxy is tunneling, false if not.

setAuthentication

public final void setAuthentication(Authentication authentication)

Sets this Proxy's authentication to the specified authentication.

Parameters:
authentication -
Since:
1.5
See Also:
getAuthentication()

setProxyAuthentication

public void setProxyAuthentication(Authentication authentication)
Deprecated. As of 1.5, replaced by setAuthentication(Authentication).


toString

public String toString()

checkProtocol

protected final void checkProtocol(String protocol)
                            throws IllegalArgumentException

Convenience method to check the specified protocol for validity.

The specified protocol is only valid if all of the following applies:

Parameters:
protocol - the protocol to be checked.
Throws:
IllegalArgumentException - if the specified protocol is either null or empty.
Since:
1.5