Class EHCacheTokenStore
java.lang.Object
org.apache.cxf.ws.security.tokenstore.EHCacheTokenStore
- All Implemented Interfaces:
Closeable,AutoCloseable,BusLifeCycleListener,TokenStore
- Direct Known Subclasses:
DefaultInMemoryTokenStore
public class EHCacheTokenStore
extends Object
implements TokenStore, Closeable, BusLifeCycleListener
An in-memory EHCache implementation of the TokenStore interface. The default TTL is 60 minutes
and the max TTL is 12 hours.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(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()Returns theTokenof the given identifierReturn the list of all valid token identifiers.voidInvoked when theBushas been initialized.voidInvoked after theBusis shutdown.voidInvoked before theBusis shutdown.voidRemove an existing token by its identifier
-
Constructor Details
-
EHCacheTokenStore
- Throws:
TokenStoreException
-
-
Method Details
-
add
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
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
Description copied from interface:TokenStoreRemove an existing token by its identifier- Specified by:
removein interfaceTokenStore
-
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
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()Description copied from interface:BusLifeCycleListenerInvoked when theBushas been initialized.- Specified by:
initCompletein interfaceBusLifeCycleListener
-
preShutdown
public void preShutdown()Description copied from interface:BusLifeCycleListenerInvoked before theBusis shutdown.- Specified by:
preShutdownin interfaceBusLifeCycleListener
-
postShutdown
public void postShutdown()Description copied from interface:BusLifeCycleListenerInvoked after theBusis shutdown.- Specified by:
postShutdownin interfaceBusLifeCycleListener
-