public class

EhCacheBasedTicketCache

extends Object
implements InitializingBean StatelessTicketCache
java.lang.Object
   ↳ org.springframework.security.cas.authentication.EhCacheBasedTicketCache

Class Overview

Caches tickets using a Spring IoC defined EHCACHE.

Summary

Public Constructors
EhCacheBasedTicketCache()
Public Methods
void afterPropertiesSet()
CasAuthenticationToken getByTicketId(String serviceTicket)
Retrieves the CasAuthenticationToken associated with the specified ticket.
Ehcache getCache()
void putTicketInCache(CasAuthenticationToken token)
Adds the specified CasAuthenticationToken to the cache.
void removeTicketFromCache(CasAuthenticationToken token)
Removes the specified ticket from the cache, as per removeTicketFromCache(String).
void removeTicketFromCache(String serviceTicket)
Removes the specified ticket from the cache, meaning that future calls will require a new service ticket.
void setCache(Ehcache cache)
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.springframework.beans.factory.InitializingBean
From interface org.springframework.security.cas.authentication.StatelessTicketCache

Public Constructors

public EhCacheBasedTicketCache ()

Public Methods

public void afterPropertiesSet ()

Throws
Exception

public CasAuthenticationToken getByTicketId (String serviceTicket)

Retrieves the CasAuthenticationToken associated with the specified ticket.

If not found, returns a nullCasAuthenticationToken.

Returns
  • the fully populated authentication token

public Ehcache getCache ()

public void putTicketInCache (CasAuthenticationToken token)

Adds the specified CasAuthenticationToken to the cache.

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

Parameters
token to be added to the cache

public void removeTicketFromCache (CasAuthenticationToken token)

Removes the specified ticket from the cache, as per removeTicketFromCache(String).

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

Parameters
token to be removed

public void removeTicketFromCache (String serviceTicket)

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.

Parameters
serviceTicket to be removed

public void setCache (Ehcache cache)