01: /*
02: * Copyright 2007 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package edu.yale.its.tp.cas.ticket;
17:
18: /**
19: * Represents a generic cache of CAS tickets. Ticket caches have the following characteristics: - At any given time, they store a
20: * list of valid tickets, each indexed with a unique String that acts as a ticket identifier. - Tickets can expire based on
21: * cache-specific rules.
22: */
23: public interface TicketCache {
24:
25: /**
26: * Adds a new Ticket to the cache, returning a String identifier that uniquely matches the registered Ticket. This String
27: * identifier need not be globally unique, but two properties must be guaranteed: - The ticket cache must associate the
28: * identifier with the Ticket for the lifetime of the ticket. - The ticket cache must ensure that once a ticket expires, its
29: * identifier does not return a valid ticket.
30: */
31: String addTicket(Ticket t) throws TicketException;
32:
33: /**
34: * Retrieves a Ticket based on a ticket identifier String. If the identifier matches no current ticket, returns null.
35: */
36: Ticket getTicket(String ticketId);
37:
38: /**
39: * Deletes a ticket given a ticket identifier String. (Implementations need not provide a meaningful implementation of this
40: * method; they must throw UnsupportedOperationException if they do not.)
41: */
42: void deleteTicket(String ticketId);
43:
44: }
|