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_autoRenewDurationThe token auto renewal duration, in secondsprotected String_commentThe token associated commentprotected Set<String>_contextsThe token contextprotected Date_creationDateThe token creation dateprotected Date_endDateThe token end dateprotected Integer_idThe token identifierprotected Date_lastUpdateDateThe token last update dateprotected Integer_nbUsesLeftThe token number of use leftprotected String_typeThe token type 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LonggetAutoRenewDuration()Get the duration which the token should be automatically renewed on each use, in secondsStringgetComment()Get the associated creation commentSet<String>getContexts()Get the context on which the token can be usedDategetCreationDate()Get the creation date of the tokenDategetEndDate()Get the end date of the token validityIntegergetId()Get the token identifierDategetLastUpdateDate()Get the last update date of the tokenIntegergetNbUsesLeft()Get the number of uses allowed for this tokenStringgetType()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
 
 
 - 
 
 -