org.glite.security.voms.database
Class DBCA

java.lang.Object
  extended byorg.glite.security.voms.database.DBCA

public final class DBCA
extends java.lang.Object

A class representing known certificate authorities in a VO. Essentially, a wrapper class for the ca table.

This class is somewhat special in that its methods may be used with both ClientTransactions and DirectUpdates.

Author:
Karoly Lorentey, Akos Frohner

Method Summary
static int countCAs()
           
 long countUsers()
          Return the number of users that have certificates issued by this CA.
static DBCA create(Transaction t, java.lang.String name, java.lang.String dsc)
          Inserts a record into the database.
 boolean equals(java.lang.Object o)
           
static java.lang.String[] getCAs()
          Get the names of all CAs.
 java.lang.String getDescription()
           
 java.lang.String getDN()
          Return the name of this CA.
static DBCA getInstance(java.lang.String name)
           
static DBCA getInstance(Transaction t, java.lang.String name)
          Returns a DBCA object representing the named CA.
static void loadAllCAs(Transaction t)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

loadAllCAs

public static void loadAllCAs(Transaction t)
                       throws GeneralDatabaseException
Throws:
GeneralDatabaseException

getInstance

public static DBCA getInstance(Transaction t,
                               java.lang.String name)
                        throws GeneralDatabaseException,
                               NotInDatabase
Returns a DBCA object representing the named CA.

Parameters:
name - The fully qualified name of the CA.
Returns:
The DBCA instance representing the named CA.
Throws:
NotInDatabase - If the given CA is not accepted in this VO.
GeneralDatabaseException

getInstance

public static DBCA getInstance(java.lang.String name)
                        throws GeneralDatabaseException,
                               NotInDatabase
Throws:
GeneralDatabaseException
NotInDatabase

getDN

public java.lang.String getDN()
Return the name of this CA.


getDescription

public java.lang.String getDescription()

toString

public java.lang.String toString()

equals

public boolean equals(java.lang.Object o)

countUsers

public long countUsers()
                throws GeneralDatabaseException
Return the number of users that have certificates issued by this CA.

Throws:
GeneralDatabaseException

create

public static DBCA create(Transaction t,
                          java.lang.String name,
                          java.lang.String dsc)
                   throws ArgumentException,
                          GeneralDatabaseException
Inserts a record into the database.

Parameters:
name - The distinguished name of the new CA.
dsc - A textual description of the CA.
Returns:
the newly created CA object.
Throws:
ArgumentException
GeneralDatabaseException

getCAs

public static java.lang.String[] getCAs()
                                 throws GeneralDatabaseException
Get the names of all CAs.

Returns:
The names of the CAs.
Throws:
GeneralDatabaseException

countCAs

public static int countCAs()
                    throws GeneralDatabaseException
Throws:
GeneralDatabaseException