Awake SQL v1.2.1

org.awakefw.commons.api.client
Class HttpProxy

java.lang.Object
  extended by org.awakefw.commons.api.client.HttpProxy

public final class HttpProxy
extends Object

Allows to define a proxy with or without authentication. All is done through constructor, because instance should be immutable:

 String url = "https://www.acme.org/AwakeFileManager";
 String username = "myUsername";
 char[] password = { 'm', 'y', 'P', 'a', 's', 's', 'w', 'o', 'r', 'd' };
 
 HttpProxy httpProxy = null;
  
 // Constructor to use if http proxy is without authentication:
 httpProxy = new HttpProxy("myProxyhost", 8080);
  
 // Constructor to use if http proxy requires authentication:
 httpProxy = new HttpProxy("myProxyhost", 8080, "username", "password");
  
 // Constructor to use if http proxy is a NTLM proxy:
 httpProxy = new HttpProxy("myProxyhost", 8080, "username", "password",
        "myWorkstation", "myDomain");
  
 // Open an Awake File Session through a proxy:
 AwakeFileSession awakeFileSession = new AwakeFileSession(url, username,
        password, httpProxy);
  
 // Etc.
 

Since:
1.0

Constructor Summary
HttpProxy(String address, int port)
          Constructor to use to define a proxy that does not requires authentication.
HttpProxy(String address, int port, String username, String password)
          Constructor to use to define a proxy that requires authentication
HttpProxy(String address, int port, String username, String password, String workstation, String domain)
          Constructor to use to define a Microsoft NTLM proxy that requires authentication.
 
Method Summary
 String getAddress()
          Returns the address of the proxy.
 String getDomain()
          Returns the NTLM domain parameter.
 String getPassword()
          Returns the password.
 int getPort()
          Returns the port of the proxy.
 String getUsername()
          Returns the username required for authentication.
 String getWorkstation()
          Returns the NTLM workstation parameter.
 String toString()
          Returns a clean representation of the HttpProxy instance.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HttpProxy

public HttpProxy(String address,
                 int port)
Constructor to use to define a proxy that does not requires authentication.

Parameters:
address - the proxy address
port - the proxy port
Throws:
IllegalArgumentException - if address is null

HttpProxy

public HttpProxy(String address,
                 int port,
                 String username,
                 String password)
Constructor to use to define a proxy that requires authentication

Parameters:
address - the proxy address
port - the proxy port
username - the username required for authentication
password - the password for authentication (maybe null if no password is required)
Throws:
IllegalArgumentException - if address or username is null

HttpProxy

public HttpProxy(String address,
                 int port,
                 String username,
                 String password,
                 String workstation,
                 String domain)
Constructor to use to define a Microsoft NTLM proxy that requires authentication.

Parameters:
address - the NTLM proxy address
port - the NTLM proxy port
username - the username required for authentication
password - the password for authentication (maybe null if no password is required)
workstation - the NTLM workstation parameter
domain - the NTLM domain parameter
Throws:
IllegalArgumentException - if address or username is null
Method Detail

getAddress

public String getAddress()
Returns the address of the proxy.

Returns:
the address of the proxy

getDomain

public String getDomain()
Returns the NTLM domain parameter.

Returns:
the NTLM domain parameter

getPassword

public String getPassword()
Returns the password. (null if no authentication is required or if no password is required for authentication).

Returns:
the password

getPort

public int getPort()
Returns the port of the proxy.

Returns:
the port of the proxy

getUsername

public String getUsername()
Returns the username required for authentication. (null if no authentication is required).

Returns:
the username required for authentication

getWorkstation

public String getWorkstation()
Returns the NTLM workstation parameter.

Returns:
the NTLM workstation parameter

toString

public String toString()
Returns a clean representation of the HttpProxy instance.

Overrides:
toString in class Object
Returns:
a clean representation of the HttpProxy instance

Awake SQL v1.2.1

Awake SQL - Virtual JDBC Driver over HTTP for Android, Swing and JavaFX
Android & Desktop Edition allow easy access to majors remote SQL databases with regular JDBC calls:
DB2 - H2 - HSQLDB (HyperSQL) - Informix - Ingres - MySQL - Oracle - PostgreSQL - SQL Server - Sybase - Teradata
Copyright © 2012 Kawan Softwares SAS