@Component(value="ehcacheTicketRegistry")
public final class EhCacheTicketRegistry
extends org.jasig.cas.ticket.registry.encrypt.AbstractCrypticTicketRegistry
implements org.springframework.beans.factory.InitializingBean
Ehcache based distributed ticket registry.
Use distinct caches for ticket granting tickets (TGT) and service tickets (ST) for:
| Constructor and Description |
|---|
EhCacheTicketRegistry()
Instantiates a new EhCache ticket registry.
|
EhCacheTicketRegistry(net.sf.ehcache.Cache serviceTicketsCache,
net.sf.ehcache.Cache ticketGrantingTicketsCache)
Instantiates a new EhCache ticket registry.
|
EhCacheTicketRegistry(net.sf.ehcache.Cache serviceTicketsCache,
net.sf.ehcache.Cache ticketGrantingTicketsCache,
boolean supportRegistryState)
Instantiates a new EhCache ticket registry.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addTicket(org.jasig.cas.ticket.Ticket ticketToAdd) |
void |
afterPropertiesSet() |
boolean |
deleteTicket(java.lang.String ticketIdToDelete) |
org.jasig.cas.ticket.Ticket |
getTicket(java.lang.String ticketIdToGet) |
java.util.Collection<org.jasig.cas.ticket.Ticket> |
getTickets() |
protected boolean |
needsCallback() |
int |
serviceTicketCount() |
int |
sessionCount() |
void |
setServiceTicketsCache(net.sf.ehcache.Cache serviceTicketsCache) |
void |
setSupportRegistryState(boolean supportRegistryState)
Flag to indicate whether this registry instance should participate in reporting its state with
default value set to
true. |
void |
setTicketGrantingTicketsCache(net.sf.ehcache.Cache ticketGrantingTicketsCache) |
java.lang.String |
toString() |
protected void |
updateTicket(org.jasig.cas.ticket.Ticket ticket) |
decodeTicket, decodeTickets, encodeTicket, encodeTicketId, setCipherExecutorpublic EhCacheTicketRegistry()
public EhCacheTicketRegistry(net.sf.ehcache.Cache serviceTicketsCache,
net.sf.ehcache.Cache ticketGrantingTicketsCache)
serviceTicketsCache - the service tickets cacheticketGrantingTicketsCache - the ticket granting tickets cachepublic EhCacheTicketRegistry(net.sf.ehcache.Cache serviceTicketsCache,
net.sf.ehcache.Cache ticketGrantingTicketsCache,
boolean supportRegistryState)
serviceTicketsCache - the service tickets cacheticketGrantingTicketsCache - the ticket granting tickets cachesupportRegistryState - the support registry statepublic void addTicket(org.jasig.cas.ticket.Ticket ticketToAdd)
addTicket in interface org.jasig.cas.ticket.registry.TicketRegistrypublic boolean deleteTicket(java.lang.String ticketIdToDelete)
deleteTicket in interface org.jasig.cas.ticket.registry.TicketRegistrypublic org.jasig.cas.ticket.Ticket getTicket(java.lang.String ticketIdToGet)
getTicket in interface org.jasig.cas.ticket.registry.TicketRegistrypublic java.util.Collection<org.jasig.cas.ticket.Ticket> getTickets()
getTickets in interface org.jasig.cas.ticket.registry.TicketRegistrypublic void setServiceTicketsCache(net.sf.ehcache.Cache serviceTicketsCache)
public void setTicketGrantingTicketsCache(net.sf.ehcache.Cache ticketGrantingTicketsCache)
public java.lang.String toString()
toString in class java.lang.Objectprotected void updateTicket(org.jasig.cas.ticket.Ticket ticket)
updateTicket in class org.jasig.cas.ticket.registry.AbstractDistributedTicketRegistryprotected boolean needsCallback()
needsCallback in class org.jasig.cas.ticket.registry.AbstractDistributedTicketRegistrypublic void setSupportRegistryState(boolean supportRegistryState)
true.
Based on the EhCache documentation,
determining the number of service tickets and the total session count from the cache can be considered
an expensive operation with the time taken as O(n), where n is the number of elements in the cache.
Therefore, the flag provides a level of flexibility such that depending on the cache and environment settings, reporting statistics can be set to false and disabled.
supportRegistryState - true, if the registry is to support registry statesessionCount(),
serviceTicketCount()public void afterPropertiesSet()
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanpublic int sessionCount()
sessionCount in interface org.jasig.cas.ticket.registry.TicketRegistryStatesessionCount in class org.jasig.cas.ticket.registry.AbstractTicketRegistrypublic int serviceTicketCount()
serviceTicketCount in interface org.jasig.cas.ticket.registry.TicketRegistryStateserviceTicketCount in class org.jasig.cas.ticket.registry.AbstractTicketRegistry