public class EHCacheTokenStore extends Object implements TokenStore, Closeable, BusLifeCycleListener
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_TTL |
static long |
MAX_TTL |
Constructor and Description |
---|
EHCacheTokenStore(String key,
Bus b,
URL configFileURL) |
Modifier and Type | Method and Description |
---|---|
void |
add(SecurityToken token)
Add the given token to the cache.
|
void |
add(String identifier,
SecurityToken token)
Add the given token to the cache under the given identifier
|
void |
close() |
SecurityToken |
getToken(String identifier)
Returns the
Token of the given identifier |
Collection<String> |
getTokenIdentifiers()
Return the list of all valid token identifiers.
|
void |
initComplete()
Invoked when the
Bus has been initialized. |
void |
postShutdown()
Invoked after the
Bus is shutdown. |
void |
preShutdown()
Invoked before the
Bus is shutdown. |
void |
remove(String identifier)
Remove an existing token by its identifier
|
void |
setTTL(long newTtl)
Set a new (default) TTL value in seconds
|
public static final long DEFAULT_TTL
public static final long MAX_TTL
public void setTTL(long newTtl)
newTtl
- a new (default) TTL value in secondspublic void add(SecurityToken token)
TokenStore
add
in interface TokenStore
token
- The token to be addedpublic void add(String identifier, SecurityToken token)
TokenStore
add
in interface TokenStore
identifier
- The identifier to use to key the SecurityToken in the cachetoken
- The token to be addedpublic void remove(String identifier)
TokenStore
remove
in interface TokenStore
public Collection<String> getTokenIdentifiers()
TokenStore
getTokenIdentifiers
in interface TokenStore
public SecurityToken getToken(String identifier)
TokenStore
Token
of the given identifiergetToken
in interface TokenStore
Token
identified by the given identifierpublic void close()
close
in interface Closeable
close
in interface AutoCloseable
public void initComplete()
BusLifeCycleListener
Bus
has been initialized.initComplete
in interface BusLifeCycleListener
public void preShutdown()
BusLifeCycleListener
Bus
is shutdown.preShutdown
in interface BusLifeCycleListener
public void postShutdown()
BusLifeCycleListener
Bus
is shutdown.postShutdown
in interface BusLifeCycleListener
Apache CXF