sqlg2.db.client
Class HttpConnectionFactory

java.lang.Object
  extended by sqlg2.db.client.HttpConnectionFactory
All Implemented Interfaces:
java.io.Serializable, java.rmi.Remote, IConnectionFactory

public final class HttpConnectionFactory
extends java.lang.Object
implements IConnectionFactory

See Also:
Serialized Form

Field Summary
protected  HttpId id
           
 
Fields inherited from interface sqlg2.db.IConnectionFactory
AUTH_BAD_APP, AUTH_BAD_PASS, AUTH_BAD_USER, AUTH_FAILED, DRIVER_NOT_FOUND
 
Constructor Summary
HttpConnectionFactory(java.lang.String url, java.net.Proxy proxy, java.lang.String application)
           
 
Method Summary
 SessionInfo[] getActiveSessions()
          Returns active sessions descriptors
protected  sqlg2.db.client.Endpoint getEndpoint()
           
 java.net.URL getUrl()
           
protected  java.lang.Object httpInvoke(HttpCommand command, java.lang.Class<?> iface, java.lang.String method, java.lang.Class<?>[] paramTypes, java.lang.Object[] params)
           
protected  java.lang.Object httpInvoke(HttpCommand command, java.lang.Object... params)
           
 IDBInterface openConnection(IDBInterface oldConnection, java.lang.String password)
          This method is rarely used directly, it is intended for use by IDBInterface.migrateTo(IConnectionFactory).
 IDBInterface openConnection(java.lang.String user, java.lang.String password)
          Connecting to DB using external authentication (server must support that) - connection properties are taken from AuthenticationHelper.
protected  void setEndpoint(sqlg2.db.client.Endpoint endpoint)
           
protected  void setEndpoint(sqlg2.db.client.HttpProxy root)
           
 void setEndpoint(java.net.URL url, java.net.Proxy proxy)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

protected final HttpId id
Constructor Detail

HttpConnectionFactory

public HttpConnectionFactory(java.lang.String url,
                             java.net.Proxy proxy,
                             java.lang.String application)
                      throws java.net.URISyntaxException,
                             java.net.MalformedURLException
Throws:
java.net.URISyntaxException
java.net.MalformedURLException
Method Detail

openConnection

public IDBInterface openConnection(java.lang.String user,
                                   java.lang.String password)
                            throws java.rmi.RemoteException,
                                   java.sql.SQLException
Description copied from interface: IConnectionFactory
Connecting to DB using external authentication (server must support that) - connection properties are taken from AuthenticationHelper. Given parameters are passed to AuthenticationHelper.authenticate(java.sql.Connection,String,String).

Specified by:
openConnection in interface IConnectionFactory
Parameters:
user - external user
password - external password
Returns:
DB connection
Throws:
java.rmi.RemoteException
java.sql.SQLException

openConnection

public IDBInterface openConnection(IDBInterface oldConnection,
                                   java.lang.String password)
                            throws java.rmi.RemoteException,
                                   java.sql.SQLException
Description copied from interface: IConnectionFactory
This method is rarely used directly, it is intended for use by IDBInterface.migrateTo(IConnectionFactory).

Specified by:
openConnection in interface IConnectionFactory
Parameters:
oldConnection - already opened DB connection
password - user password
Returns:
new DB connection
Throws:
java.rmi.RemoteException
java.sql.SQLException

getActiveSessions

public SessionInfo[] getActiveSessions()
                                throws java.rmi.RemoteException
Description copied from interface: IConnectionFactory
Returns active sessions descriptors

Specified by:
getActiveSessions in interface IConnectionFactory
Throws:
java.rmi.RemoteException

getUrl

public java.net.URL getUrl()

setEndpoint

protected final void setEndpoint(sqlg2.db.client.HttpProxy root)

setEndpoint

protected final void setEndpoint(sqlg2.db.client.Endpoint endpoint)

setEndpoint

public final void setEndpoint(java.net.URL url,
                              java.net.Proxy proxy)

httpInvoke

protected final java.lang.Object httpInvoke(HttpCommand command,
                                            java.lang.Object... params)
                                     throws java.lang.Throwable
Throws:
java.lang.Throwable

getEndpoint

protected final sqlg2.db.client.Endpoint getEndpoint()

httpInvoke

protected final java.lang.Object httpInvoke(HttpCommand command,
                                            java.lang.Class<?> iface,
                                            java.lang.String method,
                                            java.lang.Class<?>[] paramTypes,
                                            java.lang.Object[] params)
                                     throws java.lang.Throwable
Throws:
java.lang.Throwable