public class HazelCastTokenStore extends Object implements TokenStore
| Modifier and Type | Field and Description |
|---|---|
static long |
DEFAULT_TTL |
static long |
MAX_TTL |
| Constructor and Description |
|---|
HazelCastTokenStore(String mapName) |
| 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 |
destroy() |
com.hazelcast.core.HazelcastInstance |
getHazelcastInstance()
Get the Hazelcast instance
If null, return Default instance
|
SecurityToken |
getToken(String identifier)
Returns the
Token of the given identifier |
Collection<String> |
getTokenIdentifiers()
Return the list of all valid token identifiers.
|
long |
getTTL()
Get the (default) TTL value in seconds
|
void |
remove(String identifier)
Remove an existing token by its identifier
|
void |
setHazelcastInstance(com.hazelcast.core.HazelcastInstance hazelcastInstance)
Set the Hazelcast instance, otherwise default instance used
If you configure Hazelcast instance in spring, you must inject the instance here.
|
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 HazelCastTokenStore(String mapName)
public com.hazelcast.core.HazelcastInstance getHazelcastInstance()
hzInstance - Hazelcast instancepublic void setHazelcastInstance(com.hazelcast.core.HazelcastInstance hazelcastInstance)
hzInstance - Hazelcast instancepublic void setTTL(long newTtl)
newTtl - a new (default) TTL value in secondspublic long getTTL()
public void add(SecurityToken token)
TokenStoreadd in interface TokenStoretoken - The token to be addedpublic void add(String identifier, SecurityToken token)
TokenStoreadd in interface TokenStoreidentifier - The identifier to use to key the SecurityToken in the cachetoken - The token to be addedpublic void remove(String identifier)
TokenStoreremove in interface TokenStorepublic Collection<String> getTokenIdentifiers()
TokenStoregetTokenIdentifiers in interface TokenStorepublic SecurityToken getToken(String identifier)
TokenStoreToken of the given identifiergetToken in interface TokenStoreToken identified by the given identifierpublic void destroy()
Apache CXF