public final class DelayedMemoryKVStorePlugin extends Object implements KVStorePlugin, SimpleDefinitionProvider
| Modifier and Type | Class and Description |
|---|---|
static class |
DelayedMemoryKVStorePlugin.RemoveTooOldElementsDaemon |
| Constructor and Description |
|---|
DelayedMemoryKVStorePlugin(String collections,
DaemonManager daemonManager,
int timeToLiveSeconds)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear(String collection)
Removes all elements from a collection.
|
int |
count(String collection) |
<C> Optional<C> |
find(String collection,
String key,
Class<C> clazz)
Finds the optional element to which the id is mapped inside the specified collection.
|
<C> List<C> |
findAll(String collection,
int skip,
Integer limit,
Class<C> clazz)
Finds all elements contained inside the specified collection.
|
List<String> |
getCollections()
Returns the list of collections managed by this plugin.
|
List<? extends Definition> |
provideDefinitions(DefinitionSpace definitionSpace) |
void |
put(String collection,
String key,
Object element)
Adds an element defined by an id in a collection.
|
void |
remove(String collection,
String key)
Removes an element defined by an id from a collection.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetaddDefinitionResourceConfig@Inject
public DelayedMemoryKVStorePlugin(@Named(value="collections")
String collections,
DaemonManager daemonManager,
@Named(value="timeToLiveSeconds")
int timeToLiveSeconds)
collections - List of collections managed by this plugin (comma separated)daemonManager - Manager des daemonstimeToLiveSeconds - life time of elements (seconde)public List<? extends Definition> provideDefinitions(DefinitionSpace definitionSpace)
provideDefinitions in interface SimpleDefinitionProviderpublic List<String> getCollections()
getCollections in interface KVStorePluginpublic int count(String collection)
count in interface KVStorePlugincollection - the collectionpublic void put(String collection, String key, Object element)
put in interface KVStorePlugincollection - the collectionkey - the idelement - the elementpublic void remove(String collection, String key)
remove in interface KVStorePlugincollection - the collectionkey - the idpublic void clear(String collection)
clear in interface KVStorePlugincollection - the collectionpublic <C> Optional<C> find(String collection, String key, Class<C> clazz)
find in interface KVStorePluginC - Element typecollection - the collectionkey - the idclazz - the type of the searched elementpublic <C> List<C> findAll(String collection, int skip, Integer limit, Class<C> clazz)
findAll in interface KVStorePluginC - Element typecollection - the collectionskip - the position from which the elements are returnedlimit - the limit size of elementsclazz - the type of the searched elementCopyright © 2019. All Rights Reserved.