Interface IAuthToken
-
-
Field Summary
Fields Modifier and Type Field Description static intEXPIRATION_SECONDS_INFINITEThe value indicating, that a token never expires
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description LocalDateTimegetCreationDate()LocalDateTimegetExpirationDate()Get the date time when this token will expire.intgetExpirationSeconds()StringgetID()IAuthIdentificationgetIdentification()LocalDateTimegetLastAccessDate()booleanisExpirationPossible()Check if this token can expire (expiration seconds > 0) or not (expiration seconds = 0).booleanisExpired()Check if the token is expired.
-
-
-
Field Detail
-
EXPIRATION_SECONDS_INFINITE
static final int EXPIRATION_SECONDS_INFINITE
The value indicating, that a token never expires- See Also:
- Constant Field Values
-
-
Method Detail
-
getID
@Nonnull String getID()
- Specified by:
getIDin interfacecom.helger.commons.id.IHasID<String>- Returns:
- The secret key token representing a session of a subject. Never
null.
-
getIdentification
@Nonnull IAuthIdentification getIdentification()
- Returns:
- The underlying identification object. Never
null.
-
getCreationDate
@Nonnull LocalDateTime getCreationDate()
- Returns:
- The date and time when the token was created. Never
null.
-
getLastAccessDate
@Nonnull LocalDateTime getLastAccessDate()
- Returns:
- The date and time when the token was last accessed. If the token
was never accessed before, the creation date time is returned.
Never
null.
-
getExpirationSeconds
@Nonnegative int getExpirationSeconds()
- Returns:
- The expiration seconds. Always ≥ 0. A value of 0 means no expiration.
- See Also:
isExpirationPossible()
-
isExpirationPossible
boolean isExpirationPossible()
Check if this token can expire (expiration seconds > 0) or not (expiration seconds = 0).- Returns:
trueif this token can expire,falseotherwise.- See Also:
getExpirationSeconds()
-
getExpirationDate
@Nullable LocalDateTime getExpirationDate()
Get the date time when this token will expire. This date time changes every time the last access is updated.- Returns:
- The expiration date and time or
nullif this token cannot expire. - See Also:
isExpirationPossible()
-
isExpired
boolean isExpired()
Check if the token is expired. Expired tokens are considered invalid.- Returns:
trueif the token is already expired,falseif the token is still valid.
-
-