public class LocalCachingAuthenticator<T extends Credentials> extends InitializableWebObject implements Authenticator<T>
guava
dependency to use this class.Modifier and Type | Field and Description |
---|---|
protected org.slf4j.Logger |
logger |
Constructor and Description |
---|
LocalCachingAuthenticator() |
LocalCachingAuthenticator(Authenticator<T> delegate,
long cacheSize,
long timeout,
TimeUnit timeUnit) |
Modifier and Type | Method and Description |
---|---|
boolean |
clearCache() |
long |
getCacheSize() |
Authenticator<T> |
getDelegate() |
long |
getTimeout() |
TimeUnit |
getTimeUnit() |
protected void |
internalInit(WebContext context)
Internal initialization of the object.
|
boolean |
isCached(T credentials) |
void |
removeFromCache(T credentials) |
void |
setCacheSize(long cacheSize) |
void |
setDelegate(Authenticator<T> delegate) |
void |
setTimeout(long timeout) |
void |
setTimeUnit(TimeUnit timeUnit) |
String |
toString() |
void |
validate(T credentials,
WebContext context)
Validate the credentials.
|
init, reinit
public LocalCachingAuthenticator()
public LocalCachingAuthenticator(Authenticator<T> delegate, long cacheSize, long timeout, TimeUnit timeUnit)
public void validate(T credentials, WebContext context) throws HttpAction
Authenticator
CredentialsException
in case of failure.validate
in interface Authenticator<T extends Credentials>
credentials
- the given credentialscontext
- the web contextHttpAction
- requires a specific HTTP action if necessaryprotected void internalInit(WebContext context)
InitializableWebObject
internalInit
in class InitializableWebObject
context
- the web contextpublic void removeFromCache(T credentials)
public boolean isCached(T credentials)
public boolean clearCache()
public Authenticator<T> getDelegate()
public void setDelegate(Authenticator<T> delegate)
public long getCacheSize()
public void setCacheSize(long cacheSize)
public long getTimeout()
public void setTimeout(long timeout)
public TimeUnit getTimeUnit()
public void setTimeUnit(TimeUnit timeUnit)
Copyright © 2016. All rights reserved.