Class EhCacheKVStorePlugin
java.lang.Object
io.vertigo.datastore.plugins.kvstore.ehcache.EhCacheKVStorePlugin
- All Implemented Interfaces:
io.vertigo.core.node.component.Activeable,io.vertigo.core.node.component.CoreComponent,io.vertigo.core.node.component.Plugin,KVStorePlugin
public final class EhCacheKVStorePlugin
extends Object
implements KVStorePlugin, io.vertigo.core.node.component.Activeable
Implémentation EHCache du KvStorePlugin.
- Author:
- pchretien, npiedeloup
-
Constructor Summary
ConstructorsConstructorDescriptionEhCacheKVStorePlugin(String collections, String dbFilePath, Optional<String> purgeVersion, io.vertigo.commons.transaction.VTransactionManager transactionManager, io.vertigo.commons.codec.CodecManager codecManager, io.vertigo.core.analytics.AnalyticsManager analyticsManager) Constructor. -
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.voidstart()voidstop()
-
Constructor Details
-
EhCacheKVStorePlugin
@Inject public EhCacheKVStorePlugin(String collections, String dbFilePath, Optional<String> purgeVersion, io.vertigo.commons.transaction.VTransactionManager transactionManager, io.vertigo.commons.codec.CodecManager codecManager, io.vertigo.core.analytics.AnalyticsManager analyticsManager) Constructor.- Parameters:
codecManager- CodecManager
-
-
Method Details
-
start
public void start()- Specified by:
startin interfaceio.vertigo.core.node.component.Activeable
-
stop
public void stop()- Specified by:
stopin interfaceio.vertigo.core.node.component.Activeable
-
getCollections
Description copied from interface:KVStorePluginReturns 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
Description copied from interface:KVStorePluginAdds an element defined by an id in a collection.- Specified by:
putin interfaceKVStorePlugin- Parameters:
collection- the collectionid- the idelement- the element
-
remove
Description copied from interface:KVStorePluginRemoves an element defined by an id from a collection.- Specified by:
removein interfaceKVStorePlugin- Parameters:
collection- the collectionid- the id- Returns:
- if element exists before removed
-
clear
Description copied from interface:KVStorePluginRemoves all elements from a collection.- Specified by:
clearin interfaceKVStorePlugin- Parameters:
collection- the collection
-
find
Description copied from interface:KVStorePluginFinds 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 collectionid- the idclazz- the type of the searched element- Returns:
- the option
-
findAll
Description copied from interface:KVStorePluginFinds 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.
-