public abstract class AbstractSecurityToken extends Object implements SecurityToken
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractSecurityToken.Keys |
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_MAX_TOKEN_TTL |
| Constructor and Description |
|---|
AbstractSecurityToken() |
| Modifier and Type | Method and Description |
|---|---|
AbstractSecurityToken |
enforceNotExpired() |
String |
getActiveUrl() |
String |
getAppId() |
String |
getAppUrl() |
String |
getContainer() |
String |
getDomain() |
Long |
getExpiresAt() |
protected abstract EnumSet<AbstractSecurityToken.Keys> |
getMapKeys()
This method will govern the effectiveness of the protected
toMap() and
#loadFromMap(SecurityToken, Map) helper methods. |
protected int |
getMaxTokenTTL()
Returns the maximum allowable time (in seconds) for this token to live.
|
long |
getModuleId() |
String |
getOwnerId() |
protected TimeSource |
getTimeSource() |
String |
getTrustedJson() |
String |
getViewerId() |
boolean |
isExpired() |
protected AbstractSecurityToken |
loadFromMap(Map<String,String> map)
A helper to help load known supported keys from a provided map.
|
protected AbstractSecurityToken |
setActiveUrl(String activeUrl) |
protected AbstractSecurityToken |
setAppId(String appId) |
protected AbstractSecurityToken |
setAppUrl(String appUrl) |
protected AbstractSecurityToken |
setContainer(String container) |
protected AbstractSecurityToken |
setDomain(String domain) |
protected AbstractSecurityToken |
setExpires()
Compute and set the expiration time for this token using the default TTL.
|
protected AbstractSecurityToken |
setExpires(int tokenTTL)
Compute and set the expiration time for this token using the provided TTL.
|
protected AbstractSecurityToken |
setExpiresAt(Long expiresAt)
Set the expiration time for this token.
|
protected AbstractSecurityToken |
setModuleId(long moduleId) |
protected AbstractSecurityToken |
setOwnerId(String ownerId) |
protected AbstractSecurityToken |
setTimeSource(TimeSource timeSource)
This method is mostly used for test code to test the expire methods.
|
protected AbstractSecurityToken |
setTrustedJson(String trustedJson) |
protected AbstractSecurityToken |
setViewerId(String viewerId) |
Map<String,String> |
toMap()
A
Map representation of this SecurityToken. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAuthenticationMode, getUpdatedToken, isAnonymouspublic static final int DEFAULT_MAX_TOKEN_TTL
protected AbstractSecurityToken setTimeSource(TimeSource timeSource)
timeSource - The new TimeSource for this token to use.protected TimeSource getTimeSource()
public String getOwnerId()
getOwnerId in interface SecurityTokenprotected AbstractSecurityToken setOwnerId(String ownerId)
public String getViewerId()
getViewerId in interface SecurityTokenprotected AbstractSecurityToken setViewerId(String viewerId)
public String getAppId()
getAppId in interface SecurityTokenprotected AbstractSecurityToken setAppId(String appId)
public String getDomain()
getDomain in interface SecurityTokenprotected AbstractSecurityToken setDomain(String domain)
public String getContainer()
getContainer in interface SecurityTokenprotected AbstractSecurityToken setContainer(String container)
public String getAppUrl()
getAppUrl in interface SecurityTokenprotected AbstractSecurityToken setAppUrl(String appUrl)
public long getModuleId()
getModuleId in interface SecurityTokenprotected AbstractSecurityToken setModuleId(long moduleId)
public Long getExpiresAt()
getExpiresAt in interface SecurityTokennull if unknown or indeterminate.protected AbstractSecurityToken setExpires()
setExpires(int)protected AbstractSecurityToken setExpires(int tokenTTL)
tokenTTL - the time to live (in seconds) of the tokenprotected AbstractSecurityToken setExpiresAt(Long expiresAt)
expiresAt - When this token expires, in seconds since epoch.public String getTrustedJson()
getTrustedJson in interface SecurityTokenprotected AbstractSecurityToken setTrustedJson(String trustedJson)
public boolean isExpired()
isExpired in interface SecurityTokenpublic AbstractSecurityToken enforceNotExpired() throws BlobExpiredException
BlobExpiredExceptionpublic String getActiveUrl()
getActiveUrl in interface SecurityTokenprotected AbstractSecurityToken setActiveUrl(String activeUrl)
public Map<String,String> toMap()
Map representation of this SecurityToken. Implementors that
handle additional keys not contained in AbstractSecurityToken.Keys should override and
supplement the functionality of this method.AbstractSecurityToken.Keys.getMapKeys(),
loadFromMap(Map)protected int getMaxTokenTTL()
SecurityTokenCodec.encodeToken(SecurityToken), e.g., OAuth state tokens. For all other
cases, the SecurityTokenCodec will handle the time to live of the token.SecurityTokenCodec.getTokenTimeToLive(String)protected AbstractSecurityToken loadFromMap(Map<String,String> map)
map - The map of values.getMapKeys(),
toMap()protected abstract EnumSet<AbstractSecurityToken.Keys> getMapKeys()
toMap() and
#loadFromMap(SecurityToken, Map) helper methods.
toMap() if they might contain
useful information.AbstractSecurityToken.Copyright © 2007-2014 The Apache Software Foundation. All Rights Reserved.