Interface BucketDataAccessProvider

All Superinterfaces:
DataAccessProvider

public interface BucketDataAccessProvider extends DataAccessProvider
A DataAccessProvider for reading and storing arbitrary attributes.

All implementations and backing data sources are expected to treat subject and purpose as a composite key, meaning that the same subject may be reused for multiple purposes, but it's associated attributes will always be unique for a given purpose.

The data model currently supports updating the entire attributes object in place, i.e. the attributes are first to be fetched, updated and then stored back.

Since:
3.0.0
  • Method Details

    • getAttributes

      Map<String,Object> getAttributes(String subject, String purpose)
      Get all attributes associated with the given subject and purpose.
      Parameters:
      subject - The subject for which to get attributes
      purpose - The purpose (i.e. "action") for which the subject's attributes should be retrieved for
      Returns:
      All attributes found for the given subject and purpose (empty if no attributes found)
    • storeAttributes

      Map<String,Object> storeAttributes(String subject, String purpose, Map<String,Object> attributes)
      Persist provided attributes for the given subject and purpose. This method overwrites any previous attributes.
      Parameters:
      subject - The subject for which to store attributes
      purpose - The purpose for which the stored attributes are stored
      attributes - The attributes
      Returns:
      The attributes that were stored with the request
    • clearBucket

      boolean clearBucket(String subject, String purpose)
      Delete all attributes on a given subject and purpose.
      Parameters:
      subject - The subject for which to delete any stored attributes
      purpose - The purpose for which to delete any stored attributes
      Returns:
      Whether anything was deleted as a result of this method being called