org.glite.security.voms.database.connection
Class ClientTransaction

java.lang.Object
  extended byorg.glite.security.voms.database.connection.Transaction
      extended byorg.glite.security.voms.database.connection.ClientTransaction
Direct Known Subclasses:
Query, Update

public abstract class ClientTransaction
extends Transaction

Database connection wrapper for connections that have an associated a remote client that needs to be logged. The connection will have a DBAdmin instance bound to it that you can get with the getClient() method.

Author:
Karoly Lorentey

Field Summary
 
Fields inherited from class org.glite.security.voms.database.connection.Transaction
conn
 
Constructor Summary
protected ClientTransaction(java.sql.Connection conn)
          Protected constructor.
 
Method Summary
 DBAdmin getClient()
          Return the DBAdmin instance corresponding to the client of this connection.
protected  DBCA getClientCA()
          Return the client's CA.
protected  java.lang.String getClientDN()
          Return the client's DN.
 long getClientId()
          Return the id of the DBAdmin instance corresponding to the client of this connection.
protected  void setClient(DBAdmin client)
          Set the client to the given admin.
 
Methods inherited from class org.glite.security.voms.database.connection.Transaction
getConnection, getStatement, getStatementCount, isReadOnly
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientTransaction

protected ClientTransaction(java.sql.Connection conn)
                     throws VOMSException
Protected constructor.

Method Detail

getClientDN

protected final java.lang.String getClientDN()
Return the client's DN. Used to set up the admin instance in derived classes.


getClientCA

protected final DBCA getClientCA()
Return the client's CA. Used to set up the admin instance in derived classes.


getClient

public final DBAdmin getClient()
Return the DBAdmin instance corresponding to the client of this connection.


setClient

protected final void setClient(DBAdmin client)
                        throws GeneralDatabaseException
Set the client to the given admin.

Throws:
GeneralDatabaseException

getClientId

public final long getClientId()
Return the id of the DBAdmin instance corresponding to the client of this connection. Please use getClient() instead of this method whenever possible. Returns -1 if the client is not available.