org.jasig.cas.ticket.registry
Class JpaTicketRegistry

java.lang.Object
  extended by org.jasig.cas.ticket.registry.AbstractTicketRegistry
      extended by org.jasig.cas.ticket.registry.AbstractDistributedTicketRegistry
          extended by org.jasig.cas.ticket.registry.JpaTicketRegistry
All Implemented Interfaces:
TicketRegistryState, TicketRegistry

public final class JpaTicketRegistry
extends AbstractDistributedTicketRegistry

JPA implementation of a CAS TicketRegistry. This implementation of ticket registry is suitable for HA environments.

Since:
3.2.1
Author:
Scott Battaglia, Marvin S. Addison

Field Summary
 
Fields inherited from class org.jasig.cas.ticket.registry.AbstractTicketRegistry
log
 
Constructor Summary
JpaTicketRegistry()
           
 
Method Summary
 void addTicket(Ticket ticket)
          Add a ticket to the registry.
 boolean deleteTicket(String ticketId)
          Remove a specific ticket from the registry.
 Ticket getTicket(String ticketId)
          Retrieve a ticket from the registry.
 Collection<Ticket> getTickets()
          Retrieve all tickets from the registry.
protected  boolean needsCallback()
           
 int serviceTicketCount()
          Computes the number of service tickets stored in the ticket registry.
 int sessionCount()
          Computes the number of SSO sessions stored in the ticket registry.
 void setTicketGrantingTicketPrefix(String ticketGrantingTicketPrefix)
           
protected  void updateTicket(Ticket ticket)
           
 
Methods inherited from class org.jasig.cas.ticket.registry.AbstractDistributedTicketRegistry
getProxiedTicketInstance
 
Methods inherited from class org.jasig.cas.ticket.registry.AbstractTicketRegistry
getTicket
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JpaTicketRegistry

public JpaTicketRegistry()
Method Detail

updateTicket

protected void updateTicket(Ticket ticket)
Specified by:
updateTicket in class AbstractDistributedTicketRegistry

addTicket

@Transactional(readOnly=false)
public void addTicket(Ticket ticket)
Description copied from interface: TicketRegistry
Add a ticket to the registry. Ticket storage is based on the ticket id.

Parameters:
ticket - The ticket we wish to add to the cache.

deleteTicket

@Transactional(readOnly=false)
public boolean deleteTicket(String ticketId)
Description copied from interface: TicketRegistry
Remove a specific ticket from the registry.

Parameters:
ticketId - The id of the ticket to delete.
Returns:
true if the ticket was removed and false if the ticket did not exist.

getTicket

@Transactional(readOnly=true)
public Ticket getTicket(String ticketId)
Description copied from interface: TicketRegistry
Retrieve a ticket from the registry.

Parameters:
ticketId - the id of the ticket we wish to retrieve
Returns:
the requested ticket.

getTickets

@Transactional(readOnly=true)
public Collection<Ticket> getTickets()
Description copied from interface: TicketRegistry
Retrieve all tickets from the registry.

Returns:
collection of tickets currently stored in the registry. Tickets might or might not be valid i.e. expired.

setTicketGrantingTicketPrefix

public void setTicketGrantingTicketPrefix(String ticketGrantingTicketPrefix)

needsCallback

protected boolean needsCallback()
Specified by:
needsCallback in class AbstractDistributedTicketRegistry

sessionCount

@Transactional(readOnly=true)
public int sessionCount()
Description copied from interface: TicketRegistryState
Computes the number of SSO sessions stored in the ticket registry.

Specified by:
sessionCount in interface TicketRegistryState
Overrides:
sessionCount in class AbstractTicketRegistry
Returns:
Number of ticket-granting tickets in the registry at time of invocation or Integer.MIN_VALUE if unknown.

serviceTicketCount

@Transactional(readOnly=true)
public int serviceTicketCount()
Description copied from interface: TicketRegistryState
Computes the number of service tickets stored in the ticket registry.

Specified by:
serviceTicketCount in interface TicketRegistryState
Overrides:
serviceTicketCount in class AbstractTicketRegistry
Returns:
Number of service tickets in the registry at time of invocation or Integer.MIN_VALUE if unknown.


Copyright © 2004-2013 Jasig. All Rights Reserved.