Interface InventoryLookupSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface InventoryLookupSession extends OsidSession

This session provides methods for retrieving Inventories . The Inventory represents a collection of items and models.

This session defines views that offer differing behaviors when retrieving multiple objects.

  • comparative view: elements may be silently omitted or re-ordered
  • plenary view: provides a complete set or is an error condition
  • isolated warehouse view: All inventory methods in this session operate, retrieve and pertain to inventories defined explicitly in the current warehouse. Using an isolated view is useful for managing Inventories with the InventoryAdminSession .
  • federated warehouse view: All inventory methods in this session operate, retrieve and pertain to all inventories defined in this warehouse and any other inventories implicitly available in this warehouse through warehouse inheritence.

Generally, the comparative view should be used for most applications as it permits operation even if there is data that cannot be accessed. The methods useFederatedWarehouseView() and useIsolatedWarehouseView() behave as a radio group and one should be selected before invoking any lookup methods.

  • Method Details

    • getWarehouseId

      Id getWarehouseId()
      Gets the Warehouse Id associated with this session.
      Returns:
      the Warehouse Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getWarehouse

      Gets the Warehouse associated with this session.
      Returns:
      the warehouse
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canLookupInventories

      boolean canLookupInventories()
      Tests if this user can perform Inventory lookups. A return of true does not guarantee successful authorization. A return of false indicates that it is known all methods in this session will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer lookup operations to unauthorized users.
      Returns:
      false if lookup methods are not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • useComparativeInventoryView

      void useComparativeInventoryView()
      The returns from the lookup methods may omit or translate elements based on this session, such as authorization, and not result in an error. This view is used when greater interoperability is desired at the expense of precision.
      Compliance:
      mandatory - This method is must be implemented.
    • usePlenaryInventoryView

      void usePlenaryInventoryView()
      A complete view of the Inventory returns is desired. Methods will return what is requested or result in an error. This view is used when greater precision is desired at the expense of interoperability.
      Compliance:
      mandatory - This method is must be implemented.
    • useFederatedWarehouseView

      void useFederatedWarehouseView()
      Federates the view for methods in this session. A federated view will include inventories in warehouses which are children of this warehouse in the warehouse hierarchy.
      Compliance:
      mandatory - This method is must be implemented.
    • useIsolatedWarehouseView

      void useIsolatedWarehouseView()
      Isolates the view for methods in this session. An isolated view restricts lookups to this warehouse only.
      Compliance:
      mandatory - This method is must be implemented.
    • getInventory

      Gets the Inventory specified by its Id . In plenary mode, the exact Id is found or a NOT_FOUND results. Otherwise, the returned Inventory may have a different Id than requested, such as the case where a duplicate Id was assigned to an Inventory and retained for compatibility.
      Parameters:
      inventoryId - Id of the Inventory
      Returns:
      the inventory
      Throws:
      NotFoundException - inventoryId not found
      NullArgumentException - inventoryId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method is must be implemented.
    • getInventoriesByIds

      Gets an InventoryList corresponding to the given IdList . In plenary mode, the returned list contains all of the inventories specified in the Id list, in the order of the list, including duplicates, or an error results if an Id in the supplied list is not found or inaccessible. Otherwise, inaccessible Inventories may be omitted from the list and may present the elements in any order including returning a unique set.
      Parameters:
      inventoryIds - the list of Ids to retrieve
      Returns:
      the returned Inventory list
      Throws:
      NotFoundException - an Id was not found
      NullArgumentException - inventoryIds is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getInventoriesByGenusType

      InventoryList getInventoriesByGenusType(Type inventoryGenusType) throws OperationFailedException, PermissionDeniedException
      Gets an InventoryList corresponding to the given inventory genus Type which does not include inventories of genus types derived from the specified Type .In plenary mode, the returned list contains all known inventories or an error results. Otherwise, the returned list may contain only those inventories that are accessible through this session.
      Parameters:
      inventoryGenusType - an inventory genus type
      Returns:
      the returned Inventory list
      Throws:
      NullArgumentException - inventoryGenusType is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getInventoriesByParentGenusType

      InventoryList getInventoriesByParentGenusType(Type inventoryGenusType) throws OperationFailedException, PermissionDeniedException
      Gets an InventoryList corresponding to the given inventory genus Type and include any additional inventories with genus types derived from the specified Type . In plenary mode, the returned list contains all known inventories or an error results. Otherwise, the returned list may contain only those inventories that are accessible through this session.
      Parameters:
      inventoryGenusType - an inventory genus type
      Returns:
      the returned Inventory list
      Throws:
      NullArgumentException - inventoryGenusType is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getInventoriesByRecordType

      InventoryList getInventoriesByRecordType(Type inventoryRecordType) throws OperationFailedException, PermissionDeniedException
      Gets an InventoryList containing the given inventory record Type . In plenary mode, the returned list contains all known inventories or an error results. Otherwise, the returned list may contain only those inventories that are accessible through this session.
      Parameters:
      inventoryRecordType - an inventory record type
      Returns:
      the returned Inventory list
      Throws:
      NullArgumentException - inventoryRecordType is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getRecentInventories

      Gets the most recent Inventories . In plenary mode, the returned list contains all known inventories or an error results. Otherwise, the returned list may contain only those inventories that are accessible through this session.
      Returns:
      the returned Inventory list
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getInventoriesByDate

      Gets Inventories between the given date range inclusive. In plenary mode, the returned list contains all known inventories or an error results. Otherwise, the returned list may contain only those inventories that are accessible through this session.
      Parameters:
      from - starting date
      to - ending date
      Returns:
      the returned Inventory list
      Throws:
      InvalidArgumentException - from is greater than to
      NullArgumentException - from or to is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getInventoriesForStock

      InventoryList getInventoriesForStock(Id stockId) throws OperationFailedException, PermissionDeniedException
      Gets all Inventories for the given Stock . In plenary mode, the returned list contains all known inventories or an error results. Otherwise, the returned list may contain only those inventories that are accessible through this session.
      Parameters:
      stockId - a stock Id
      Returns:
      the returned Inventory list
      Throws:
      NullArgumentException - stockId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getRecentInventoriesForStock

      InventoryList getRecentInventoriesForStock(Id stockId) throws OperationFailedException, PermissionDeniedException
      Gets the most recent Inventories for with the given Stock . In plenary mode, the returned list contains all known inventories or an error results. Otherwise, the returned list may contain only those inventories that are accessible through this session.
      Parameters:
      stockId - an inventory Id
      Returns:
      the returned Inventory list
      Throws:
      NullArgumentException - stockId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getInventoriesByDateForStock

      InventoryList getInventoriesByDateForStock(Id stockId, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException
      Gets Inventories between the given date range inclusive for the given stock. In plenary mode, the returned list contains all known inventories or an error results. Otherwise, the returned list may contain only those inventories that are accessible through this session.
      Parameters:
      stockId - an inventory Id
      from - starting date
      to - ending date
      Returns:
      the returned Inventory list
      Throws:
      InvalidArgumentException - from is greater than to
      NullArgumentException - stockid, from or to is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getInventories

      Gets all Inventories . In plenary mode, the returned list contains all known inventories or an error results. Otherwise, the returned list may contain only those inventories that are accessible through this session.
      Returns:
      a list of Inventories
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.