Class AuthenticationTokenManager.Token
java.lang.Object
org.ametys.core.authentication.token.AuthenticationTokenManager.Token
- Enclosing class:
- AuthenticationTokenManager
An Ametys authentication token
-
Field Summary
Modifier and TypeFieldDescriptionprotected Long
The token auto renewal duration, in secondsprotected String
The token associated commentThe token contextprotected Date
The token creation dateprotected Date
The token end dateprotected Integer
The token identifierprotected Date
The token last update dateprotected Integer
The token number of use leftprotected String
The token type -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet the duration which the token should be automatically renewed on each use, in secondsGet the associated creation commentGet the context on which the token can be usedGet the creation date of the tokenGet the end date of the token validitygetId()
Get the token identifierGet the last update date of the tokenGet the number of uses allowed for this tokengetType()
Get the token type
-
Field Details
-
_id
The token identifier -
_type
The token type -
_comment
The token associated comment -
_creationDate
The token creation date -
_endDate
The token end date -
_lastUpdateDate
The token last update date -
_nbUsesLeft
The token number of use left -
_autoRenewDuration
The token auto renewal duration, in seconds -
_contexts
The token context
-
-
Constructor Details
-
Token
protected Token(Integer id, String type, String comment, Date creationDate, Date endDate, Date lastUpdateDate, Integer nbUsesLeft, Long autoRenewDuration, Set<String> contexts) Creates a Token- Parameters:
id
- The identifiertype
- The type of tokencomment
- The comment. Can be null.creationDate
- The creation date. Can be null.endDate
- The end date. Can be null.lastUpdateDate
- The last update date. Can be null.nbUsesLeft
- nb of uses left for this token (null for no limitation)autoRenewDuration
- duration that will be added (from "now") each time the token is updatedcontexts
- contexts of the token (ressource id for example)
-
-
Method Details
-
getId
Get the token identifier- Returns:
- The identifier
-
getType
Get the token type- Returns:
- The type
-
getComment
Get the associated creation comment- Returns:
- The comment or null
-
getCreationDate
Get the creation date of the token- Returns:
- The creation date or null
-
getEndDate
Get the end date of the token validity- Returns:
- The end date or null
-
getLastUpdateDate
Get the last update date of the token- Returns:
- The last update date or null
-
getAutoRenewDuration
Get the duration which the token should be automatically renewed on each use, in seconds- Returns:
- The auto renewal duration in seconds or null if not applicable
-
getContexts
Get the context on which the token can be used- Returns:
- The token contexts or null if not applicable
-
getNbUsesLeft
Get the number of uses allowed for this token- Returns:
- The number of allowed uses or null if not applicable
-