Package org.apache.rampart
Class NonceCache
java.lang.Object
org.apache.rampart.AbstractUniqueMessageAttributeCache
org.apache.rampart.NonceCache
- All Implemented Interfaces:
UniqueMessageAttributeCache
This is a basic implementation of UniqueMessageAttributeCache. In this implementation we will cache incomming
nonce value for a period of time. The life time can be defined in the services.xml. If not defined
the default value will be 5 minutes.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToCache(String id, String userName) Add value to a cache.voidClears all recorded nonce values/sequence numbers.booleanvalueExistsInCache(String id, String userName) Checks whether value already exists in the cache for a given user name.Methods inherited from class org.apache.rampart.AbstractUniqueMessageAttributeCache
getMaximumLifeTimeOfAnAttribute, setMaximumLifeTimeOfAnAttribute
-
Constructor Details
-
NonceCache
public NonceCache() -
NonceCache
public NonceCache(int maxLifeTime)
-
-
Method Details
-
addToCache
Description copied from interface:UniqueMessageAttributeCacheAdd value to a cache. Value can be sequence or nonce value.- Parameters:
id- - Nonce value or sequence number.userName- - User name parameter value of the UserNameToken.
-
valueExistsInCache
Description copied from interface:UniqueMessageAttributeCacheChecks whether value already exists in the cache for a given user name.- Parameters:
id- - Nonce or sequence id value of the newly received message.userName- - User name parameter value of the UserName token.- Returns:
- Returns true if nonce or sequence id is already received for given user name. Else false.
-
clearCache
public void clearCache()Description copied from interface:UniqueMessageAttributeCacheClears all recorded nonce values/sequence numbers.
-