OSID Logo
OSID Specifications
inventory package
Version 3.0.0
Release Candidate Preview
Interfaceosid.inventory.StockLookupSession
Implementsosid.OsidSession
Description

This session defines methods for retrieving stocks.

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 warehouse view: All stock methods in this session operate, retrieve and pertain to stocks defined explicitly in the current warehouse. Using an isolated view is useful for managing Stocks with the StockAdminSession.
  • federated warehouse view: All stock lookup methods in this session operate, retrieve and pertain to all stocks defined in this warehouse and any other stocks implicitly available in this warehouse through warehouse inheritence.

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

MethodgetWarehouseId
Description

Gets the Warehouse Id associated with this session.

Returnosid.id.Idthe Warehouse Id associated with this session
CompliancemandatoryThis method must be implemented.
MethodgetWarehouse
Description

Gets the Warehouse associated with this session.

Returnosid.inventory.Warehousethe warehouse
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanLookupStocks
Description

Tests if this user can perform Stock 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 not offer lookup operations to unauthorized users.

Returnboolean false if lookup methods are not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethoduseComparativeStockView
Description

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.

CompliancemandatoryThis method is must be implemented.
MethodusePlenaryStockView
Description

A complete view of the Stock 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.

CompliancemandatoryThis method is must be implemented.
MethoduseFederatedWarehouseView
Description

Federates the view for methods in this session. A federated view will include stocks in catalogs which are children of this catalog in the warehouse hierarchy.

CompliancemandatoryThis method is must be implemented.
MethoduseIsolatedWarehouseView
Description

Isolates the view for methods in this session. An isolated view restricts retrievals to this warehouse only.

CompliancemandatoryThis method is must be implemented.
MethodgetStock
Description

Gets the Stock specified by its Id. In plenary mode, the exact Id is found or a NOT_FOUND results. Otherwise, the returned Stock may have a different Id than requested, such as the case where a duplicate Id was assigned to a Stock and retained for compatibility.

Parametersosid.id.IdstockIdthe Id of the Stock to retrieve
Returnosid.inventory.Stockthe returned Stock
ErrorsNOT_FOUNDno Stock found with the given Id
NULL_ARGUMENT stockId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodgetStocksByIds
Description

Gets a StockList corresponding to the given IdList. In plenary mode, the returned list contains all of the stocks 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 Stocks may be omitted from the list and may present the elements in any order including returning a unique set.

Parametersosid.id.IdListstockIdsthe list of Ids to retrieve
Returnosid.inventory.StockListthe returned Stock list
ErrorsNOT_FOUNDan Id was not found
NULL_ARGUMENT stockIds is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodgetStocksByGenusType
Description

Gets a StockList corresponding to the given stock genus Type which does not include stocks of types derived from the specified Type. In plenary mode, the returned list contains all known stocks or an error results. Otherwise, the returned list may contain only those stocks that are accessible through this session.

Parametersosid.type.TypestockGenusTypea stock genus type
Returnosid.inventory.StockListthe returned Stock list
ErrorsNULL_ARGUMENT stockGenusType is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodgetStocksByParentGenusType
Description

Gets a StockList corresponding to the given stock genus Type and include any additional stocks with genus types derived from the specified Type. In plenary mode, the returned list contains all known stocks or an error results. Otherwise, the returned list may contain only those stocks that are accessible through this session.

Parametersosid.type.TypestockGenusTypea stock genus type
Returnosid.inventory.StockListthe returned Stock list
ErrorsNULL_ARGUMENT stockGenusType is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodgetStocksByRecordType
Description

Gets a StockList containing the given stock record Type. In plenary mode, the returned list contains all known stocks or an error results. Otherwise, the returned list may contain only those stocks that are accessible through this session.

Parametersosid.type.TypestockRecordTypea stock record type
Returnosid.inventory.StockListthe returned Stock list
ErrorsNULL_ARGUMENT stockRecordType is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodgetStocksBySKU
Description

Gets a StockList containing for the given SKU. In plenary mode, the returned list contains all known stocks or an error results. Otherwise, the returned list may contain only those stocks that are accessible through this session.

Parametersstringskua stock keeping unit
Returnosid.inventory.StockListthe returned Stock list
ErrorsNULL_ARGUMENT sku is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodgetStocks
Description

Gets all Stocks. In plenary mode, the returned list contains all known stocks or an error results. Otherwise, the returned list may contain only those stocks that are accessible through this session.

Returnosid.inventory.StockLista list of Stocks
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.