com.webrenderer.se
Class ProxySetting

java.lang.Object
  extended by com.webrenderer.se.ProxySetting

public class ProxySetting
extends java.lang.Object

This holds the proxy settings for the given protocols. Supported protocols are given by the PROTOCOL_* flags. Users can use this class to pass proxy settings to Webrenderer, but also for Webrenderer to supply information back to the user.


Field Summary
protected  int port
          The port which the proxy server communicates on.
protected  int protocol
          Holds the protocol(s) defined by the PROTOCOL_* flags.
static int PROTOCOL_ALL
          Indicates the settings will affect all protocols.
static int PROTOCOL_FTP
          Indicates the settings will be used for the file transfer protcol.
static int PROTOCOL_GOPHER
          Indicates the settings will be used for the gopher protcol.
static int PROTOCOL_HTTP
          Indicates the settings will be used for the hypertext transfer protcol.
static int PROTOCOL_HTTPS
          Indicates the settings will be used for the secure hypertext transfer protcol.
static int PROTOCOL_SOCKS
          Indicates the settings will be used for the socks server protcol.
protected  java.lang.String server
          The URL of the proxy server.
 
Constructor Summary
ProxySetting()
          Constructor for ProxySetting.
ProxySetting(int protocol, java.lang.String server, int port)
          Constructor for ProxySetting with initial settings.
ProxySetting(ProxySetting proxy)
          Copy Constuctor for ProxySetting
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 int getPort()
          Gets the port number upon which the proxy server communicates.
 int getProtocol()
          Gets the protocols defined by the PROTOCOL_* flags.
 java.lang.String getServer()
          Returns the URL of the proxy server.
 void setPort(int port)
          Sets the port number the proxy server communicates on.
 void setProtocol(int protocol)
          Sets the protocols defined by the PROTOCOL_* flags.
 void setServer(java.lang.String server)
          Sets the URL of the proxy server.
 java.lang.String toString()
          Gets the proxy setting as a string.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROTOCOL_FTP

public static final int PROTOCOL_FTP
Indicates the settings will be used for the file transfer protcol.

See Also:
Constant Field Values

PROTOCOL_HTTP

public static final int PROTOCOL_HTTP
Indicates the settings will be used for the hypertext transfer protcol.

See Also:
Constant Field Values

PROTOCOL_HTTPS

public static final int PROTOCOL_HTTPS
Indicates the settings will be used for the secure hypertext transfer protcol.

See Also:
Constant Field Values

PROTOCOL_SOCKS

public static final int PROTOCOL_SOCKS
Indicates the settings will be used for the socks server protcol.

See Also:
Constant Field Values

PROTOCOL_GOPHER

public static final int PROTOCOL_GOPHER
Indicates the settings will be used for the gopher protcol.

See Also:
Constant Field Values

PROTOCOL_ALL

public static final int PROTOCOL_ALL
Indicates the settings will affect all protocols.

See Also:
Constant Field Values

protocol

protected int protocol
Holds the protocol(s) defined by the PROTOCOL_* flags.


server

protected java.lang.String server
The URL of the proxy server.


port

protected int port
The port which the proxy server communicates on.

Constructor Detail

ProxySetting

public ProxySetting()
Constructor for ProxySetting. The protocol, server, and port are not initialised.


ProxySetting

public ProxySetting(int protocol,
                    java.lang.String server,
                    int port)
Constructor for ProxySetting with initial settings.

Parameters:
protocol - Protocol(s), defined by PROTOCOL_* flags.
server - URL of the proxy server.
port - Port the proxy server uses.
See Also:
PROTOCOL_ALL, PROTOCOL_FTP, PROTOCOL_GOPHER, PROTOCOL_HTTP, PROTOCOL_HTTPS, PROTOCOL_SOCKS

ProxySetting

public ProxySetting(ProxySetting proxy)
Copy Constuctor for ProxySetting

Parameters:
proxy - A ProxySetting to copy
Method Detail

getPort

public int getPort()
Gets the port number upon which the proxy server communicates.

Returns:
Port number.

getProtocol

public int getProtocol()
Gets the protocols defined by the PROTOCOL_* flags.

Returns:
Protocols.
See Also:
PROTOCOL_ALL, PROTOCOL_FTP, PROTOCOL_GOPHER, PROTOCOL_HTTP, PROTOCOL_HTTPS, PROTOCOL_SOCKS

getServer

public java.lang.String getServer()
Returns the URL of the proxy server.

Returns:
Proxy server URL.

setPort

public void setPort(int port)
Sets the port number the proxy server communicates on.

Parameters:
port - Port number

setProtocol

public void setProtocol(int protocol)
Sets the protocols defined by the PROTOCOL_* flags.

Parameters:
protocol - Protocols.
See Also:
PROTOCOL_ALL, PROTOCOL_FTP, PROTOCOL_GOPHER, PROTOCOL_HTTP, PROTOCOL_HTTPS, PROTOCOL_SOCKS

setServer

public void setServer(java.lang.String server)
Sets the URL of the proxy server.

Parameters:
server - Proxy server URL.

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Gets the proxy setting as a string.

Overrides:
toString in class java.lang.Object
Returns:
Proxy setting as string in the format 'ProxySetting[ server, port, protocol:protocol ]'.