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 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:
      start in interface io.vertigo.core.node.component.Activeable
    • stop

      public void stop()
      Specified by:
      stop in interface io.vertigo.core.node.component.Activeable
    • getCollections

      public List<KVCollection> getCollections()
      Description copied from interface: KVStorePlugin
      Returns the list of collections managed by this plugin.
      Specified by:
      getCollections in interface KVStorePlugin
      Returns:
      list of collections;
    • count

      public int count(KVCollection collection)
      Specified by:
      count in interface KVStorePlugin
      Parameters:
      collection - the collection
      Returns:
      count of elements into collection
    • put

      public void put(KVCollection collection, String id, Object element)
      Description copied from interface: KVStorePlugin
      Adds an element defined by an id in a collection.
      Specified by:
      put in interface KVStorePlugin
      Parameters:
      collection - the collection
      id - the id
      element - the element
    • remove

      public boolean remove(KVCollection collection, String id)
      Description copied from interface: KVStorePlugin
      Removes an element defined by an id from a collection.
      Specified by:
      remove in interface KVStorePlugin
      Parameters:
      collection - the collection
      id - the id
      Returns:
      if element exists before removed
    • clear

      public void clear(KVCollection collection)
      Description copied from interface: KVStorePlugin
      Removes all elements from a collection.
      Specified by:
      clear in interface KVStorePlugin
      Parameters:
      collection - the collection
    • find

      public <C> Optional<C> find(KVCollection collection, String id, Class<C> clazz)
      Description copied from interface: KVStorePlugin
      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:
      find in interface KVStorePlugin
      Type Parameters:
      C - Element type
      Parameters:
      collection - the collection
      id - the id
      clazz - the type of the searched element
      Returns:
      the option
    • findAll

      public <C> List<C> findAll(KVCollection collection, int skip, Integer limit, Class<C> clazz)
      Description copied from interface: KVStorePlugin
      Finds all elements contained inside the specified collection.
      Specified by:
      findAll in interface KVStorePlugin
      Type Parameters:
      C - Element type
      Parameters:
      collection - the collection
      skip - the position from which the elements are returned
      limit - the limit size of elements
      clazz - the type of the searched element
      Returns:
      the list of elements.