Package io.vertigo.datastore.kvstore
Interface KVStoreManager
-
- All Superinterfaces:
io.vertigo.core.node.component.Component
,io.vertigo.core.node.component.CoreComponent
,io.vertigo.core.node.component.Manager
- All Known Implementing Classes:
KVStoreManagerImpl
public interface KVStoreManager extends io.vertigo.core.node.component.Manager
Key Value Store. A store is composed of multiple KVStorePlugins. +---store +---KVStorePlugin : {name:plants type:BerkeleyDB} +---collection : flowers +---collection : trees +---collection : fungi +---KVStorePlugin : {name:UISecurityStore type:DelayedBerkeleyDB} +---collection : sessions- Author:
- pchretien
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
clear(String collection)
Removes all elements from a collection.int
count(String collection)
<C> Optional<C>
find(String collection, String id, 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 collectionvoid
put(String collection, String id, Object element)
Adds an element defined by an id in a collection.void
remove(String collection, String id)
Removes an element defined by an id from a collection.
-
-
-
Method Detail
-
count
int count(String collection)
- Parameters:
collection
- the collection- Returns:
- count of elements into collection
-
put
void put(String collection, String id, Object element)
Adds an element defined by an id in a collection.- Parameters:
collection
- the collectionid
- the idelement
- the element
-
remove
void remove(String collection, String id)
Removes an element defined by an id from a collection. If the collection doesn't contain the is then a exception is thrown.- Parameters:
collection
- the collectionid
- the id
-
clear
void clear(String collection)
Removes all elements from a collection.- Parameters:
collection
- the collection
-
find
<C> Optional<C> find(String collection, String id, Class<C> clazz)
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
<C> List<C> findAll(String collection, int skip, Integer limit, Class<C> clazz)
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.
-
-