Class Ticket

java.lang.Object
org.ctan.site.domain.account.Ticket

@Entity public class Ticket extends Object
The class Ticket represents a request to perform some operation which requires an acknowledgment from the user. For instance the change of the password.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The field DELETE_PREFIX contains the prefix indicating a delete request.
    static final String
    The field PASSWORD_PREFIX contains the prefix indicating a password request.
    static final String
    The field REGISTER_PREFIX contains the prefix indicating a registration request.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    isExpired(long lifetime)
    Check whether the ticket has expired its lifetime.
    boolean
    Check whether this Ticket deals with a password request.
    boolean
    Check whether this Ticket deals with a registration.
    boolean
    Check whether this Ticket deals with a withdrawal.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • REGISTER_PREFIX

      public static final String REGISTER_PREFIX
      The field REGISTER_PREFIX contains the prefix indicating a registration request.
      See Also:
    • PASSWORD_PREFIX

      public static final String PASSWORD_PREFIX
      The field PASSWORD_PREFIX contains the prefix indicating a password request.
      See Also:
    • DELETE_PREFIX

      public static final String DELETE_PREFIX
      The field DELETE_PREFIX contains the prefix indicating a delete request.
      See Also:
  • Constructor Details

    • Ticket

      public Ticket()
  • Method Details

    • isExpired

      public boolean isExpired(long lifetime)
      Check whether the ticket has expired its lifetime. For this purpose the lifetime is passed in and the creation date is compared to the current date wrt. the lifetime.
      Parameters:
      lifetime - the lifetime in minutes
      Returns:
      true iff the ticket is not too old
    • isPasswordRequest

      public boolean isPasswordRequest()
      Check whether this Ticket deals with a password request.
      Returns:
      true iff this Ticket deals with a password request
    • isRegistration

      public boolean isRegistration()
      Check whether this Ticket deals with a registration.
      Returns:
      true iff this Ticket deals with a registration
    • isWithdraw

      public boolean isWithdraw()
      Check whether this Ticket deals with a withdrawal.
      Returns:
      true iff this Ticket deals with an withdrawal
    • toString

      public String toString()
      Overrides:
      toString in class Object
      See Also: