Class AuthenticationTokenManager.Token
- java.lang.Object
-
- org.ametys.core.authentication.token.AuthenticationTokenManager.Token
-
- Enclosing class:
- AuthenticationTokenManager
public static class AuthenticationTokenManager.Token extends Object
An Ametys authentication token
-
-
Field Summary
Fields Modifier and Type Field Description protected Long
_autoRenewDuration
The token auto renewal duration, in secondsprotected String
_comment
The token associated commentprotected Set<String>
_contexts
The token contextprotected Date
_creationDate
The token creation dateprotected Date
_endDate
The token end dateprotected Integer
_id
The token identifierprotected Date
_lastUpdateDate
The token last update dateprotected Integer
_nbUsesLeft
The token number of use leftprotected String
_type
The token type
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Long
getAutoRenewDuration()
Get the duration which the token should be automatically renewed on each use, in secondsString
getComment()
Get the associated creation commentSet<String>
getContexts()
Get the context on which the token can be usedDate
getCreationDate()
Get the creation date of the tokenDate
getEndDate()
Get the end date of the token validityInteger
getId()
Get the token identifierDate
getLastUpdateDate()
Get the last update date of the tokenInteger
getNbUsesLeft()
Get the number of uses allowed for this tokenString
getType()
Get the token type
-
-
-
Field Detail
-
_creationDate
protected Date _creationDate
The token creation date
-
_lastUpdateDate
protected Date _lastUpdateDate
The token last update date
-
_nbUsesLeft
protected Integer _nbUsesLeft
The token number of use left
-
_autoRenewDuration
protected Long _autoRenewDuration
The token auto renewal duration, in seconds
-
-
Constructor Detail
-
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 Detail
-
getComment
public String getComment()
Get the associated creation comment- Returns:
- The comment or null
-
getCreationDate
public Date getCreationDate()
Get the creation date of the token- Returns:
- The creation date or null
-
getEndDate
public Date getEndDate()
Get the end date of the token validity- Returns:
- The end date or null
-
getLastUpdateDate
public Date getLastUpdateDate()
Get the last update date of the token- Returns:
- The last update date or null
-
getAutoRenewDuration
public Long 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
public Set<String> getContexts()
Get the context on which the token can be used- Returns:
- The token contexts or null if not applicable
-
getNbUsesLeft
public Integer getNbUsesLeft()
Get the number of uses allowed for this token- Returns:
- The number of allowed uses or null if not applicable
-
-