org.openid4java.consumer
Class AbstractNonceVerifier
java.lang.Object
org.openid4java.consumer.AbstractNonceVerifier
- All Implemented Interfaces:
- NonceVerifier
- Direct Known Subclasses:
- EhcacheNonceVerifier, InMemoryNonceVerifier, JdbcNonceVerifier.GenericNonceVerifier
public abstract class AbstractNonceVerifier
- extends java.lang.Object
- implements NonceVerifier
- Author:
- Marius Scurtescu, Johnny Bufu
Method Summary |
int |
getMaxAge()
Returns the expiration timeout for nonces, in seconds. |
protected boolean |
isTooOld(java.util.Date now,
java.util.Date nonce)
|
protected abstract int |
seen(java.util.Date now,
java.lang.String opUrl,
java.lang.String nonce)
Subclasses should implement this method and check if the nonce was seen before. |
int |
seen(java.lang.String opUrl,
java.lang.String nonce)
Checks if nonce date is valid and if it is in the max age boundary. |
void |
setMaxAge(int ageSeconds)
Sets the expiration timeout for nonces, in seconds. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_log
private static org.apache.commons.logging.Log _log
DEBUG
private static final boolean DEBUG
_dateFormat
protected static InternetDateFormat _dateFormat
_maxAgeSeconds
protected int _maxAgeSeconds
AbstractNonceVerifier
protected AbstractNonceVerifier(int maxAge)
- Parameters:
maxAge
- maximum token age in seconds
getMaxAge
public int getMaxAge()
- Description copied from interface:
NonceVerifier
- Returns the expiration timeout for nonces, in seconds.
- Specified by:
getMaxAge
in interface NonceVerifier
setMaxAge
public void setMaxAge(int ageSeconds)
- Description copied from interface:
NonceVerifier
- Sets the expiration timeout for nonces, in seconds.
- Specified by:
setMaxAge
in interface NonceVerifier
seen
public int seen(java.lang.String opUrl,
java.lang.String nonce)
- Checks if nonce date is valid and if it is in the max age boundary. Other checks are delegated to
seen(java.util.Date, String, String)
- Specified by:
seen
in interface NonceVerifier
- Returns:
NonceVerifier.OK
only if this nonce has a valid time stamp, the time stamp did not age and the nonce was not
seen before.
seen
protected abstract int seen(java.util.Date now,
java.lang.String opUrl,
java.lang.String nonce)
- Subclasses should implement this method and check if the nonce was seen before.
The nonce timestamp was verified at this point, it is valid and it is in the max age boudary.
- Parameters:
now
- The timestamp used to check the max age boudary.
isTooOld
protected boolean isTooOld(java.util.Date now,
java.util.Date nonce)
Copyright 2006-2008 Sxip Identity Corporation