@MappedSuperclass public abstract class AbstractTicket extends Object implements Ticket, TicketState
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractTicket() |
|
AbstractTicket(String id,
TicketGrantingTicket ticket,
ExpirationPolicy expirationPolicy)
Constructs a new Ticket with a unique id, a possible parent Ticket (can
be null) and a specified Expiration Policy.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getCountOfUses()
Returns the number of times a ticket was used.
|
long |
getCreationTime()
Method to return the time the Ticket was created.
|
TicketGrantingTicket |
getGrantingTicket()
Method to retrieve the TicketGrantingTicket that granted this ticket.
|
String |
getId()
Method to retrieve the id.
|
long |
getLastTimeUsed()
Returns the last time the ticket was used.
|
long |
getPreviousTimeUsed()
Get the second to last time used.
|
int |
hashCode() |
boolean |
isExpired()
Determines if the ticket is expired.
|
protected boolean |
isExpiredInternal() |
String |
toString() |
protected void |
updateState()
Records the previous last time this ticket was used as well as
the last usage time.
|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, waitgetAuthenticationprotected AbstractTicket()
public AbstractTicket(String id, TicketGrantingTicket ticket, ExpirationPolicy expirationPolicy)
id - the unique identifier for the ticketticket - the parent TicketGrantingTicketexpirationPolicy - the expiration policy for the ticket.IllegalArgumentException - if the id or expiration policy is null.public final String getId()
Ticketprotected final void updateState()
Tickets themselves are solely responsible to maintain their state. The determination of ticket usage is left up to the implementation and the specific ticket type.
ExpirationPolicypublic final int getCountOfUses()
TicketStategetCountOfUses in interface TicketgetCountOfUses in interface TicketStatepublic final long getCreationTime()
TicketgetCreationTime in interface TicketgetCreationTime in interface TicketStatepublic final TicketGrantingTicket getGrantingTicket()
TicketgetGrantingTicket in interface Ticketpublic final long getLastTimeUsed()
TicketStategetLastTimeUsed in interface TicketStatepublic final long getPreviousTimeUsed()
TicketStategetPreviousTimeUsed in interface TicketStatepublic final boolean isExpired()
TicketisExpired in interface TicketExpirationPolicyprotected boolean isExpiredInternal()
Copyright © 2004-2015 Apereo. All Rights Reserved.