Interface KVStorePlugin
- All Superinterfaces:
io.vertigo.core.node.component.CoreComponent,io.vertigo.core.node.component.Plugin
- All Known Implementing Classes:
BerkeleyKVStorePlugin,DelayedMemoryKVStorePlugin,EhCacheKVStorePlugin,H2KVStorePlugin,RedisKVStorePlugin,SpeedbKVStorePlugin
public interface KVStorePlugin
extends io.vertigo.core.node.component.Plugin
This plugin defines the strategy used to store a 'collection' of elements.
Each element is identified by a name.
- Author:
- pchretien
-
Method Summary
Modifier and TypeMethodDescriptionvoidclear(KVCollection collection) Removes all elements from a collection.intcount(KVCollection collection) <C> Optional<C> find(KVCollection collection, String id, 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.voidput(KVCollection collection, String id, Object element) Adds an element defined by an id in a collection.booleanremove(KVCollection collection, String id) Removes an element defined by an id from a collection.
-
Method Details
-
getCollections
List<KVCollection> getCollections()Returns the list of collections managed by this plugin.- Returns:
- list of collections;
-
count
- Parameters:
collection- the collection- Returns:
- count of elements into collection
-
put
Adds an element defined by an id in a collection.- Parameters:
collection- the collectionid- the idelement- the element
-
remove
Removes an element defined by an id from a collection.- Parameters:
collection- the collectionid- the id- Returns:
- if element exists before removed
-
clear
Removes all elements from a collection.- 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.- Type Parameters:
C- Element type- Parameters:
collection- the collectionid- the idclazz- the type of the searched element- Returns:
- the option
-
findAll
Finds all elements contained inside the specified collection.- 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.
-