Interface TokenStore
-
- All Known Implementing Classes:
DefaultInMemoryTokenStore,EHCacheTokenStore,HazelCastTokenStore,MemoryTokenStore
public interface TokenStoreThis interface defines a caching mechanism for security tokens. It is up to the underlying implementation to handle token expiration (e.g. by querying the SecurityToken's expires date).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidadd(String identifier, SecurityToken token)Add the given token to the cache under the given identifiervoidadd(SecurityToken token)Add the given token to the cache.SecurityTokengetToken(String identifier)Returns theTokenof the given identifierCollection<String>getTokenIdentifiers()Return the list of all valid token identifiers.voidremove(String identifier)Remove an existing token by its identifier
-
-
-
Method Detail
-
add
void add(SecurityToken token)
Add the given token to the cache. The SecurityTokens getId() identifier will be used to key it in the cache.- Parameters:
token- The token to be added
-
add
void add(String identifier, SecurityToken token)
Add the given token to the cache under the given identifier- Parameters:
identifier- The identifier to use to key the SecurityToken in the cachetoken- The token to be added
-
remove
void remove(String identifier)
Remove an existing token by its identifier
-
getTokenIdentifiers
Collection<String> getTokenIdentifiers()
Return the list of all valid token identifiers.- Returns:
- As array of (valid) token identifiers
-
getToken
SecurityToken getToken(String identifier)
Returns theTokenof the given identifier- Parameters:
identifier-- Returns:
- The requested
Tokenidentified by the given identifier
-
-