Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.acegisecurity.providers.cas.cache
Class EhCacheBasedTicketCache  view EhCacheBasedTicketCache download EhCacheBasedTicketCache.java

java.lang.Object
  extended byorg.acegisecurity.providers.cas.cache.EhCacheBasedTicketCache
All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean, org.acegisecurity.providers.cas.StatelessTicketCache

public class EhCacheBasedTicketCache
extends java.lang.Object
implements org.acegisecurity.providers.cas.StatelessTicketCache, org.springframework.beans.factory.InitializingBean

Caches tickets using a Spring IoC defined EHCACHE.

Version:
$Id: EhCacheBasedTicketCache.java,v 1.8 2005/11/17 00:55:48 benalex Exp $

Field Summary
private  Cache cache
           
private static org.apache.commons.logging.Log logger
           
 
Constructor Summary
EhCacheBasedTicketCache()
           
 
Method Summary
 void afterPropertiesSet()
          Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
 org.acegisecurity.providers.cas.CasAuthenticationToken getByTicketId(java.lang.String serviceTicket)
          Retrieves the CasAuthenticationToken associated with the specified ticket.
 Cache getCache()
           
 void putTicketInCache(org.acegisecurity.providers.cas.CasAuthenticationToken token)
          Adds the specified CasAuthenticationToken to the cache.
 void removeTicketFromCache(org.acegisecurity.providers.cas.CasAuthenticationToken token)
          Removes the specified ticket from the cache, as per removeTicketFromCache(String) 55 .
 void removeTicketFromCache(java.lang.String serviceTicket)
          Removes the specified ticket from the cache, meaning that future calls will require a new service ticket.
 void setCache(Cache cache)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static final org.apache.commons.logging.Log logger

cache

private Cache cache
Constructor Detail

EhCacheBasedTicketCache

public EhCacheBasedTicketCache()
Method Detail

getByTicketId

public org.acegisecurity.providers.cas.CasAuthenticationToken getByTicketId(java.lang.String serviceTicket)
Description copied from interface: org.acegisecurity.providers.cas.StatelessTicketCache
Retrieves the CasAuthenticationToken associated with the specified ticket.

If not found, returns a nullCasAuthenticationToken.

Specified by:
getByTicketId in interface org.acegisecurity.providers.cas.StatelessTicketCache

setCache

public void setCache(Cache cache)

getCache

public Cache getCache()

afterPropertiesSet

public void afterPropertiesSet()
                        throws java.lang.Exception
Description copied from interface: org.springframework.beans.factory.InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean

putTicketInCache

public void putTicketInCache(org.acegisecurity.providers.cas.CasAuthenticationToken token)
Description copied from interface: org.acegisecurity.providers.cas.StatelessTicketCache
Adds the specified CasAuthenticationToken to the cache.

The CasAuthenticationToken.getCredentials()>CasAuthenticationToken.getCredentials() 55 method is used to retrieve the service ticket number.

Specified by:
putTicketInCache in interface org.acegisecurity.providers.cas.StatelessTicketCache

removeTicketFromCache

public void removeTicketFromCache(org.acegisecurity.providers.cas.CasAuthenticationToken token)
Description copied from interface: org.acegisecurity.providers.cas.StatelessTicketCache
Removes the specified ticket from the cache, as per StatelessTicketCache.removeTicketFromCache(String)>StatelessTicketCache.removeTicketFromCache(String) 55 .

Implementations should use CasAuthenticationToken.getCredentials()>CasAuthenticationToken.getCredentials() 55 to obtain the ticket and then delegate to to the StatelessTicketCache.removeTicketFromCache(String)>StatelessTicketCache.removeTicketFromCache(String) 55 method.

Specified by:
removeTicketFromCache in interface org.acegisecurity.providers.cas.StatelessTicketCache

removeTicketFromCache

public void removeTicketFromCache(java.lang.String serviceTicket)
Description copied from interface: org.acegisecurity.providers.cas.StatelessTicketCache
Removes the specified ticket from the cache, meaning that future calls will require a new service ticket.

This is in case applications wish to provide a session termination capability for their stateless clients.

Specified by:
removeTicketFromCache in interface org.acegisecurity.providers.cas.StatelessTicketCache