Apache CXF API

org.apache.cxf.ws.security.cache
Class EHCacheReplayCache

java.lang.Object
  extended by org.apache.cxf.ws.security.cache.EHCacheReplayCache
All Implemented Interfaces:
Closeable, BusLifeCycleListener, org.apache.ws.security.cache.ReplayCache

public class EHCacheReplayCache
extends Object
implements org.apache.ws.security.cache.ReplayCache, Closeable, BusLifeCycleListener

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


Field Summary
static long DEFAULT_TTL
           
static long MAX_TTL
           
 
Constructor Summary
EHCacheReplayCache(String key, Bus b, URL configFileURL)
           
 
Method Summary
 void add(String identifier)
          Add the given identifier to the cache.
 void add(String identifier, long timeToLive)
          Add the given identifier to the cache to be cached for the given time
 void close()
           
 boolean contains(String identifier)
          Return true if the given identifier is contained in the cache
 long getTTL()
          Get the (default) TTL value in seconds
 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 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
Constructor Detail

EHCacheReplayCache

public EHCacheReplayCache(String key,
                          Bus b,
                          URL configFileURL)
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

add

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

Specified by:
add in interface org.apache.ws.security.cache.ReplayCache
Parameters:
identifier - The identifier to be added

add

public void add(String identifier,
                long timeToLive)
Add the given identifier to the cache to be cached for the given time

Specified by:
add in interface org.apache.ws.security.cache.ReplayCache
Parameters:
identifier - The identifier to be added
timeToLive - The length of time to cache the Identifier in seconds

contains

public boolean contains(String identifier)
Return true if the given identifier is contained in the cache

Specified by:
contains in interface org.apache.ws.security.cache.ReplayCache
Parameters:
identifier - The identifier to check

close

public void close()
Specified by:
close in interface Closeable

initComplete

public void initComplete()
Description copied from interface: BusLifeCycleListener
Invoked when the Bus has been initialized.

Specified by:
initComplete in interface BusLifeCycleListener

preShutdown

public void preShutdown()
Description copied from interface: BusLifeCycleListener
Invoked before the Bus is shutdown.

Specified by:
preShutdown in interface BusLifeCycleListener

postShutdown

public void postShutdown()
Description copied from interface: BusLifeCycleListener
Invoked after the Bus is shutdown.

Specified by:
postShutdown in interface BusLifeCycleListener

Apache CXF API

Apache CXF