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 Detail

      • getCountOfUses

        int getCountOfUses()
        Returns the number of times a ticket was used.
        Specified by:
        getCountOfUses in interface Ticket
        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:
        getCreationTime in interface Ticket
        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
      • getId

        java.lang.String getId()
        Gets id.
        Specified by:
        getId in interface Ticket
        Returns:
        the id