|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
org.apache.directory.server.kerberos.shared.replay.InMemoryReplayCache
public class InMemoryReplayCache
"The replay cache will store at least the server name, along with the client name, time, and microsecond fields from the recently-seen authenticators, and if a matching tuple is found, the KRB_AP_ERR_REPEAT error is returned." We will store the entries using an HashMap which key will be the client principal, and we will store a list of entries for each client principal. A thread will run every N seconds to clean the cache from entries out of the clockSkew
Nested Class Summary | |
---|---|
class |
InMemoryReplayCache.ReplayCacheEntry
A structure to hold an entry |
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
InMemoryReplayCache()
Creates a new instance of InMemoryReplayCache. |
|
InMemoryReplayCache(int delay)
Creates a new instance of InMemoryReplayCache. |
|
InMemoryReplayCache(long clockSkew)
Creates a new instance of InMemoryReplayCache. |
|
InMemoryReplayCache(long clockSkew,
int delay)
Creates a new instance of InMemoryReplayCache. |
Method Summary | |
---|---|
java.util.Map<javax.security.auth.kerberos.KerberosPrincipal,java.util.List<InMemoryReplayCache.ReplayCacheEntry>> |
getCache()
|
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 |
run()
The cleaning thread. |
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. |
void |
setDelay(long delay)
Set the delay between each cleaning thread run. |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public InMemoryReplayCache()
public InMemoryReplayCache(long clockSkew)
clockSkew
- the allowed skew (milliseconds)public InMemoryReplayCache(long clockSkew, int delay)
clockSkew
- the allowed skew (milliseconds)delay
- the interval between each run of the cache
cleaning thread (milliseconds)public InMemoryReplayCache(int delay)
delay
- the interval between each run of the cache
cleaning thread (milliseconds).Method Detail |
---|
public void setClockSkew(long clockSkew)
clockSkew
- public void setDelay(long delay)
delay
- delay in millisecondspublic boolean isReplay(javax.security.auth.kerberos.KerberosPrincipal serverPrincipal, javax.security.auth.kerberos.KerberosPrincipal clientPrincipal, KerberosTime clientTime, int clientMicroSeconds)
isReplay
in interface ReplayCache
serverPrincipal
- The server principalclientPrincipal
- The client principalclientTime
- The client timeclientMicroSeconds
- The client microsecond
public void save(javax.security.auth.kerberos.KerberosPrincipal serverPrincipal, javax.security.auth.kerberos.KerberosPrincipal clientPrincipal, KerberosTime clientTime, int clientMicroSeconds)
save
in interface ReplayCache
serverPrincipal
- The server principalclientPrincipal
- The client principalclientTime
- The client timeclientMicroSeconds
- The client microsecondpublic java.util.Map<javax.security.auth.kerberos.KerberosPrincipal,java.util.List<InMemoryReplayCache.ReplayCacheEntry>> getCache()
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |