org.jasig.cas.client.proxy
Class ProxyGrantingTicketStorageImpl

java.lang.Object
  extended by org.jasig.cas.client.proxy.ProxyGrantingTicketStorageImpl
All Implemented Interfaces:
ProxyGrantingTicketStorage

public final class ProxyGrantingTicketStorageImpl
extends java.lang.Object
implements ProxyGrantingTicketStorage

Implementation of ProxyGrantingTicketStorage that is backed by a HashMap that keeps a ProxyGrantingTicket for a specified amount of time.

ProxyGrantingTicketStorage.cleanUp() must be called on a regular basis to keep the HashMap from growing indefinitely.

Since:
3.0
Version:
$Revision: 11729 $ $Date: 2007-09-26 14:22:30 -0400 (Tue, 26 Sep 2007) $
Author:
Scott Battaglia, Brad Cupit (brad [at] lsu {dot} edu)

Constructor Summary
ProxyGrantingTicketStorageImpl()
          Constructor set the timeout to the default value.
ProxyGrantingTicketStorageImpl(long timeout)
          Sets the amount of time to hold on to a ProxyGrantingTicket if its never been retrieved.
 
Method Summary
 void cleanUp()
          Cleans up old, expired proxy tickets.
 java.lang.String retrieve(java.lang.String proxyGrantingTicketIou)
          NOTE: you can only retrieve a ProxyGrantingTicket once with this method.
 void save(java.lang.String proxyGrantingTicketIou, java.lang.String proxyGrantingTicket)
          Method to save the ProxyGrantingTicket to the backing storage facility.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProxyGrantingTicketStorageImpl

public ProxyGrantingTicketStorageImpl()
Constructor set the timeout to the default value.


ProxyGrantingTicketStorageImpl

public ProxyGrantingTicketStorageImpl(long timeout)
Sets the amount of time to hold on to a ProxyGrantingTicket if its never been retrieved.

Parameters:
timeout - the time to hold on to the ProxyGrantingTicket
Method Detail

retrieve

public java.lang.String retrieve(java.lang.String proxyGrantingTicketIou)
NOTE: you can only retrieve a ProxyGrantingTicket once with this method. Its removed after retrieval.

Specified by:
retrieve in interface ProxyGrantingTicketStorage
Parameters:
proxyGrantingTicketIou - used as the key
Returns:
the ProxyGrantingTicket Id or null if it can't be found

save

public void save(java.lang.String proxyGrantingTicketIou,
                 java.lang.String proxyGrantingTicket)
Description copied from interface: ProxyGrantingTicketStorage
Method to save the ProxyGrantingTicket to the backing storage facility.

Specified by:
save in interface ProxyGrantingTicketStorage
Parameters:
proxyGrantingTicketIou - used as the key
proxyGrantingTicket - used as the value

cleanUp

public void cleanUp()
Cleans up old, expired proxy tickets. This method must be called regularly via an external thread or timer.

Specified by:
cleanUp in interface ProxyGrantingTicketStorage


Copyright © 2006-2009 JA-SIG. All Rights Reserved.