Class SpringCacheBasedTicketCache
java.lang.Object
org.springframework.security.cas.authentication.SpringCacheBasedTicketCache
- All Implemented Interfaces:
StatelessTicketCache
Caches tickets using a Spring IoC defined
Cache
.- Since:
- 3.2
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetByTicketId
(String serviceTicket) Retrieves theCasAuthenticationToken
associated with the specified ticket.void
Adds the specifiedCasAuthenticationToken
to the cache.void
removeTicketFromCache
(String serviceTicket) Removes the specified ticket from the cache, meaning that future calls will require a new service ticket.void
Removes the specified ticket from the cache, as perStatelessTicketCache.removeTicketFromCache(String)
.
-
Constructor Details
-
SpringCacheBasedTicketCache
public SpringCacheBasedTicketCache(org.springframework.cache.Cache cache)
-
-
Method Details
-
getByTicketId
Description copied from interface:StatelessTicketCache
Retrieves theCasAuthenticationToken
associated with the specified ticket.If not found, returns a
null
CasAuthenticationToken
.- Specified by:
getByTicketId
in interfaceStatelessTicketCache
- Returns:
- the fully populated authentication token
-
putTicketInCache
Description copied from interface:StatelessTicketCache
Adds the specifiedCasAuthenticationToken
to the cache.The
CasAuthenticationToken.getCredentials()
method is used to retrieve the service ticket number.- Specified by:
putTicketInCache
in interfaceStatelessTicketCache
- Parameters:
token
- to be added to the cache
-
removeTicketFromCache
Description copied from interface:StatelessTicketCache
Removes the specified ticket from the cache, as perStatelessTicketCache.removeTicketFromCache(String)
.Implementations should use
CasAuthenticationToken.getCredentials()
to obtain the ticket and then delegate to theStatelessTicketCache.removeTicketFromCache(String)
method.- Specified by:
removeTicketFromCache
in interfaceStatelessTicketCache
- Parameters:
token
- to be removed
-
removeTicketFromCache
Description copied from interface: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 interfaceStatelessTicketCache
- Parameters:
serviceTicket
- to be removed
-