org.glite.security.delegation.storage
Class GrDPStorageDatabase

java.lang.Object
  extended by org.glite.security.delegation.storage.GrDPStorageDatabase
All Implemented Interfaces:
GrDPStorage

public class GrDPStorageDatabase
extends java.lang.Object
implements GrDPStorage

This is the database based implementation of the GrDPStorage interface.

It provides a database archival mechanism for delegated proxies related information.

Storage is separated into two different areas: storage cache and actual storage. The first one holds the temporary information during a delegation request, including the certificate request, the private key and the list of voms attributes expected in the proxy. The second holds the actual delegated proxy information, including the private key and list of voms attributes (as above) and the actual proxy.

Inside the database, there is one different table for each of the storage areas. Check the db schema file for details.

Authors: Ricardo Rocha


Constructor Summary
GrDPStorageDatabase(GrDProxyDlgeeOptions dlgeeOpt)
          Class constructor.
 
Method Summary
protected  void checkSchemaVersion(int major, int minor, int patch)
           
 void deleteGrDPStorageCacheElement(java.lang.String delegationID, java.lang.String dn)
          Deletes an existing delegation request.
 void deleteGrDPStorageElement(java.lang.String delegationID, java.lang.String dn)
          Deletes an existing delegated proxy.
 GrDPStorageCacheElement findGrDPStorageCacheElement(java.lang.String delegationID, java.lang.String dn)
          Retrieves an existing delegation request from the storage cache area.
 GrDPStorageElement findGrDPStorageElement(java.lang.String delegationID, java.lang.String dn)
          Retrieves an existing delegated proxy from the storage area.
 void insertGrDPStorageCacheElement(GrDPStorageCacheElement elem)
          Insert new delegation request into storage cache area.
 void insertGrDPStorageElement(GrDPStorageElement elem)
          Insert new delegated proxy into storage area.
 void updateGrDPStorageCacheElement(GrDPStorageCacheElement elem)
          Updates existing delegation request in storage cache area.
 void updateGrDPStorageElement(GrDPStorageElement elem)
          Updates existing delegated proxy information in storage area.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GrDPStorageDatabase

public GrDPStorageDatabase(GrDProxyDlgeeOptions dlgeeOpt)
                    throws GrDPStorageException
Class constructor.

Throws:
GrDPStorageException
Method Detail

checkSchemaVersion

protected void checkSchemaVersion(int major,
                                  int minor,
                                  int patch)
                           throws GrDPStorageException
Throws:
GrDPStorageException

insertGrDPStorageCacheElement

public void insertGrDPStorageCacheElement(GrDPStorageCacheElement elem)
                                   throws GrDPStorageException
Insert new delegation request into storage cache area.

Specified by:
insertGrDPStorageCacheElement in interface GrDPStorage
Parameters:
elem - Object containing the information about the delegation request.
Throws:
GrDPStorageException - Failed to store new delegation request in storage cache area.

updateGrDPStorageCacheElement

public void updateGrDPStorageCacheElement(GrDPStorageCacheElement elem)
                                   throws GrDPStorageException
Updates existing delegation request in storage cache area.

Specified by:
updateGrDPStorageCacheElement in interface GrDPStorage
Parameters:
elem - Object containing the information about the delegation request.
Throws:
GrDPStorageException - Failed to storage new delegation request in storage cache area.

findGrDPStorageCacheElement

public GrDPStorageCacheElement findGrDPStorageCacheElement(java.lang.String delegationID,
                                                           java.lang.String dn)
                                                    throws GrDPStorageException
Retrieves an existing delegation request from the storage cache area.

Specified by:
findGrDPStorageCacheElement in interface GrDPStorage
Parameters:
delegationID - The id of the delegation request to be returned.
dn - The dn of the user owning the delegation request.
Returns:
The object containing the information on the delegation request.
Throws:
GrDPStorageException - Could not retrieve a delegation request because either it does not exist or an error occured while tried to access it.

deleteGrDPStorageCacheElement

public void deleteGrDPStorageCacheElement(java.lang.String delegationID,
                                          java.lang.String dn)
                                   throws GrDPStorageException
Deletes an existing delegation request.

Specified by:
deleteGrDPStorageCacheElement in interface GrDPStorage
Parameters:
delegationID - The id of the delegation request to be deleted.
dn - The dn of the owner of the delegation request.
Throws:
GrDPStorageException - Failed to delete the delegation request as either it does not exist or could not be accessed.

insertGrDPStorageElement

public void insertGrDPStorageElement(GrDPStorageElement elem)
                              throws GrDPStorageException
Insert new delegated proxy into storage area.

Specified by:
insertGrDPStorageElement in interface GrDPStorage
Parameters:
elem - Object containing the information about the delegation proxy.
Throws:
GrDPStorageException - Failed to storage new delegation proxy in storage area.

updateGrDPStorageElement

public void updateGrDPStorageElement(GrDPStorageElement elem)
                              throws GrDPStorageException
Updates existing delegated proxy information in storage area.

Specified by:
updateGrDPStorageElement in interface GrDPStorage
Parameters:
elem - Object containing the information about the delegated proxy.
Throws:
GrDPStorageException - Failed to store new delegated proxy in storage area.

findGrDPStorageElement

public GrDPStorageElement findGrDPStorageElement(java.lang.String delegationID,
                                                 java.lang.String dn)
                                          throws GrDPStorageException
Retrieves an existing delegated proxy from the storage area.

Specified by:
findGrDPStorageElement in interface GrDPStorage
Parameters:
delegationID - The id of the delegated proxy to be returned.
dn - The dn of the user owning the delegated proxy.
Returns:
The object containing the information on the delegated proxy.
Throws:
GrDPStorageException - Could not retrieve a delegated proxy because either it does not exist or an error occured while tried to access it.

deleteGrDPStorageElement

public void deleteGrDPStorageElement(java.lang.String delegationID,
                                     java.lang.String dn)
                              throws GrDPStorageException
Deletes an existing delegated proxy.

Specified by:
deleteGrDPStorageElement in interface GrDPStorage
Parameters:
delegationID - The id of the delegated proxy to be deleted.
dn - The dn of the owner of the delegated proxy.
Throws:
GrDPStorageException - Failed to delete the delegated proxy as either it does not exist or could not be accessed.


Copyright © 2004-2008. EU-EGEE