Interface InventoryLookupSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, 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
Inventorieswith theInventoryAdminSession. - 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 Summary
Modifier and TypeMethodDescriptionbooleanTests if this user can performInventorylookups.Gets allInventories.getInventoriesByDate(DateTime from, DateTime to) GetsInventoriesbetween the given date range inclusive.getInventoriesByDateForStock(Id stockId, DateTime from, DateTime to) GetsInventoriesbetween the given date range inclusive for the given stock.getInventoriesByGenusType(Type inventoryGenusType) Gets anInventoryListcorresponding to the given inventory genusTypewhich does not include inventories of genus types derived from the specifiedType.In plenary mode, the returned list contains all known inventories or an error results.getInventoriesByIds(IdList inventoryIds) Gets anInventoryListcorresponding to the givenIdList.getInventoriesByParentGenusType(Type inventoryGenusType) Gets anInventoryListcorresponding to the given inventory genusTypeand include any additional inventories with genus types derived from the specifiedType.getInventoriesByRecordType(Type inventoryRecordType) Gets anInventoryListcontaining the given inventory recordType.getInventoriesForStock(Id stockId) Gets allInventoriesfor the givenStock.getInventory(Id inventoryId) Gets theInventoryspecified by itsId.Gets the most recentInventories.getRecentInventoriesForStock(Id stockId) Gets the most recentInventoriesfor with the givenStock.Gets theWarehouseassociated with this session.Gets theWarehouseIdassociated 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 theInventoryreturns 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
-
getWarehouseId
Id getWarehouseId()Gets theWarehouseIdassociated with this session.- Returns:
- the
Warehouse Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getWarehouse
Gets theWarehouseassociated with this session.- Returns:
- the warehouse
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canLookupInventories
boolean canLookupInventories()Tests if this user can performInventorylookups. 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 lookup operations to unauthorized users.- Returns:
falseif lookup methods are not authorized,trueotherwise- 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 theInventoryreturns 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
Inventory getInventory(Id inventoryId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets theInventoryspecified by itsId. In plenary mode, the exactIdis found or aNOT_FOUNDresults. Otherwise, the returnedInventorymay have a differentIdthan requested, such as the case where a duplicateIdwas assigned to anInventoryand retained for compatibility.- Parameters:
inventoryId-Idof theInventory- Returns:
- the inventory
- Throws:
NotFoundException-inventoryIdnot foundNullArgumentException-inventoryIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method is must be implemented.
-
getInventoriesByIds
InventoryList getInventoriesByIds(IdList inventoryIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets anInventoryListcorresponding to the givenIdList. In plenary mode, the returned list contains all of the inventories 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, inaccessibleInventoriesmay be omitted from the list and may present the elements in any order including returning a unique set.- Parameters:
inventoryIds- the list ofIdsto retrieve- Returns:
- the returned
Inventorylist - Throws:
NotFoundException- anIdwas not foundNullArgumentException-inventoryIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getInventoriesByGenusType
InventoryList getInventoriesByGenusType(Type inventoryGenusType) throws OperationFailedException, PermissionDeniedException Gets anInventoryListcorresponding to the given inventory genusTypewhich does not include inventories of genus types derived from the specifiedType.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
Inventorylist - Throws:
NullArgumentException-inventoryGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getInventoriesByParentGenusType
InventoryList getInventoriesByParentGenusType(Type inventoryGenusType) throws OperationFailedException, PermissionDeniedException Gets anInventoryListcorresponding to the given inventory genusTypeand include any additional inventories with genus types derived from the specifiedType. 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
Inventorylist - Throws:
NullArgumentException-inventoryGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getInventoriesByRecordType
InventoryList getInventoriesByRecordType(Type inventoryRecordType) throws OperationFailedException, PermissionDeniedException Gets anInventoryListcontaining the given inventory recordType. 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
Inventorylist - Throws:
NullArgumentException-inventoryRecordTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getRecentInventories
Gets the most recentInventories. 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
Inventorylist - Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getInventoriesByDate
InventoryList getInventoriesByDate(DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException GetsInventoriesbetween 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 dateto- ending date- Returns:
- the returned
Inventorylist - Throws:
InvalidArgumentException-fromis greater thantoNullArgumentException-fromortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getInventoriesForStock
InventoryList getInventoriesForStock(Id stockId) throws OperationFailedException, PermissionDeniedException Gets allInventoriesfor the givenStock. 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 stockId- Returns:
- the returned
Inventorylist - Throws:
NullArgumentException-stockIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getRecentInventoriesForStock
InventoryList getRecentInventoriesForStock(Id stockId) throws OperationFailedException, PermissionDeniedException Gets the most recentInventoriesfor with the givenStock. 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 inventoryId- Returns:
- the returned
Inventorylist - Throws:
NullArgumentException-stockIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getInventoriesByDateForStock
InventoryList getInventoriesByDateForStock(Id stockId, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException GetsInventoriesbetween 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 inventoryIdfrom- starting dateto- ending date- Returns:
- the returned
Inventorylist - Throws:
InvalidArgumentException-fromis greater thantoNullArgumentException-stockid, fromortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getInventories
Gets allInventories. 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 requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-