Package org.aktin.broker.auth
Class AuthCache
java.lang.Object
org.aktin.broker.auth.AuthCache
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
@Singleton public class AuthCache extends Object implements Flushable, Closeable
In memory cache for user objects which also has manages a last-contact timestamp.
- Author:
- R.W.Majeed
-
Constructor Summary
Constructors Constructor Description AuthCache()AuthCache(BrokerBackend backend)CDI constructor -
Method Summary
Modifier and Type Method Description voidclose()voidfillCachedAccessTimestamps(Iterable<Node> nodes)Get the cached last contact timestamp.voidflush()PrincipalgetPrincipal(AuthInfo info)Retrieve aPrincipaluser object for a client node.
-
Constructor Details
-
AuthCache
public AuthCache() -
AuthCache
CDI constructor- Parameters:
backend-
-
-
Method Details
-
getPrincipal
Retrieve aPrincipaluser object for a client node.- Parameters:
info- authentication info- Returns:
- user object
- Throws:
SQLExceptionIOException
-
fillCachedAccessTimestamps
Get the cached last contact timestamp. If the node did not have contact since server startup, the node's timestamp will not be modified.- Parameters:
nodes- nodes to update the timestamp
-
flush
- Specified by:
flushin interfaceFlushable- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-