sqlg2.db
Class DBInterface

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.DBInterface
All Implemented Interfaces:
java.io.Serializable, java.rmi.Remote, IDBInterface

public class DBInterface
extends java.rmi.server.UnicastRemoteObject
implements IDBInterface

RMI wrapper for IDBInterface.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
DBInterface(sqlg2.db.LocalDBInterface lw)
           
 
Method Summary
 void close()
          Closes DB connection.
 SessionInfo[] getActiveSessions()
          Returns active sessions descriptors.
 SessionInfo getCurrentSession()
          Returns calling session descriptor
 ISimpleTransaction getSimpleTransaction()
          Creates "simple" transaction.
 ITransaction getTransaction()
          Creates transaction.
 java.lang.String getUserHost()
          User host name.
 java.lang.String getUserLogin()
          Returns user login (which was passed to IConnectionFactory.openConnection(java.lang.String, java.lang.String)).
 java.lang.Object getUserObject()
          Returns user identifier object which was returned from AuthenticationHelper.authenticate(java.sql.Connection,String,String) (null in case of direct authentication).
 void killSession(long sessionId)
           
 IDBInterface migrateTo(IConnectionFactory conf)
          Opens new DB connection to another application with same login and password.
 void ping()
          Checks server for availability and signal that client is alive.
 void runProcess(ProcessFactory factory)
          Creates background process on the server.
 
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

DBInterface

public DBInterface(sqlg2.db.LocalDBInterface lw)
            throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException
Method Detail

getSimpleTransaction

public ISimpleTransaction getSimpleTransaction()
                                        throws java.rmi.RemoteException
Description copied from interface: IDBInterface
Creates "simple" transaction.

Specified by:
getSimpleTransaction in interface IDBInterface
Throws:
java.rmi.RemoteException
See Also:
ISimpleTransaction

getTransaction

public ITransaction getTransaction()
                            throws java.rmi.RemoteException
Description copied from interface: IDBInterface
Creates transaction.

Specified by:
getTransaction in interface IDBInterface
Throws:
java.rmi.RemoteException
See Also:
ITransaction

ping

public void ping()
          throws java.rmi.RemoteException
Description copied from interface: IDBInterface
Checks server for availability and signal that client is alive.

Specified by:
ping in interface IDBInterface
Throws:
java.rmi.RemoteException

close

public void close()
           throws java.rmi.RemoteException
Description copied from interface: IDBInterface
Closes DB connection.

Specified by:
close in interface IDBInterface
Throws:
java.rmi.RemoteException

getUserLogin

public java.lang.String getUserLogin()
                              throws java.rmi.RemoteException
Description copied from interface: IDBInterface
Returns user login (which was passed to IConnectionFactory.openConnection(java.lang.String, java.lang.String)).

Specified by:
getUserLogin in interface IDBInterface
Returns:
user login
Throws:
java.rmi.RemoteException

getUserHost

public java.lang.String getUserHost()
                             throws java.rmi.RemoteException
Description copied from interface: IDBInterface
User host name.

Specified by:
getUserHost in interface IDBInterface
Returns:
host name
Throws:
java.rmi.RemoteException

getUserObject

public java.lang.Object getUserObject()
                               throws java.rmi.RemoteException
Description copied from interface: IDBInterface
Returns user identifier object which was returned from AuthenticationHelper.authenticate(java.sql.Connection,String,String) (null in case of direct authentication).

Specified by:
getUserObject in interface IDBInterface
Throws:
java.rmi.RemoteException

getActiveSessions

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

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

killSession

public void killSession(long sessionId)
                 throws java.rmi.RemoteException
Specified by:
killSession in interface IDBInterface
Throws:
java.rmi.RemoteException

getCurrentSession

public SessionInfo getCurrentSession()
                              throws java.rmi.RemoteException
Description copied from interface: IDBInterface
Returns calling session descriptor

Specified by:
getCurrentSession in interface IDBInterface
Throws:
java.rmi.RemoteException

migrateTo

public IDBInterface migrateTo(IConnectionFactory conf)
                       throws java.rmi.RemoteException,
                              java.sql.SQLException
Description copied from interface: IDBInterface
Opens new DB connection to another application with same login and password.

Specified by:
migrateTo in interface IDBInterface
Parameters:
conf - root object of application
Returns:
new DB connection
Throws:
java.rmi.RemoteException
java.sql.SQLException

runProcess

public void runProcess(ProcessFactory factory)
                throws java.rmi.RemoteException,
                       java.sql.SQLException
Description copied from interface: IDBInterface
Creates background process on the server.

Specified by:
runProcess in interface IDBInterface
Parameters:
factory - process factory
Throws:
java.rmi.RemoteException
java.sql.SQLException