Package io.vertigo.vega.impl.token
Class TokenManagerImpl
- java.lang.Object
-
- io.vertigo.vega.impl.token.TokenManagerImpl
-
- All Implemented Interfaces:
io.vertigo.core.node.component.Component,io.vertigo.core.node.component.CoreComponent,io.vertigo.core.node.component.Manager,TokenManager
public final class TokenManagerImpl extends Object implements TokenManager
Ui data security token. Keep an security token by user and DtObject.- Author:
- npiedeloup
-
-
Constructor Summary
Constructors Constructor Description TokenManagerImpl(String collection, VSecurityManager securityManager, io.vertigo.datastore.kvstore.KVStoreManager kvStoreManager)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<Serializable>get(String objectUUID)Get object by key.Optional<Serializable>getAndRemove(String objectUUID)Get and remove object by key.Stringput(Serializable data)Store object and return unique key.
-
-
-
Constructor Detail
-
TokenManagerImpl
@Inject public TokenManagerImpl(String collection, VSecurityManager securityManager, io.vertigo.datastore.kvstore.KVStoreManager kvStoreManager)
Constructor.- Parameters:
collection- Collection's namesecurityManager- Security managerkvStoreManager- KV store manager
-
-
Method Detail
-
put
public String put(Serializable data)
Store object and return unique key. Same object can be put multiple times, always return a new unique key.- Specified by:
putin interfaceTokenManager- Parameters:
data- Object to store- Returns:
- unique key of this object
-
get
public Optional<Serializable> get(String objectUUID)
Get object by key.- Specified by:
getin interfaceTokenManager- Parameters:
objectUUID- key of this object- Returns:
- Object store
-
getAndRemove
public Optional<Serializable> getAndRemove(String objectUUID)
Get and remove object by key.- Specified by:
getAndRemovein interfaceTokenManager- Parameters:
objectUUID- key of this object- Returns:
- Object store or null if unknown
-
-