Class CouchBaseStorage

java.lang.Object
be.personify.iam.scim.storage.impl.CouchBaseStorage
All Implemented Interfaces:
Storage

public class CouchBaseStorage extends Object implements Storage
Author:
wouter vdb Couchbase storage implementation
  • Constructor Details

    • CouchBaseStorage

      public CouchBaseStorage()
  • Method Details

    • create

      public void create(String id, Map<String,Object> object, Consumer consumer) throws ConstraintViolationException
      Creates the entry
      Specified by:
      create in interface Storage
      Parameters:
      id - the id of the entity
      object - the entity itself
      Throws:
      ConstraintViolationException - indicating if constraints are violated
    • get

      public Map<String,Object> get(String id, Consumer consumer)
      Gets the entry by id
      Specified by:
      get in interface Storage
      Parameters:
      id - the id of the entity
      Returns:
      the entity
    • delete

      public boolean delete(String id, Consumer consumer)
      Delete the entry by id
      Specified by:
      delete in interface Storage
      Parameters:
      id - the id of the entity
      Returns:
      boolean indicating success
    • update

      public void update(String id, Map<String,Object> object, Consumer consumer)
      Updates the thing
      Specified by:
      update in interface Storage
      Parameters:
      id - the id of the entity
      object - the entity itself
    • search

      public List<Map> search(be.personify.util.SearchCriteria searchCriteria, int start, int count, String sortBy, String sortOrder, Consumer consumer)
      Specified by:
      search in interface Storage
    • search

      public List<Map> search(be.personify.util.SearchCriteria searchCriteria, int start, int count, String sortBy, String sortOrder, List<String> includeAttributes, Consumer consumer)
      Description copied from interface: Storage
      Searches entities
      Specified by:
      search in interface Storage
      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
    • count

      public long count(be.personify.util.SearchCriteria searchCriteria, Consumer consumer)
      Description copied from interface: Storage
      Counts the results giving a searchcrtieria
      Specified by:
      count in interface Storage
      Parameters:
      searchCriteria - the searchcriteria
      Returns:
      a long indicating the number of results
    • flush

      public void flush()
      Description copied from interface: Storage
      Optional to implement : persist
      Specified by:
      flush in interface Storage
    • initialize

      public void initialize(String type)
      Initializes the thing
      Specified by:
      initialize in interface Storage
      Parameters:
      type - the type
    • get

      public Map<String,Object> get(String id, String version, Consumer consumer)
      Description copied from interface: Storage
      Gets a antity by id and version
      Specified by:
      get in interface Storage
      Parameters:
      id - the id of the entity
      version - the version of the entity
      Returns:
      the entity
    • getVersions

      public List<String> getVersions(String id, Consumer consumer)
      Description copied from interface: Storage
      Gets the version of a specific entity
      Specified by:
      getVersions in interface Storage
      Parameters:
      id - the id of the entity
      Returns:
      a list containing the versions
    • deleteAll

      public boolean deleteAll(Consumer consumer)
      Description copied from interface: Storage
      Deletes all entities
      Specified by:
      deleteAll in interface Storage
      Returns:
      boolean indicating success
    • tenantCompatible

      public boolean tenantCompatible()
      Specified by:
      tenantCompatible in interface Storage