org.walluck.net
Class ProxyConnection

java.lang.Object
  extended byorg.walluck.net.ProxyConnection

public class ProxyConnection
extends java.lang.Object

Handles proxy support.

Since:
1.0
Version:
1.0
Author:
David Walluck

Field Summary
static int PROXY_TYPE_HTTP
          HTTP or HTTPS proxy.
static int PROXY_TYPE_SOCKS4
          SOCKS4 proxy.
static int PROXY_TYPE_SOCKS5
          SOCKS5 proxy.
 
Constructor Summary
ProxyConnection()
          Creates a new proxy connection.
 
Method Summary
 void connect(java.lang.String host, int port)
          Connect to the proxy.
 java.lang.String getPassword()
          Get the value of password.
 java.lang.String getProxyHost()
          Get the value of proxyHost.
 int getProxyPort()
          Get the value of proxyPort.
 java.net.Socket getSocket()
          Get the value of socket.
 int getType()
          Get the value of type.
 java.net.URLConnection getURLConnection()
          Get the value of uc.
 java.lang.String getUser()
          Get the value of user.
 void setPassword(java.lang.String password)
          Set the value of password.
 void setProxyHost(java.lang.String proxyHost)
          Set the value of proxyHost.
 void setProxyPort(int proxyPort)
          Set the vlaue of proxyPort.
 void setType(int type)
          Set the value of type.
 void setUseJavaInternal(boolean useJavaInternal)
          Set the value of useJavaInternal.
 void setUser(java.lang.String user)
          Set the value of user.
 boolean useJavaInternal()
          Get the value of useJavaInternal.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROXY_TYPE_SOCKS4

public static final int PROXY_TYPE_SOCKS4
SOCKS4 proxy.

See Also:
Constant Field Values

PROXY_TYPE_SOCKS5

public static final int PROXY_TYPE_SOCKS5
SOCKS5 proxy.

See Also:
Constant Field Values

PROXY_TYPE_HTTP

public static final int PROXY_TYPE_HTTP
HTTP or HTTPS proxy.

See Also:
Constant Field Values
Constructor Detail

ProxyConnection

public ProxyConnection()
Creates a new proxy connection.

Method Detail

connect

public void connect(java.lang.String host,
                    int port)
             throws java.io.IOException
Connect to the proxy.

Parameters:
host - the proxy host
port - the proxy port
Throws:
java.io.IOException - if an error occurs

getType

public int getType()
Get the value of type.

Returns:
value of type

setType

public void setType(int type)
Set the value of type.

Parameters:
type - Value to assign to type

getUser

public java.lang.String getUser()
Get the value of user.

Returns:
value of user.

setUser

public void setUser(java.lang.String user)
Set the value of user.

Parameters:
user - Value to assign to user.

getPassword

public java.lang.String getPassword()
Get the value of password.

Returns:
value of password.

setPassword

public void setPassword(java.lang.String password)
Set the value of password.

Parameters:
password - Value to assign to password.

useJavaInternal

public boolean useJavaInternal()
Get the value of useJavaInternal.

Returns:
value of useJavaInternal.

setUseJavaInternal

public void setUseJavaInternal(boolean useJavaInternal)
Set the value of useJavaInternal.

Parameters:
useJavaInternal - Value to assign to useJavaInternal.

getProxyHost

public java.lang.String getProxyHost()
Get the value of proxyHost.

Returns:
value of proxyHost.

setProxyHost

public void setProxyHost(java.lang.String proxyHost)
Set the value of proxyHost.

Parameters:
proxyHost - Value to assign to proxyHost.

getProxyPort

public int getProxyPort()
Get the value of proxyPort.

Returns:
value of proxyPort.

setProxyPort

public void setProxyPort(int proxyPort)
Set the vlaue of proxyPort.

Parameters:
proxyPort - Value to assign to proxyPort.

getSocket

public java.net.Socket getSocket()
Get the value of socket.

Returns:
value of socket.

getURLConnection

public java.net.URLConnection getURLConnection()
Get the value of uc.

Returns:
value of uc.