Interface ItemDao

All Known Implementing Classes:
MongoItemDao

public interface ItemDao
  • Method Details

    • getItemByIdOrName

      Item getItemByIdOrName(String identifier)
      Retrieves a single Item from the database by its id property or name property.
      Parameters:
      identifier - Either an id or name of the Item
      Returns:
      An representation of the Item as it exists in the database.
      Throws:
      NotFoundException - if the backing data store does not have an Item that is identified by the passed in identifier
    • getItems

      Pagination<Item> getItems(int offset, int count, List<String> tags, String category, String query)
      Returns all Items in the subset of items filtered by tags and the given offset position. The count parameter should be greater than 0, but may also be overridden by a system defined limit on the number of records that can be returned at once.
      Parameters:
      offset - the offset, which should be a positive integer
      count - a maximum amount of items to be returned, which should be a positive integer greater than 0
      tags - A set of tags to filter items by
      category -
      query - A search query to filter items by
      Returns:
      A Pagination of all Item records within the range specified by the offset and count parameters.
    • updateItem

      Item updateItem(Item item)
      Updates a given Item.
      Parameters:
      item - An Item to be updated.
      Returns:
      The updated representation of the Item as it exists in the database
      Throws:
      InvalidDataException - if the state of the passed in Item is invalid
    • createItem

      Item createItem(Item item)
      Creates a new Item. All properties except for the Id property must be set to valid values. The name property must also be unique in order for this call to succeed.
      Parameters:
      item - A new Item
      Returns:
      A representation of the Item as it exists in the database after a successful write.
      Throws:
      InvalidDataException - if the state of the passed in Item is invalid
      DuplicateException - if the passed in Item has a name that already exists