org.edg.security.delegation
Class DelegationStorageMap

java.lang.Object
  |
  +--org.edg.security.delegation.DelegationStorageMap
All Implemented Interfaces:
DelegationsEventListener, DelegationStorage, DelegationStorageService, java.util.EventListener

public class DelegationStorageMap
extends java.lang.Object
implements DelegationStorage, DelegationsEventListener

The memory (hashtable) implementation of the delegation storage


Constructor Summary
DelegationStorageMap()
          Constructor for creating a new DelegationStorageMap
 
Method Summary
 void DelegationsEventOccurred(DelegationsEvent evt)
          Called by DelegationStorageCleaner Thread whenever there is a need to remove all expired delegations and requests.
 DelegationItem getDelegation(java.lang.String delegationId, java.security.cert.X509Certificate[] clientCertChain)
          Get delegation that corresponds to given delegationId and clientCertChain
 java.util.Collection getDelegations(java.security.cert.X509Certificate[] clientCertChain)
          Returns a collection containing all the DelegationStorageItems matching the certificate chain(i.e. client cert's DN) given as the parameter.
 DelegationRequestItem getRequest(java.lang.String delegationId)
          Returns the request item corresponding the id.
 void putDelegation(DelegationStorageItem delegation)
          Stores delegations into this container class.
 void putRequest(DelegationRequestItem request)
          Store a new delegation request into this container class.
 DelegationRequestItem removeRequest(java.lang.String delegationId)
          Removes and returns the DelegationRequestItem matching the given id from the map.
 void start()
          Starts a timer task that checks the validity of delegations and delegation requests at regular time intervals.
 void stop()
          Stops the timer task, see start().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DelegationStorageMap

public DelegationStorageMap()
Constructor for creating a new DelegationStorageMap

Method Detail

getDelegation

public DelegationItem getDelegation(java.lang.String delegationId,
                                    java.security.cert.X509Certificate[] clientCertChain)
Get delegation that corresponds to given delegationId and clientCertChain

Specified by:
getDelegation in interface DelegationStorageService
Parameters:
delegationId -
clientCertChain -
Returns:
DelegationItem

putRequest

public void putRequest(DelegationRequestItem request)
Store a new delegation request into this container class.

Specified by:
putRequest in interface DelegationStorage
Parameters:
request - DelegationRequestItem to be stored

getRequest

public DelegationRequestItem getRequest(java.lang.String delegationId)
Returns the request item corresponding the id.

Specified by:
getRequest in interface DelegationStorage
Parameters:
delegationId - Id of the DelegationRequestItem to be returned.
Returns:
DelegationRequestItem that was found.

removeRequest

public DelegationRequestItem removeRequest(java.lang.String delegationId)
Removes and returns the DelegationRequestItem matching the given id from the map.

Specified by:
removeRequest in interface DelegationStorage
Parameters:
delegationId - Id of the DelegationRequestItem to be deleted.
Returns:
DelegationRequestItem that was deleted.

getDelegations

public java.util.Collection getDelegations(java.security.cert.X509Certificate[] clientCertChain)
Returns a collection containing all the DelegationStorageItems matching the certificate chain(i.e. client cert's DN) given as the parameter.

Specified by:
getDelegations in interface DelegationStorage
Parameters:
clientCertChain -
Returns:
Collection containing all the matching DelegationStorageItems

putDelegation

public void putDelegation(DelegationStorageItem delegation)
Stores delegations into this container class.

Specified by:
putDelegation in interface DelegationStorage
Parameters:
delegation - - the DelegationStorageItem to be stored.

start

public void start()
Starts a timer task that checks the validity of delegations and delegation requests at regular time intervals.

Specified by:
start in interface DelegationStorage

stop

public void stop()
Stops the timer task, see start().

Specified by:
stop in interface DelegationStorage

DelegationsEventOccurred

public void DelegationsEventOccurred(DelegationsEvent evt)
Called by DelegationStorageCleaner Thread whenever there is a need to remove all expired delegations and requests.

Specified by:
DelegationsEventOccurred in interface DelegationsEventListener
Parameters:
evt - DelegationsEvent