Package org.apereo.cas.ticket
Interface TicketState
-
- All Superinterfaces:
AuthenticationAwareTicket,java.lang.Comparable<Ticket>,java.io.Serializable,Ticket
public interface TicketState extends AuthenticationAwareTicket
The interface to describe the status and status of the ticket, with metadata such as number of times used, last time used, etc.- Since:
- 3.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intgetCountOfUses()Returns the number of times a ticket was used.java.time.ZonedDateTimegetCreationTime()Get the time the ticket was created.java.lang.StringgetId()Gets id.java.time.ZonedDateTimegetLastTimeUsed()Returns the last time the ticket was used.java.time.ZonedDateTimegetPreviousTimeUsed()Get the second to last time used.TicketGrantingTicketgetTicketGrantingTicket()Method to retrieve the TicketGrantingTicket that granted this ticket.voidupdate()Records the previous last time this ticket was used as well as the last usage time.-
Methods inherited from interface org.apereo.cas.ticket.AuthenticationAwareTicket
getAuthentication
-
Methods inherited from interface org.apereo.cas.ticket.Ticket
getExpirationPolicy, getPrefix, isExpired, markTicketExpired
-
-
-
-
Method Detail
-
getCountOfUses
int getCountOfUses()
Returns the number of times a ticket was used.- Specified by:
getCountOfUsesin interfaceTicket- Returns:
- the number of times the ticket was used.
-
getLastTimeUsed
java.time.ZonedDateTime getLastTimeUsed()
Returns the last time the ticket was used.- Returns:
- the last time the ticket was used.
-
getPreviousTimeUsed
java.time.ZonedDateTime getPreviousTimeUsed()
Get the second to last time used.- Returns:
- the previous time used.
-
getCreationTime
java.time.ZonedDateTime getCreationTime()
Get the time the ticket was created.- Specified by:
getCreationTimein interfaceTicket- Returns:
- the creation time of the ticket.
-
getTicketGrantingTicket
TicketGrantingTicket getTicketGrantingTicket()
Method to retrieve the TicketGrantingTicket that granted this ticket.- Returns:
- the ticket or null if it has no parent
-
update
void update()
Records the previous last time this ticket was used as well as the last usage time. The ticket usage count is also incremented.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.
- Since:
- 5.0.0
- See Also:
ExpirationPolicy
-
-