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 CAS ticket-granting ticket, typically vended as a cookie (TGC). This class represents, in the general sense, a
20: * ticket that is used to grant other ticket; it becomes a "powerful" TGC only when vended as such and stored in the TGC cache.
21: */
22: public class TicketGrantingTicket extends Ticket {
23:
24: // *********************************************************************
25: // Private, ticket state
26:
27: private String username;
28: private boolean expired;
29:
30: // *********************************************************************
31: // Constructor
32:
33: /** Constructs a new, immutable service ticket. */
34: public TicketGrantingTicket(String username) {
35: this .username = username;
36: this .expired = false;
37: }
38:
39: // *********************************************************************
40: // Public interface
41:
42: /** Retrieves the ticket's username. */
43: public String getUsername() {
44: return username;
45: }
46:
47: /**
48: * Markes the ticket as expired, preventing its further use and the validity of subordinate tickets "downstream" from it.
49: */
50: public void expire() {
51: this .expired = true;
52: }
53:
54: /** Returns true if the ticket is expired, false otherwise. */
55: public boolean isExpired() {
56: return expired;
57: }
58:
59: }
|