Interface OrderLookupSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface OrderLookupSession extends OsidSession

This session defines methods for retrieving orders.

This lookup session defines several views:

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

The methods useFederatedStoreView() and useIsolatedStoreView() behave as a radio group and one should be selected before invoking any lookup methods.

  • Method Details

    • getStoreId

      Id getStoreId()
      Gets the Store Id associated with this session.
      Returns:
      the Store Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getStore

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

      boolean canLookupOrders()
      Tests if this user can lookup orders. 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 these operations.
      Returns:
      false if order lookup methods are not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • useComparativeOrderView

      void useComparativeOrderView()
      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.
    • usePlenaryOrderView

      void usePlenaryOrderView()
      A complete view of the Order 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.
    • useFederatedStoreView

      void useFederatedStoreView()
      Federates the view for methods in this session. A federated view will include orders in stores which are children of this store in the store hierarchy.
      Compliance:
      mandatory - This method is must be implemented.
    • useIsolatedStoreView

      void useIsolatedStoreView()
      Isolates the view for methods in this session. An isolated view restricts retrievals to this store only.
      Compliance:
      mandatory - This method is must be implemented.
    • getOrder

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

      Gets an OrderList corresponding to the given IdList . In plenary mode, the returned list contains all of the entries 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 entries may be omitted from the list and may present the elements in any order including returning a unique set.
      Parameters:
      orderIds - the list of Ids to retrieve
      Returns:
      the returned Order list
      Throws:
      NotFoundException - an Id was not found
      NullArgumentException - orderIds is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getOrdersByGenusType

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

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

      OrderList getOrdersByRecordType(Type orderRecordType) throws OperationFailedException, PermissionDeniedException
      Gets an OrderList containing the given repository record Type . In plenary mode, the returned list contains all known orders or an error results. Otherwise, the returned list may contain only those orders that are accessible through this session.
      Parameters:
      orderRecordType - an order record type
      Returns:
      the returned Order list
      Throws:
      NullArgumentException - orderRecordType is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getOrdersByCustomer

      OrderList getOrdersByCustomer(Id resourceId) throws OperationFailedException, PermissionDeniedException
      Gets a list of all orders corresponding to a customer Id . In plenary mode, the returned list contains all known orders or an error results. Otherwise, the returned list may contain only those entries that are accessible through this session.
      Parameters:
      resourceId - the Id of the customer
      Returns:
      the returned OrderList
      Throws:
      NullArgumentException - resourceId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getOrdersByDate

      Gets a list of all orders corresponding to a date range. Entries are returned with a submitted date that falsl between the requested dates inclusive. In plenary mode, the returned list contains all known orders or an error results. Otherwise, the returned list may contain only those entries that are accessible through this session.
      Parameters:
      from - from date
      to - to date
      Returns:
      the returned OrderList
      Throws:
      InvalidArgumentException - to is less than from
      NullArgumentException - from or to is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getOrdersByCustomerAndDate

      OrderList getOrdersByCustomerAndDate(Id resourceId, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException
      Gets a list of all orders corresponding to a customer Id and date range. Entries are returned with submit dates that fall between the requested dates inclusive. In plenary mode, the returned list contains all known orders or an error results. Otherwise, the returned list may contain only those entries that are accessible through this session.
      Parameters:
      resourceId - the Id of the customer
      from - from date
      to - to date
      Returns:
      the returned OrderList
      Throws:
      InvalidArgumentException - to is less than from
      NullArgumentException - resourceId, from or to is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getOrdersForProduct

      OrderList getOrdersForProduct(Id productId) throws OperationFailedException, PermissionDeniedException
      Gets a list of all orders with an item for a product. Entries are returned with submit dates that fall between the requested dates inclusive. In plenary mode, the returned list contains all known orders or an error results. Otherwise, the returned list may contain only those entries that are accessible through this session.
      Parameters:
      productId - a product Id
      Returns:
      the returned OrderList
      Throws:
      InvalidArgumentException - to is less than from
      NullArgumentException - productId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getOrdersForProductAndDate

      OrderList getOrdersForProductAndDate(Id productId, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException
      Gets a list of all orders with items for a product Id and date range. Entries are returned with submit dates that fall between the requested dates inclusive. In plenary mode, the returned list contains all known orders or an error results. Otherwise, the returned list may contain only those entries that are accessible through this session.
      Parameters:
      productId - a product Id
      from - from date
      to - to date
      Returns:
      the returned OrderList
      Throws:
      InvalidArgumentException - to is less than from
      NullArgumentException - productId, from , or to is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getOrders

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

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

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