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 StringThe fieldDELETE_PREFIXcontains the prefix indicating a delete request.static final StringThe fieldPASSWORD_PREFIXcontains the prefix indicating a password request.static final StringThe fieldREGISTER_PREFIXcontains the prefix indicating a registration request. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisExpired(long lifetime) Check whether the ticket has expired its lifetime.booleanCheck whether this Ticket deals with a password request.booleanCheck whether this Ticket deals with a registration.booleanCheck whether this Ticket deals with a withdrawal.toString()
-
Field Details
-
REGISTER_PREFIX
The fieldREGISTER_PREFIXcontains the prefix indicating a registration request.- See Also:
-
PASSWORD_PREFIX
The fieldPASSWORD_PREFIXcontains the prefix indicating a password request.- See Also:
-
DELETE_PREFIX
The fieldDELETE_PREFIXcontains 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:
trueiff the ticket is not too old
-
isPasswordRequest
public boolean isPasswordRequest()Check whether this Ticket deals with a password request.- Returns:
trueiff this Ticket deals with a password request
-
isRegistration
public boolean isRegistration()Check whether this Ticket deals with a registration.- Returns:
trueiff this Ticket deals with a registration
-
isWithdraw
public boolean isWithdraw()Check whether this Ticket deals with a withdrawal.- Returns:
trueiff this Ticket deals with an withdrawal
-
toString
-