Interface ProductLookupSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session provides methods for retrieving Product objects.
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 store view: All order methods in this session operate,
retrieve and pertain to products defined explicitly in the current
store. Using an isolated view is useful for managing products with the
ProductAdminSession. - federated store view: All product lookup methods in this session operate, retrieve and pertain to all products defined in this store and any other stores implicitly available in this store through store inheritence.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanTests if this user can performProductlookups.getProduct(Id productId) Gets theProductspecified by itsId.Gets allProducts.getProductsByCode(String code) Gets theProductspecified by its product code.getProductsByGenusType(Type productGenusType) Gets aProductListcorresponding to the given product genusTypewhich does not include products of genus types derived from the specifiedType.In plenary mode, the returned list contains all known products or an error results.getProductsByIds(IdList productIds) Gets aProductListcorresponding to the givenIdList.getProductsByParentGenusType(Type productGenusType) Gets aProductListcorresponding to the given product genusTypeand include any additional products with genus types derived from the specifiedType.In plenary mode, the returned list contains all known products or an error results.getProductsByPriceSchedule(Id priceScheduleId) Gets aProductListcontaining the given price schedule.getProductsByRecordType(Type productRecordType) Gets aProductListcontaining the given repository recordType.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 theProductreturns 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.
-
canLookupProducts
boolean canLookupProducts()Tests if this user can performProductlookups. 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 not offer lookup operations to unauthorized users.- Returns:
falseif lookup methods are not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
useComparativeProductView
void useComparativeProductView()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.
-
usePlenaryProductView
void usePlenaryProductView()A complete view of theProductreturns 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 products 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.
-
getProduct
Product getProduct(Id productId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets theProductspecified by itsId. In plenary mode, the exactIdis found or aNOT_FOUNDresults. Otherwise, the returnedProductmay have a differentIdthan requested, such as the case where a duplicateIdwas assigned to aProductand retained for compatibility.- Parameters:
productId-Idof theProduct- Returns:
- the product
- Throws:
NotFoundException-productIdnot foundNullArgumentException-productIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method is must be implemented.
-
getProductsByIds
ProductList getProductsByIds(IdList productIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets aProductListcorresponding to the givenIdList. In plenary mode, the returned list contains all of the products 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, inaccessibleProductsmay be omitted from the list and may present the elements in any order including returning a unique set.- Parameters:
productIds- the list ofIdsto retrieve- Returns:
- the returned
Productlist - Throws:
NotFoundException- anIdwas not foundNullArgumentException-productIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getProductsByGenusType
ProductList getProductsByGenusType(Type productGenusType) throws OperationFailedException, PermissionDeniedException Gets aProductListcorresponding to the given product genusTypewhich does not include products of genus types derived from the specifiedType.In plenary mode, the returned list contains all known products or an error results. Otherwise, the returned list may contain only those products that are accessible through this session.- Parameters:
productGenusType- a product genus type- Returns:
- the returned
Productlist - Throws:
NullArgumentException-productGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getProductsByParentGenusType
ProductList getProductsByParentGenusType(Type productGenusType) throws OperationFailedException, PermissionDeniedException Gets aProductListcorresponding to the given product genusTypeand include any additional products with genus types derived from the specifiedType.In plenary mode, the returned list contains all known products or an error results. Otherwise, the returned list may contain only those products that are accessible through this session.- Parameters:
productGenusType- a product genus type- Returns:
- the returned
Productlist - Throws:
NullArgumentException-productGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getProductsByRecordType
ProductList getProductsByRecordType(Type productRecordType) throws OperationFailedException, PermissionDeniedException Gets aProductListcontaining the given repository recordType. In plenary mode, the returned list contains all known products or an error results. Otherwise, the returned list may contain only those products that are accessible through this session.- Parameters:
productRecordType- a product record type- Returns:
- the returned
Productlist - Throws:
NullArgumentException-productRecordTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getProductsByCode
ProductList getProductsByCode(String code) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets theProductspecified by its product code.- Parameters:
code- a product code- Returns:
- the product
- Throws:
NotFoundException-codenot foundNullArgumentException-codeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method is must be implemented.
-
getProductsByPriceSchedule
ProductList getProductsByPriceSchedule(Id priceScheduleId) throws OperationFailedException, PermissionDeniedException Gets aProductListcontaining the given price schedule. In plenary mode, the returned list contains all known products or an error results. Otherwise, the returned list may contain only those products that are accessible through this session.- Parameters:
priceScheduleId- a price scheduleId- Returns:
- the product list
- Throws:
NullArgumentException-priceScheduleIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method is must be implemented.
-
getProducts
Gets allProducts. In plenary mode, the returned list contains all known products or an error results. Otherwise, the returned list may contain only those products that are accessible through this session.- Returns:
- a list of
Products - Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-