org.jasig.cas.ticket.registry
Interface TicketRegistry

All Known Implementing Classes:
AbstractDistributedTicketRegistry, AbstractTicketRegistry, DefaultTicketRegistry, JpaTicketRegistry

public interface TicketRegistry

Interface for a registry that stores tickets. The underlying registry can be backed by anything from a normal HashMap to JGroups for having distributed registries. It is up to specific implementations to determine their clean up strategy. Strategies can include a manual clean up by a RegistryCleaner or a more sophisticated strategy such as LRU.

Since:
3.0

This is a published and supported CAS Server 3 API.

Version:
$Revision: 42053 $ $Date: 2007-06-10 09:17:55 -0400 (Sun, 10 Jun 2007) $
Author:
Scott Battaglia

Method Summary
 void addTicket(Ticket ticket)
          Add a ticket to the registry.
 boolean deleteTicket(java.lang.String ticketId)
          Remove a specific ticket from the registry.
 Ticket getTicket(java.lang.String ticketId)
          Retrieve a ticket from the registry.
 Ticket getTicket(java.lang.String ticketId, java.lang.Class<? extends Ticket> clazz)
          Retrieve a ticket from the registry.
 java.util.Collection<Ticket> getTickets()
          Retrieve all tickets from the registry.
 

Method Detail

addTicket

void addTicket(Ticket ticket)
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.

getTicket

Ticket getTicket(java.lang.String ticketId,
                 java.lang.Class<? extends Ticket> clazz)
Retrieve a ticket from the registry. If the ticket retrieved does not match the expected class, an InvalidTicketException is thrown.

Parameters:
ticketId - the id of the ticket we wish to retrieve.
clazz - The expected class of the ticket we wish to retrieve.
Returns:
the requested ticket.
Throws:
InvalidTicketClassException - if the ticket does not match the class provided.

getTicket

Ticket getTicket(java.lang.String ticketId)
Retrieve a ticket from the registry.

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

deleteTicket

boolean deleteTicket(java.lang.String ticketId)
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.

getTickets

java.util.Collection<Ticket> getTickets()
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.


Copyright © 2004-2010 Java Architectures Special Interest Group. All Rights Reserved.