Package org.forgerock.oauth2.core
Class StatefulToken
- java.lang.Object
-
- org.forgerock.json.JsonValue
-
- org.forgerock.oauth2.core.StatefulToken
-
- Direct Known Subclasses:
StatefulAccessToken,StatefulRefreshToken
public abstract class StatefulToken extends org.forgerock.json.JsonValue
-
-
Constructor Summary
Constructors Constructor Description StatefulToken(Object object)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract longdefaultExpireTime()StringgetAuditTrackingId()longgetAuthTimeSeconds()Gets the end user's authentication time in seconds.StringgetClaims()Gets the requested claims associated w/ this access token.StringgetClientId()Gets the client's id.longgetExpiryTime()StringgetRealm()StringgetResourceOwnerId()Gets the resource owner's id.protected StringgetResourceString(String string)Gets the display String for the given String.Set<String>getScope()Gets the scope.protected Set<String>getSetProperty(String key)protected StringgetStringProperty(String key)Get a string property from the store.protected LonggetTimeLeft()StringgetTokenId()StringgetTokenName()StringgetTokenType()Gets the token type.booleanisExpired()Determines if the Access Token is expired.protected voidsetAuthGrantId(String authGrantId)Sets the authorization grant id.protected voidsetAuthTime(long authTime)Sets the end user's original authentication time in seconds since epoch.protected voidsetClientId(String clientId)Sets the client's id.protected voidsetExpiryTime(long expiryTime)Sets the expiry time.protected voidsetGrantType(String grantType)Sets the grant type.protected voidsetId(String id)Sets the token id.protected voidsetRedirectUri(String redirectUri)Sets the redirect uri.protected voidsetResourceOwnerId(String resourceOwnerId)Sets the resource owner's id.protected voidsetScope(Set<String> scope)Sets the scope.protected voidsetStringProperty(String key, String value)Set a string property in the store.protected voidsetTokenName(String tokenName)Sets the token name.protected voidsetTokenType(String tokenType)Sets the token type.org.forgerock.json.JsonValuetoJsonValue()-
Methods inherited from class org.forgerock.json.JsonValue
add, add, add, add, addPermissive, array, as, asBigDecimal, asBoolean, asCollection, asCollection, asDouble, asEnum, asInteger, asList, asList, asLong, asMap, asMap, asMapOfList, asNumber, asSet, asSet, asString, asURI, clear, clone, contains, copy, defaultTo, diff, expect, field, fieldIfNotNull, get, get, get, getObject, getPointer, isBoolean, isCollection, isDefined, isEqualTo, isList, isMap, isNotNull, isNull, isNumber, isSet, isString, iterator, json, keys, object, object, patch, put, put, put, putPermissive, remove, remove, remove, required, set, setObject, size, toIndex, toString
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
StatefulToken
public StatefulToken(Object object)
-
-
Method Detail
-
setId
protected void setId(String id)
Sets the token id.- Parameters:
id- The token id.
-
setResourceOwnerId
protected void setResourceOwnerId(String resourceOwnerId)
Sets the resource owner's id.- Parameters:
resourceOwnerId- The resource owner's id.
-
setClientId
protected void setClientId(String clientId)
Sets the client's id.- Parameters:
clientId- The client's id.
-
setRedirectUri
protected void setRedirectUri(String redirectUri)
Sets the redirect uri.- Parameters:
redirectUri- The redirect uri.
-
setExpiryTime
protected void setExpiryTime(long expiryTime)
Sets the expiry time.- Parameters:
expiryTime- The expiry time.
-
setAuthGrantId
protected void setAuthGrantId(String authGrantId)
Sets the authorization grant id.- Parameters:
authGrantId- The authorization grant id.
-
setTokenType
protected void setTokenType(String tokenType)
Sets the token type.- Parameters:
tokenType- The token type.
-
setTokenName
protected void setTokenName(String tokenName)
Sets the token name.- Parameters:
tokenName- The token name.
-
setGrantType
protected void setGrantType(String grantType)
Sets the grant type.- Parameters:
grantType- The grant type.
-
setAuthTime
protected void setAuthTime(long authTime)
Sets the end user's original authentication time in seconds since epoch.- Parameters:
authTime- The authentication time.
-
getClientId
public String getClientId()
Gets the client's id.- Returns:
- The client's id.
-
getResourceOwnerId
public String getResourceOwnerId()
Gets the resource owner's id.- Returns:
- The resource owner's id.
-
getTokenId
public String getTokenId()
-
getTokenName
public String getTokenName()
-
getRealm
public String getRealm()
-
getClaims
public String getClaims()
Gets the requested claims associated w/ this access token.- Returns:
- Requested claims (JSON as a String).
-
getTokenType
public String getTokenType()
Gets the token type.- Returns:
- The token type.
-
getAuditTrackingId
public String getAuditTrackingId()
-
getAuthTimeSeconds
public long getAuthTimeSeconds()
Gets the end user's authentication time in seconds.- Returns:
- The authentication time.
-
getResourceString
protected String getResourceString(String string)
Gets the display String for the given String.- Parameters:
string- The String.- Returns:
- The display String.
-
getStringProperty
protected String getStringProperty(String key)
Get a string property from the store.- Parameters:
key- The property key.- Returns:
- The value.
-
setStringProperty
protected final void setStringProperty(String key, String value)
Set a string property in the store.- Parameters:
key- The property key.value- The value.
-
toJsonValue
public org.forgerock.json.JsonValue toJsonValue()
-
getTimeLeft
protected Long getTimeLeft()
-
getExpiryTime
public long getExpiryTime()
-
defaultExpireTime
protected abstract long defaultExpireTime()
-
isExpired
public boolean isExpired()
Determines if the Access Token is expired.- Returns:
trueif current time is greater than the expiry time.
-
-