org.jurvis.net
Class JvProxyInfo

java.lang.Object
  extended by org.jurvis.net.JvProxyInfo

public class JvProxyInfo
extends Object

Class containing information about a proxy host.

Author:
Neil W. Weber
See Also:
JvProxyConfig.getProxyForURI(java.lang.String)

Field Summary
static int DIRECT
          Enumerated value indicating the connection can be made directly, without any proxies.
protected  String host
          The name of the proxy host or null for the DIRECT method.
protected  int method
          The method used to connect to the URL.
protected static String[] methodStrings
          String representations of the three enumerated methods.
protected  int port
          The port on the proxy host or 0 for the DIRECT method.
static int PROXY
          Enumerated value indicating the specified proxy should be used.
static int SOCKS
          Enumerated value indicating the specified SOCKS server should be used.
 
Constructor Summary
JvProxyInfo()
          Construct a new JvProxyInfo.
JvProxyInfo(int method, String host, int port)
          Construct a new JvProxyInfo.
JvProxyInfo(String method, String host)
          Construct a new JvProxyInfo.
 
Method Summary
 String getHost()
          The name of the proxy host or null for the DIRECT method.
 int getMethod()
          Return the method used to connect to the URL.
 int getPort()
          Return the port on the proxy host or 0 for the DIRECT method.
 void setHost(String host)
          Set the name of the proxy host.
 void setMethod(int method)
          Set the method used to connect to the URL.
 void setPort(int port)
          Set the port on the proxy host or 0 for the DIRECT method.
 String toString()
          Returns a string representation of the object suitable for debugging.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DIRECT

public static final int DIRECT
Enumerated value indicating the connection can be made directly, without any proxies.

See Also:
Constant Field Values

PROXY

public static final int PROXY
Enumerated value indicating the specified proxy should be used.

See Also:
Constant Field Values

SOCKS

public static final int SOCKS
Enumerated value indicating the specified SOCKS server should be used.

See Also:
Constant Field Values

methodStrings

protected static final String[] methodStrings
String representations of the three enumerated methods.


method

protected int method
The method used to connect to the URL. One of DIRECT, PROXY, or SOCKS.


host

protected String host
The name of the proxy host or null for the DIRECT method.


port

protected int port
The port on the proxy host or 0 for the DIRECT method.

Constructor Detail

JvProxyInfo

public JvProxyInfo()
Construct a new JvProxyInfo.


JvProxyInfo

public JvProxyInfo(int method,
                   String host,
                   int port)
Construct a new JvProxyInfo.

Parameters:
method - the method used to connect to the URL
host - the name of the proxy host
port - the port on the proxy host

JvProxyInfo

public JvProxyInfo(String method,
                   String host)
Construct a new JvProxyInfo.

Parameters:
method - the method used to connect to the URL
host - the name and port of the proxy host
Method Detail

getHost

public String getHost()
The name of the proxy host or null for the DIRECT method.

Returns:
the name of the proxy host or null for the DIRECT method

setHost

public void setHost(String host)
Set the name of the proxy host.

Parameters:
host - the name of the proxy host

getMethod

public int getMethod()
Return the method used to connect to the URL. One of DIRECT, PROXY, or SOCKS.

Returns:
the method used to connect to the URL

setMethod

public void setMethod(int method)
Set the method used to connect to the URL.

Parameters:
method - the method used to connect to the URL

getPort

public int getPort()
Return the port on the proxy host or 0 for the DIRECT method.

Returns:
the port on the proxy host or 0 for the DIRECT method

setPort

public void setPort(int port)
Set the port on the proxy host or 0 for the DIRECT method.

Parameters:
port - the port on the proxy host

toString

public String toString()
Returns a string representation of the object suitable for debugging.

Overrides:
toString in class Object
Returns:
a string representation of the object


Copyright © 1999-2004 Neil W. Weber. All Rights Reserved.