Interface OrderLookupSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, 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 Summary
Modifier and TypeMethodDescriptionbooleanTests if this user can lookup orders.Gets all closed orders.Gets all submitted and not closed orders.Gets theOrderspecified by itsId.Gets all orders.getOrdersByCustomer(Id resourceId) Gets a list of all orders corresponding to a customerId.getOrdersByCustomerAndDate(Id resourceId, DateTime from, DateTime to) Gets a list of all orders corresponding to a customerIdand date range.getOrdersByDate(DateTime from, DateTime to) Gets a list of all orders corresponding to a date range.getOrdersByGenusType(Type orderGenusType) Gets anOrderListcorresponding to the given order genusTypewhich does not include orders of genus types derived from the specifiedType.getOrdersByIds(IdList orderIds) Gets anOrderListcorresponding to the givenIdList.getOrdersByParentGenusType(Type orderGenusType) Gets anOrderListcorresponding to the given order genusTypeand include any additional orders with genus types derived from the specifiedType.getOrdersByRecordType(Type orderRecordType) Gets anOrderListcontaining the given repository recordType.getOrdersForProduct(Id productId) Gets a list of all orders with an item for a product.getOrdersForProductAndDate(Id productId, DateTime from, DateTime to) Gets a list of all orders with items for a productIdand date range.getStore()Gets theStoreassociated with this session.Gets theStoreIdassociated with this session.voidThe returns from the lookup methods may omit or translate elements based on this session, such as authorization, and not result in an error.voidFederates the view for methods in this session.voidIsolates the view for methods in this session.voidA complete view of theOrderreturns is desired.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
Method Details
-
getStoreId
Id getStoreId()Gets theStoreIdassociated with this session.- Returns:
- the
Store Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getStore
Gets theStoreassociated with this session.- Returns:
- the store
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- 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 aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer these operations.- Returns:
falseif order lookup methods are not authorized,trueotherwise- 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 theOrderreturns 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
Order getOrder(Id orderId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets theOrderspecified by itsId. In plenary mode, the exactIdis found or aNOT_FOUNDresults. Otherwise, the returnedOrdermay have a differentIdthan requested, such as the case where a duplicateIdwas assigned to anOrderand retained for compatibility.- Parameters:
orderId- theIdof theOrderto retrieve- Returns:
- the returned
Order - Throws:
NotFoundException- noOrderfound with the givenIdNullArgumentException-orderIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getOrdersByIds
OrderList getOrdersByIds(IdList orderIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets anOrderListcorresponding to the givenIdList. In plenary mode, the returned list contains all of the entries specified in theIdlist, in the order of the list, including duplicates, or an error results if anIdin 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 ofIdsto retrieve- Returns:
- the returned
Order list - Throws:
NotFoundException- anIdwas not foundNullArgumentException-orderIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getOrdersByGenusType
OrderList getOrdersByGenusType(Type orderGenusType) throws OperationFailedException, PermissionDeniedException Gets anOrderListcorresponding to the given order genusTypewhich does not include orders of genus types derived from the specifiedType. 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
Orderlist - Throws:
NullArgumentException-orderGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getOrdersByParentGenusType
OrderList getOrdersByParentGenusType(Type orderGenusType) throws OperationFailedException, PermissionDeniedException Gets anOrderListcorresponding to the given order genusTypeand include any additional orders with genus types derived from the specifiedType. 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
Orderlist - Throws:
NullArgumentException-orderGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getOrdersByRecordType
OrderList getOrdersByRecordType(Type orderRecordType) throws OperationFailedException, PermissionDeniedException Gets anOrderListcontaining the given repository recordType. 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
Orderlist - Throws:
NullArgumentException-orderRecordTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- 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 customerId. 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- theIdof the customer- Returns:
- the returned
OrderList - Throws:
NullArgumentException-resourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getOrdersByDate
OrderList getOrdersByDate(DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException 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 dateto- to date- Returns:
- the returned
OrderList - Throws:
InvalidArgumentException-tois less thanfromNullArgumentException-fromortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- 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 customerIdand 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- theIdof the customerfrom- from dateto- to date- Returns:
- the returned
OrderList - Throws:
InvalidArgumentException-tois less thanfromNullArgumentException-resourceId, fromortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- 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 productId- Returns:
- the returned
OrderList - Throws:
InvalidArgumentException-tois less thanfromNullArgumentException-productIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- 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 productIdand 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 productIdfrom- from dateto- to date- Returns:
- the returned
OrderList - Throws:
InvalidArgumentException-tois less thanfromNullArgumentException-productId, from, ortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- 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 requestPermissionDeniedException- 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 requestPermissionDeniedException- 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 requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-