edu.yale.its.tp.cas.ticket
Class ActiveTicketCache

java.lang.Object
  |
  +--edu.yale.its.tp.cas.ticket.ActiveTicketCache
All Implemented Interfaces:
TicketCache
Direct Known Subclasses:
GrantorCache, OTUTicketCache

public abstract class ActiveTicketCache
extends java.lang.Object
implements TicketCache

Represents a cache of tickets that each expire after a configurable period of inactivity (i.e., not being retrieved).


Constructor Summary
ActiveTicketCache(int tolerance)
          Constucts a new ActiveTicketCache that will expire tickets after tolerance seconds of inactivity.
 
Method Summary
 java.lang.String addTicket(edu.yale.its.tp.cas.ticket.Ticket t)
          Adds a new Ticket to the cache, returning a String identifier that uniquely matches the registered Ticket.
 edu.yale.its.tp.cas.ticket.Ticket getTicket(java.lang.String ticketId)
          Retrieves a Ticket based on a ticket identifier String.
protected abstract  java.lang.String newTicketId()
          Generates and returns a new, unique ticket ID
protected abstract  edu.yale.its.tp.cas.ticket.Ticket retrieveTicket(java.lang.String ticketId)
          Retrieves the ticket with the given identifier.
protected abstract  void storeTicket(java.lang.String ticketId, edu.yale.its.tp.cas.ticket.Ticket t)
          Stores the given ticket, associating it with the given identifier.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.yale.its.tp.cas.ticket.TicketCache
deleteTicket
 

Constructor Detail

ActiveTicketCache

public ActiveTicketCache(int tolerance)
Constucts a new ActiveTicketCache that will expire tickets after tolerance seconds of inactivity.

Method Detail

newTicketId

protected abstract java.lang.String newTicketId()
Generates and returns a new, unique ticket ID


storeTicket

protected abstract void storeTicket(java.lang.String ticketId,
                                    edu.yale.its.tp.cas.ticket.Ticket t)
                             throws TicketException
Stores the given ticket, associating it with the given identifier.

TicketException

retrieveTicket

protected abstract edu.yale.its.tp.cas.ticket.Ticket retrieveTicket(java.lang.String ticketId)
Retrieves the ticket with the given identifier.


addTicket

public java.lang.String addTicket(edu.yale.its.tp.cas.ticket.Ticket t)
                           throws TicketException
Description copied from interface: TicketCache
Adds a new Ticket to the cache, returning a String identifier that uniquely matches the registered Ticket. This String identifier need not be globally unique, but two properties must be guaranteed: - The ticket cache must associate the identifier with the Ticket for the lifetime of the ticket. - The ticket cache must ensure that once a ticket expires, its identifier does not return a valid ticket.

Specified by:
addTicket in interface TicketCache
TicketException

getTicket

public edu.yale.its.tp.cas.ticket.Ticket getTicket(java.lang.String ticketId)
Description copied from interface: TicketCache
Retrieves a Ticket based on a ticket identifier String. If the identifier matches no current ticket, returns null.

Specified by:
getTicket in interface TicketCache