Interface OrderStoreAssignmentSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session provides methods to re-assign Odrers to
Stores . An Order may map to multiple Stores and removing
the last reference to an Order is the equivalent of deleting it.
Each Store may have its own authorizations governing who is
allowed to operate on it.
Adding a reference of an Order to another Store is not
a copy operation (eg: does not change its Id ).
-
Method Summary
Modifier and TypeMethodDescriptionvoidassignOrderToStore(Id orderId, Id storeId) Adds an existingOrderto aStore.booleanTests if this user can alter order/store mappings.booleancanAssignOrdersToStore(Id storeId) Tests if this user can alter order/store mappings.getAssignableStoreIds(Id storeId) Gets a list of stores including and under the given store node in which any order can be assigned.getAssignableStoreIdsForOrder(Id storeId, Id orderId) Gets a list of stores including and under the given store node in which a specific order can be assigned.voidreassignOrderToStore(Id orderId, Id fromStoreId, Id toStoreId) Moves anOrderfrom oneStoreto another.voidunassignOrderFromStore(Id orderId, Id storeId) Removes anOrderfrom aStore.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
-
canAssignOrders
boolean canAssignOrders()Tests if this user can alter order/store mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.- Returns:
falseif mapping is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canAssignOrdersToStore
Tests if this user can alter order/store mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.- Parameters:
storeId- theIdof theStore- Returns:
falseif mapping is not authorized,trueotherwise- Throws:
NullArgumentException-storeIdisnull- Compliance:
mandatory- This method must be implemented.
-
getAssignableStoreIds
Gets a list of stores including and under the given store node in which any order can be assigned.- Parameters:
storeId- theIdof theStore- Returns:
- list of assignable store
Ids - Throws:
NullArgumentException-storeIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
getAssignableStoreIdsForOrder
Gets a list of stores including and under the given store node in which a specific order can be assigned.- Parameters:
storeId- theIdof theStoreorderId- theIdof theOrder- Returns:
- list of assignable store
Ids - Throws:
NullArgumentException-storeIdororderIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
assignOrderToStore
void assignOrderToStore(Id orderId, Id storeId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds an existingOrderto aStore.- Parameters:
orderId- theIdof theOrderstoreId- theIdof theStore- Throws:
AlreadyExistsException-orderIdis already assigned tostoreIdNotFoundException-orderIdorstoreIdnot foundNullArgumentException-orderIdorstoreIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
unassignOrderFromStore
void unassignOrderFromStore(Id orderId, Id storeId) throws NotFoundException, OperationFailedException, PermissionDeniedException Removes anOrderfrom aStore.- Parameters:
orderId- theIdof theOrderstoreId- theIdof theStore- Throws:
NotFoundException-orderIdorstoreIdnot found ororderIdnot assigned tostoreIdNullArgumentException-orderIdorstoreIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
reassignOrderToStore
void reassignOrderToStore(Id orderId, Id fromStoreId, Id toStoreId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Moves anOrderfrom oneStoreto another. Mappings to otherStoresare unaffected.- Parameters:
orderId- theIdof theOrderfromStoreId- theIdof the currentStoretoStoreId- theIdof the destinationStore- Throws:
AlreadyExistsException-orderIdalready assigned tostoreIdNotFoundException-orderId, fromStoreId, ortoStoreIdnot found ororderIdnot mapped tofromStoreIdNullArgumentException-orderId, fromStoreId, ortoStoreIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-