org.apache.ws.security.cache
Class MemoryReplayCache

java.lang.Object
  extended by org.apache.ws.security.cache.MemoryReplayCache
All Implemented Interfaces:
ReplayCache

public class MemoryReplayCache
extends Object
implements ReplayCache

A simple in-memory HashSet based cache to prevent against replay attacks. The default TTL is 5 minutes and the max TTL is 60 minutes.


Field Summary
static long DEFAULT_TTL
           
static long MAX_TTL
           
 
Constructor Summary
MemoryReplayCache()
           
 
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
 boolean contains(String identifier)
          Return true if the given identifier is contained in the cache
protected  void processTokenExpiry()
           
 
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

MemoryReplayCache

public MemoryReplayCache()
Method Detail

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 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 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 ReplayCache
Parameters:
identifier - The identifier to check

processTokenExpiry

protected void processTokenExpiry()


Copyright © 2004–2014 The Apache Software Foundation. All rights reserved.