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,
int cacheSize,
int timeout,
TimeUnit timeUnit) |
LocalCachingAuthenticator(Authenticator<T> delegate,
Store<T,CommonProfile> store) |
Modifier and Type | Method and Description |
---|---|
int |
getCacheSize() |
Authenticator<T> |
getDelegate() |
Store<T,CommonProfile> |
getStore() |
int |
getTimeout() |
TimeUnit |
getTimeUnit() |
protected void |
internalInit(WebContext context)
Internal initialization of the object.
|
boolean |
isCached(T credentials) |
void |
removeFromCache(T credentials) |
void |
setCacheSize(int cacheSize) |
void |
setDelegate(Authenticator<T> delegate) |
void |
setStore(Store<T,CommonProfile> store) |
void |
setTimeout(int 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, Store<T,CommonProfile> store)
public LocalCachingAuthenticator(Authenticator<T> delegate, int cacheSize, int timeout, TimeUnit timeUnit)
public void validate(T credentials, WebContext context) throws HttpAction, CredentialsException
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 necessaryCredentialsException
- the credentials are invalidprotected void internalInit(WebContext context)
InitializableWebObject
internalInit
in class InitializableWebObject
context
- the web contextpublic void removeFromCache(T credentials)
public boolean isCached(T credentials)
public Authenticator<T> getDelegate()
public void setDelegate(Authenticator<T> delegate)
public int getCacheSize()
public void setCacheSize(int cacheSize)
public int getTimeout()
public void setTimeout(int timeout)
public TimeUnit getTimeUnit()
public void setTimeUnit(TimeUnit timeUnit)
public Store<T,CommonProfile> getStore()
public void setStore(Store<T,CommonProfile> store)
Copyright © 2018. All rights reserved.