Interface IdentifiableResourceDataAccessProvider<A extends ResourceAttributes<?>>

All Superinterfaces:
DataAccessProvider
All Known Subinterfaces:
DeviceDataAccessProvider, UserAccountDataAccessProvider

public interface IdentifiableResourceDataAccessProvider<A extends ResourceAttributes<?>> extends DataAccessProvider
  • Method Details

    • fromAttributes

      @Nullable A fromAttributes(@Nullable Iterable<Attribute> attributes)
    • getById

      @Nullable A getById(String id)
      Get the resource by ID.
      Parameters:
      id - of resource
      Returns:
      the resource with the given ID, or null if none is found.
    • getAll

      ResourceQueryResult getAll(long startIndex, long count)
      Get all resources (paginated).
      Parameters:
      startIndex - 0-index of first resource to return
      count - maximum number of resources to return
      Returns:
      all resources between index from and from + length
    • getAll

      default ResourceQueryResult getAll(ResourceQuery query)
      Get all resources after applying the provided query.

      The default implementation simply delegates to getAll(long, long) and programmatically selects attributes if necessary. Unless the data access provider has absolutely no way to implement dynamic queries, this method should be overridden by subclasses.

      Notice that because the query may filter out attributes, this method does not necessarily return elements of type IdentifiableResourceDataAccessProvider.

      Parameters:
      query - the resource query
      Returns:
      all resources satisfying the provided query constraints.