sqlg2.db
Class ConnectionFactory

java.lang.Object
  extended by java.rmi.server.RemoteObject
      extended by java.rmi.server.RemoteServer
          extended by java.rmi.server.UnicastRemoteObject
              extended by sqlg2.db.ConnectionFactory
All Implemented Interfaces:
java.io.Serializable, java.rmi.Remote, IConnectionFactory

public class ConnectionFactory
extends java.rmi.server.UnicastRemoteObject
implements IConnectionFactory

RMI wrapper for IConnectionFactory.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Fields inherited from interface sqlg2.db.IConnectionFactory
AUTH_BAD_APP, AUTH_BAD_PASS, AUTH_BAD_USER, AUTH_FAILED, DRIVER_NOT_FOUND
 
Constructor Summary
ConnectionFactory(AuthenticationHelper auth, DBSpecific specific)
          Constructor of the root object for RMI.
 
Method Summary
 SessionInfo[] getActiveSessions()
          Returns active sessions descriptors
 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.
 void setSqlTrace(SqlTrace trace)
           
 void shutdown()
          Server shutdown.
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConnectionFactory

public ConnectionFactory(AuthenticationHelper auth,
                         DBSpecific specific)
                  throws java.rmi.RemoteException
Constructor of the root object for RMI.

Parameters:
auth - authentication helper object. Cannot be null.
specific - database-specific object
Throws:
java.rmi.RemoteException
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

shutdown

public void shutdown()
Server shutdown.


setSqlTrace

public void setSqlTrace(SqlTrace trace)