Interface Storage

All Known Implementing Classes:
ConnectorStorage, CouchBaseStorage, LDAPConnectorStorage, MemoryStorage, MongoStorage, OrientDBStorage, PersonifyConnectorStorage

public interface Storage
  • Method Details

    • initialize

      void initialize(String type)
      Bootstrap your storage here
      Parameters:
      type - the type
    • get

      Map<String,Object> get(String id, Consumer consumer)
      Gets a entity by id
      Parameters:
      id - the id of the entity
      Returns:
      the entity
    • get

      Map<String,Object> get(String id, String version, Consumer consumer)
      Gets a antity by id and version
      Parameters:
      id - the id of the entity
      version - the version of the entity
      Returns:
      the entity
    • getVersions

      List<String> getVersions(String id, Consumer consumer)
      Gets the version of a specific entity
      Parameters:
      id - the id of the entity
      Returns:
      a list containing the versions
    • delete

      boolean delete(String id, Consumer consumer)
      Deletes a entity by id
      Parameters:
      id - the id of the entity
      Returns:
      boolean indicating success
    • deleteAll

      boolean deleteAll(Consumer consumer)
      Deletes all entities
      Returns:
      boolean indicating success
    • create

      void create(String id, Map<String,Object> object, Consumer consumer) throws ConstraintViolationException
      Creates a entity
      Parameters:
      id - the id of the entity
      object - the entity itself
      Throws:
      ConstraintViolationException - indicating if constraints are violated
    • update

      void update(String id, Map<String,Object> object, Consumer consumer) throws ConstraintViolationException
      Updates a entity
      Parameters:
      id - the id of the entity
      object - the entity itself
      Throws:
      ConstraintViolationException - indicating if constraints are violated
    • search

      List<Map> search(be.personify.util.SearchCriteria searchCriteria, int start, int count, String sortBy, String sortOrder, List<String> includeAttributes, Consumer consumer)
      Searches entities
      Parameters:
      searchCriteria - the searchcriteria
      start - the start position
      count - the number of results to returm
      sortBy - the sortby attributes separated by a comma
      sortOrder - the sortorder ( ascending or descending )
      Returns:
      a list containing the entities
    • search

      List<Map> search(be.personify.util.SearchCriteria searchCriteria, int start, int count, String sortBy, String sortOrder, Consumer consumer)
    • count

      long count(be.personify.util.SearchCriteria searchCriteria, Consumer consumer)
      Counts the results giving a searchcrtieria
      Parameters:
      searchCriteria - the searchcriteria
      Returns:
      a long indicating the number of results
    • flush

      void flush()
      Optional to implement : persist
    • tenantCompatible

      boolean tenantCompatible()