Apache CXF API

org.apache.cxf.rs.security.saml.sso
Class EHCacheTokenReplayCache

java.lang.Object
  extended by org.apache.cxf.rs.security.saml.sso.EHCacheTokenReplayCache
All Implemented Interfaces:
Closeable, TokenReplayCache<String>

public class EHCacheTokenReplayCache
extends Object
implements TokenReplayCache<String>

An in-memory EHCache implementation of the TokenReplayCache interface. The default TTL is 60 minutes and the max TTL is 12 hours.


Field Summary
static String CACHE_KEY
           
static long DEFAULT_TTL
           
static long MAX_TTL
           
 
Constructor Summary
EHCacheTokenReplayCache()
           
EHCacheTokenReplayCache(Bus bus)
           
EHCacheTokenReplayCache(String configFileURL)
           
EHCacheTokenReplayCache(String configFileURL, Bus bus)
           
 
Method Summary
 void close()
           
 String getId(String id)
          Return the given identifier if it is contained in the cache, otherwise null.
 long getTTL()
          Get the (default) TTL value in seconds
 void putId(String id)
          Add the given identifier to the cache.
 void putId(String id, long timeToLive)
          Add the given identifier to the cache.
 void setTTL(long newTtl)
          Set a new (default) TTL value in seconds
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_TTL

public static final long DEFAULT_TTL
See Also:
Constant Field Values

MAX_TTL

public static final long MAX_TTL
See Also:
Constant Field Values

CACHE_KEY

public static final String CACHE_KEY
See Also:
Constant Field Values
Constructor Detail

EHCacheTokenReplayCache

public EHCacheTokenReplayCache()

EHCacheTokenReplayCache

public EHCacheTokenReplayCache(Bus bus)

EHCacheTokenReplayCache

public EHCacheTokenReplayCache(String configFileURL)

EHCacheTokenReplayCache

public EHCacheTokenReplayCache(String configFileURL,
                               Bus bus)
Method Detail

setTTL

public void setTTL(long newTtl)
Set a new (default) TTL value in seconds

Parameters:
newTtl - a new (default) TTL value in seconds

getTTL

public long getTTL()
Get the (default) TTL value in seconds

Returns:
the (default) TTL value in seconds

putId

public void putId(String id)
Add the given identifier to the cache. It will be cached for a default amount of time.

Specified by:
putId in interface TokenReplayCache<String>
Parameters:
id - The identifier to be added

putId

public void putId(String id,
                  long timeToLive)
Add the given identifier to the cache.

Specified by:
putId in interface TokenReplayCache<String>
Parameters:
identifier - The identifier to be added
timeToLive - The length of time to cache the Identifier in seconds

getId

public String getId(String id)
Return the given identifier if it is contained in the cache, otherwise null.

Specified by:
getId in interface TokenReplayCache<String>
Parameters:
id - The identifier to check

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Specified by:
close in interface TokenReplayCache<String>
Throws:
IOException

Apache CXF API

Apache CXF