Package org.ctan.site.domain.account
Class Ticket
java.lang.Object
org.ctan.site.domain.account.Ticket
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
FieldsModifier and TypeFieldDescriptionstatic final String
The fieldDELETE_PREFIX
contains the prefix indicating a delete request.static final String
The fieldPASSWORD_PREFIX
contains the prefix indicating a password request.static final String
The fieldREGISTER_PREFIX
contains the prefix indicating a registration request. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
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.toString()
-
Field Details
-
REGISTER_PREFIX
The fieldREGISTER_PREFIX
contains the prefix indicating a registration request.- See Also:
-
PASSWORD_PREFIX
The fieldPASSWORD_PREFIX
contains the prefix indicating a password request.- See Also:
-
DELETE_PREFIX
The fieldDELETE_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
-