Class Token
- java.lang.Object
-
- de.terrestris.shoguncore.model.PersistentObject
-
- de.terrestris.shoguncore.model.token.Token
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
UserToken
@Entity public abstract class Token extends PersistentObject
Abstract base class for all tokens. A UUID token will be generated on instantiation. An expiration period has to be given in constructor.- Author:
- Daniel Koch, Nils Bühner
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedToken(int expirationInMinutes)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)booleanexpiresWithin(int minutes)Helper method that returns true, if the token is expired in the given number of minutes (starting from the current point of time).org.joda.time.ReadableDateTimegetExpirationDate()StringgetToken()inthashCode()-
Methods inherited from class de.terrestris.shoguncore.model.PersistentObject
getCreated, getGroupPermissions, getId, getModified, getUserPermissions, setGroupPermissions, setModified, setUserPermissions, toString
-
-
-
-
Method Detail
-
expiresWithin
public boolean expiresWithin(int minutes)
Helper method that returns true, if the token is expired in the given number of minutes (starting from the current point of time).- Parameters:
minutes-- Returns:
- Whether or not the token expires within the given number of minutes.
-
getToken
public String getToken()
- Returns:
- the token
-
getExpirationDate
public org.joda.time.ReadableDateTime getExpirationDate()
- Returns:
- the expirationDate
-
hashCode
public int hashCode()
-
equals
public boolean equals(Object obj)
-
-