Class JCacheTokenStore
- java.lang.Object
-
- org.apache.cxf.ws.security.tokenstore.jcache.JCacheTokenStore
-
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.cxf.buslifecycle.BusLifeCycleListener,TokenStore
public class JCacheTokenStore extends Object implements TokenStore, Closeable, org.apache.cxf.buslifecycle.BusLifeCycleListener
An in-memory JCache implementation of the TokenStore interface. The default TTL is 60 minutes and the max TTL is 12 hours.
-
-
Constructor Summary
Constructors Constructor Description JCacheTokenStore(String key, org.apache.cxf.Bus b, URL configFileURL)
-
Method Summary
All Methods Instance Methods Concrete 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.voidclose()SecurityTokengetToken(String identifier)Returns theTokenof the given identifierCollection<String>getTokenIdentifiers()Return the list of all valid token identifiers.voidinitComplete()voidpostShutdown()voidpreShutdown()voidremove(String identifier)Remove an existing token by its identifier
-
-
-
Constructor Detail
-
JCacheTokenStore
public JCacheTokenStore(String key, org.apache.cxf.Bus b, URL configFileURL) throws TokenStoreException
- Throws:
TokenStoreException
-
-
Method Detail
-
add
public void add(SecurityToken token)
Description copied from interface:TokenStoreAdd the given token to the cache. The SecurityTokens getId() identifier will be used to key it in the cache.- Specified by:
addin interfaceTokenStore- Parameters:
token- The token to be added
-
add
public void add(String identifier, SecurityToken token)
Description copied from interface:TokenStoreAdd the given token to the cache under the given identifier- Specified by:
addin interfaceTokenStore- Parameters:
identifier- The identifier to use to key the SecurityToken in the cachetoken- The token to be added
-
remove
public void remove(String identifier)
Description copied from interface:TokenStoreRemove an existing token by its identifier- Specified by:
removein interfaceTokenStore
-
getTokenIdentifiers
public Collection<String> getTokenIdentifiers()
Description copied from interface:TokenStoreReturn the list of all valid token identifiers.- Specified by:
getTokenIdentifiersin interfaceTokenStore- Returns:
- As array of (valid) token identifiers
-
getToken
public SecurityToken getToken(String identifier)
Description copied from interface:TokenStoreReturns theTokenof the given identifier- Specified by:
getTokenin interfaceTokenStore- Returns:
- The requested
Tokenidentified by the given identifier
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
initComplete
public void initComplete()
- Specified by:
initCompletein interfaceorg.apache.cxf.buslifecycle.BusLifeCycleListener
-
preShutdown
public void preShutdown()
- Specified by:
preShutdownin interfaceorg.apache.cxf.buslifecycle.BusLifeCycleListener
-
postShutdown
public void postShutdown()
- Specified by:
postShutdownin interfaceorg.apache.cxf.buslifecycle.BusLifeCycleListener
-
-