Class DelayedMemoryKVStorePlugin
java.lang.Object
io.vertigo.datastore.plugins.kvstore.delayedmemory.DelayedMemoryKVStorePlugin
- All Implemented Interfaces:
io.vertigo.core.node.component.CoreComponent,io.vertigo.core.node.component.Plugin,io.vertigo.core.node.definition.DefinitionProvider,io.vertigo.core.node.definition.SimpleDefinitionProvider,KVStorePlugin
public final class DelayedMemoryKVStorePlugin
extends Object
implements KVStorePlugin, io.vertigo.core.node.definition.SimpleDefinitionProvider
Memory implementation of UiSecurityTokenCachePlugin.
This store ISN'T transactional !!
Purge is garantee by Timer every minute.
- Author:
- pchretien, npiedeloup
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class -
Constructor Summary
ConstructorsConstructorDescriptionDelayedMemoryKVStorePlugin(String collections, io.vertigo.core.daemon.DaemonManager daemonManager, int timeToLiveSeconds) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear(KVCollection collection) Removes all elements from a collection.intcount(KVCollection collection) <C> Optional<C> find(KVCollection collection, String key, Class<C> clazz) Finds the optional element to which the id is mapped inside the specified collection.<C> List<C> findAll(KVCollection collection, int skip, Integer limit, Class<C> clazz) Finds all elements contained inside the specified collection.Returns the list of collections managed by this plugin.List<? extends io.vertigo.core.node.definition.Definition> provideDefinitions(io.vertigo.core.node.definition.DefinitionSpace definitionSpace) voidput(KVCollection collection, String key, Object element) Adds an element defined by an id in a collection.booleanremove(KVCollection collection, String key) Removes an element defined by an id from a collection.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.vertigo.core.node.definition.DefinitionProvider
addDefinitionResourceConfigMethods inherited from interface io.vertigo.core.node.definition.SimpleDefinitionProvider
get
-
Constructor Details
-
DelayedMemoryKVStorePlugin
@Inject public DelayedMemoryKVStorePlugin(String collections, io.vertigo.core.daemon.DaemonManager daemonManager, int timeToLiveSeconds) Constructor.- Parameters:
collections- List of collections managed by this plugin (comma separated)daemonManager- Manager des daemonstimeToLiveSeconds- life time of elements (seconde)
-
-
Method Details
-
provideDefinitions
public List<? extends io.vertigo.core.node.definition.Definition> provideDefinitions(io.vertigo.core.node.definition.DefinitionSpace definitionSpace) - Specified by:
provideDefinitionsin interfaceio.vertigo.core.node.definition.SimpleDefinitionProvider
-
getCollections
Returns the list of collections managed by this plugin.- Specified by:
getCollectionsin interfaceKVStorePlugin- Returns:
- list of collections;
-
count
- Specified by:
countin interfaceKVStorePlugin- Parameters:
collection- the collection- Returns:
- count of elements into collection
-
put
Adds an element defined by an id in a collection.- Specified by:
putin interfaceKVStorePlugin- Parameters:
collection- the collectionkey- the idelement- the element
-
remove
Removes an element defined by an id from a collection.- Specified by:
removein interfaceKVStorePlugin- Parameters:
collection- the collectionkey- the id- Returns:
- if element exists before removed
-
clear
Removes all elements from a collection.- Specified by:
clearin interfaceKVStorePlugin- Parameters:
collection- the collection
-
find
Finds the optional element to which the id is mapped inside the specified collection. If the element is not found then an empty option is returned.- Specified by:
findin interfaceKVStorePlugin- Type Parameters:
C- Element type- Parameters:
collection- the collectionkey- the idclazz- the type of the searched element- Returns:
- the option
-
findAll
Finds all elements contained inside the specified collection.- Specified by:
findAllin interfaceKVStorePlugin- Type Parameters:
C- Element type- Parameters:
collection- the collectionskip- the position from which the elements are returnedlimit- the limit size of elementsclazz- the type of the searched element- Returns:
- the list of elements.
-