Interface PersistenceService


public interface PersistenceService
Created with IntelliJ IDEA. User: chenrot Date: 5/8/13 Time: 11:44 AM To change this template use File | Settings | File Templates.
  • Method Details

    • getFactory

      PersistenceFactory getFactory()
      Returns:
      a factory for creating persistence objects
    • store

      Map<PersistenceKey,PersistenceUnit> store(Collection<PersistenceUnit> persistenceUnitsToStore)
      Stores a key-value resources for the given persistence units. The keys are not unique and there might be more than 1 value for it, the resource is uniquely identified by its key and id.
      Parameters:
      persistenceUnitsToStore - a collection
      Returns:
      map of keys to values that were stored
    • list

      Returns a list of all the keys with the metadata of the values associated with the given key.
      Parameters:
      key - the key to lookup with.
      Returns:
      collection of all the keys with the metadata of the values associated with the given key.
    • list

      Collection<PersistenceKey> list(String key, long createdSince)
      Returns a list of all the keys with the metadata of the values associated with the given key that were create at or after the given timestamp.
      Parameters:
      key - the key to lookup with.
      createdSince - the timestamp.
      Returns:
      a collection of all the keys with the metadata of the values associated with the given key that were create at or after the given timestamp.
    • get

      PersistenceUnit get(String key, String id)
      Returns the value of the resource identified by the key and id
      Parameters:
      key - the stored key
      id - the stored id
      Returns:
      the value of the resource identified by the key and id, returns null if there is no resource identified by the key and id.
    • deleteAll

      void deleteAll(String key)
      Deletes all the resources with the given key
      Parameters:
      key - the key of the resources to delete
    • delete

      void delete(String key, Collection<String> idsToRemove)
      Deletes all the values of the given key and ids
      Parameters:
      key - the key of the resources to delete
      idsToRemove - the ids of the resources to delete