org.edg.security.voms.database
Class DBAdmin

java.lang.Object
  |
  +--org.edg.security.voms.database.DBAdmin

public final class DBAdmin
extends java.lang.Object

A class representing VO administrators. Essentially, a wrapper class for the admin table.

Version:
$Name: v0_7_0 $
Author:
Karoly Lorentey

Field Summary
private  int ca
          Issuer certificate authority.
private  long createdBy
          The id of the client who created this administrator.
private  long createdSerial
          The number of the transaction that created this administrator.
private  java.lang.String dn
          The distinguished name of this administrator.
private static int DN
           
private  long id
          The internal id of this administrator.
private static int ID
           
private static org.apache.log4j.Logger log
          Logger.
(package private) static Sequence seq
          Seqence.
 
Constructor Summary
private DBAdmin(long id)
           
private DBAdmin(java.lang.String dn, DBCA ca)
           
 
Method Summary
static DBAdmin createAdmin(java.lang.String dn, DBCA ca)
           
 DBUser getAsDBUser()
           
 User getAsUser()
          Return this as a User.
 DBCA getCA()
           
 java.lang.String getCADN()
          Returns the name of this admin's CA, if present (convenience method).
 int getCAId()
           
 DBAdmin getCreatedBy()
           
 long getCreatedById()
           
 long getCreatedSerial()
           
 java.lang.String getDN()
           
 long getId()
           
static DBAdmin getInstance(long id)
           
static DBAdmin getInstance(java.lang.String name, DBCA ca)
           
static DBAdmin getInstanceFromAttribute(java.lang.String attribute)
           
static DBAdmin getInstanceFromCapability(java.lang.String groupname, java.lang.String rolename, java.lang.String capability)
           
static DBAdmin getInstanceFromGroup(java.lang.String groupname)
           
static DBAdmin getInstanceFromRole(QualifiedRole role)
           
private  void initialize(int from)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

private static org.apache.log4j.Logger log
Logger.


dn

private java.lang.String dn
The distinguished name of this administrator.


id

private long id
The internal id of this administrator.


ca

private int ca
Issuer certificate authority.


createdBy

private long createdBy
The id of the client who created this administrator.


createdSerial

private long createdSerial
The number of the transaction that created this administrator.


seq

static final Sequence seq
Seqence.


DN

private static final int DN
See Also:
Constant Field Values

ID

private static final int ID
See Also:
Constant Field Values
Constructor Detail

DBAdmin

private DBAdmin(java.lang.String dn,
                DBCA ca)
         throws GeneralDatabaseException,
                NotInDatabase,
                ArgumentException

DBAdmin

private DBAdmin(long id)
         throws GeneralDatabaseException,
                NotInDatabase
Method Detail

initialize

private void initialize(int from)
                 throws GeneralDatabaseException,
                        NotInDatabase
GeneralDatabaseException
NotInDatabase

getInstance

public static DBAdmin getInstance(java.lang.String name,
                                  DBCA ca)
                           throws GeneralDatabaseException,
                                  NotInDatabase,
                                  ArgumentException
GeneralDatabaseException
NotInDatabase
ArgumentException

getInstance

public static DBAdmin getInstance(long id)
                           throws GeneralDatabaseException,
                                  NotInDatabase
GeneralDatabaseException
NotInDatabase

getInstanceFromAttribute

public static DBAdmin getInstanceFromAttribute(java.lang.String attribute)
                                        throws GeneralDatabaseException,
                                               NotInDatabase,
                                               ArgumentException
GeneralDatabaseException
NotInDatabase
ArgumentException

getInstanceFromGroup

public static DBAdmin getInstanceFromGroup(java.lang.String groupname)
                                    throws GeneralDatabaseException,
                                           NotInDatabase,
                                           ArgumentException
GeneralDatabaseException
NotInDatabase
ArgumentException

getInstanceFromRole

public static DBAdmin getInstanceFromRole(QualifiedRole role)
                                   throws GeneralDatabaseException,
                                          NotInDatabase,
                                          ArgumentException
GeneralDatabaseException
NotInDatabase
ArgumentException

getInstanceFromCapability

public static DBAdmin getInstanceFromCapability(java.lang.String groupname,
                                                java.lang.String rolename,
                                                java.lang.String capability)
                                         throws DatabaseError,
                                                NotInDatabase,
                                                InconsistentDatabase,
                                                ArgumentException
DatabaseError
NotInDatabase
InconsistentDatabase
ArgumentException

getId

public long getId()

getCAId

public int getCAId()
Returns:
-1 if there is no CA associated with this admin.

getDN

public java.lang.String getDN()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getCreatedById

public long getCreatedById()

getCreatedSerial

public long getCreatedSerial()

getCA

public DBCA getCA()
           throws GeneralDatabaseException
Returns:
null if there is no CA associated with this administrator.
GeneralDatabaseException

getCreatedBy

public DBAdmin getCreatedBy()
                     throws GeneralDatabaseException,
                            NotInDatabase
GeneralDatabaseException
NotInDatabase

getCADN

public java.lang.String getCADN()
                         throws GeneralDatabaseException
Returns the name of this admin's CA, if present (convenience method).

Returns:
null if this admin has no CA
GeneralDatabaseException

createAdmin

public static DBAdmin createAdmin(java.lang.String dn,
                                  DBCA ca)
                           throws ArgumentException,
                                  GeneralDatabaseException
ArgumentException
GeneralDatabaseException

getAsUser

public User getAsUser()
               throws GeneralDatabaseException,
                      NotInDatabase
Return this as a User.

GeneralDatabaseException
NotInDatabase

getAsDBUser

public DBUser getAsDBUser()
                   throws GeneralDatabaseException,
                          NotInDatabase
GeneralDatabaseException
NotInDatabase