public class ReplayCacheImpl extends java.lang.Object implements ReplayCache
| Modifier and Type | Class and Description |
|---|---|
private class |
ReplayCacheImpl.ClockskewExpirationPolicy
an expiration policy based on the clockskew
|
static class |
ReplayCacheImpl.ReplayCacheEntry
A structure to hold an entry
|
| Modifier and Type | Field and Description |
|---|---|
private net.sf.ehcache.Cache |
cache
ehcache based storage to store the entries
|
private long |
clockSkew
The clock skew
|
private static long |
DEFAULT_CLOCK_SKEW
default clock skew
|
private static org.slf4j.Logger |
LOG |
| Constructor and Description |
|---|
ReplayCacheImpl(net.sf.ehcache.Cache cache)
Creates a new instance of InMemoryReplayCache.
|
ReplayCacheImpl(net.sf.ehcache.Cache cache,
long clockSkew)
Creates a new instance of InMemoryReplayCache.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
removes all the elements present in the cache
|
boolean |
isReplay(javax.security.auth.kerberos.KerberosPrincipal serverPrincipal,
javax.security.auth.kerberos.KerberosPrincipal clientPrincipal,
KerberosTime clientTime,
int clientMicroSeconds)
Check if an entry is a replay or not.
|
void |
save(javax.security.auth.kerberos.KerberosPrincipal serverPrincipal,
javax.security.auth.kerberos.KerberosPrincipal clientPrincipal,
KerberosTime clientTime,
int clientMicroSeconds)
Add a new entry into the cache.
|
void |
setClockSkew(long clockSkew)
Sets the clock skew.
|
private static final org.slf4j.Logger LOG
private net.sf.ehcache.Cache cache
private static final long DEFAULT_CLOCK_SKEW
private long clockSkew
public ReplayCacheImpl(net.sf.ehcache.Cache cache)
public ReplayCacheImpl(net.sf.ehcache.Cache cache,
long clockSkew)
clockSkew - the allowed skew (milliseconds)public void setClockSkew(long clockSkew)
clockSkew - public boolean isReplay(javax.security.auth.kerberos.KerberosPrincipal serverPrincipal,
javax.security.auth.kerberos.KerberosPrincipal clientPrincipal,
KerberosTime clientTime,
int clientMicroSeconds)
isReplay in interface ReplayCacheserverPrincipal - The server principalclientPrincipal - The client principalclientTime - The client timeclientMicroSeconds - The client microsecondpublic void save(javax.security.auth.kerberos.KerberosPrincipal serverPrincipal,
javax.security.auth.kerberos.KerberosPrincipal clientPrincipal,
KerberosTime clientTime,
int clientMicroSeconds)
save in interface ReplayCacheserverPrincipal - The server principalclientPrincipal - The client principalclientTime - The client timeclientMicroSeconds - The client microsecondpublic void clear()
clear in interface ReplayCache