Interface InventoryWarehouseAssignmentSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session provides methods to re-assign Inventories to
Warehouses. An Inventory may appear in multiple
Warehouse objects and removing the last reference to an Inventory
is the equivalent of deleting it. Each Warehouse may have its own
authorizations governing who is allowed to operate on it.
Adding a reference of an Inventory to another
Warehouse is not a copy operation (eg: does not change its Id).
Like all OsidSessions,
InventoryWarehouseAssignmentSessions are dedicated to single processing
threads and a single authenticated user.
-
Method Summary
Modifier and TypeMethodDescriptionvoidassignInventoryToWarehouse(Id inventoryId, Id warehouseId) Adds an existingInventoryto aWarehouse.booleanTests if this user can alter inventory/warehouse mappings.booleancanAssignInventoriesToWarehouse(Id warehouseId) Tests if this user can alter inventory/warehouse mappings.getAssignableWarehouseIds(Id warehouseId) Gets a list of warehouses including and under the given warehouse node in which any inventory can be assigned.getAssignableWarehouseIdsForInventory(Id warehouseId, Id inventoryId) Gets a list of warehouses including and under the given warehouse node in which a specific inventory can be assigned.voidreassignInventoryToWarehouse(Id inventoryId, Id fromWarehouseId, Id toWarehouseId) Moves anInventoryfrom oneWarehouseto another.voidunassignInventoryFromWarehouse(Id inventoryId, Id warehouseId) Removes anInventoryfrom aWarehouse.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatTypes, getLocales, isAuthenticated, startTransaction, supportsTransactions
-
Method Details
-
canAssignInventories
boolean canAssignInventories()Tests if this user can alter inventory/warehouse 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.
-
canAssignInventoriesToWarehouse
Tests if this user can alter inventory/warehouse 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 lookup operations to unauthorized users.- Parameters:
warehouseId- theIdof theWarehouse- Returns:
falseif mapping is not authorized,trueotherwise- Throws:
NullArgumentException-warehouseIdisnull- Compliance:
mandatory- This method must be implemented.
-
getAssignableWarehouseIds
Gets a list of warehouses including and under the given warehouse node in which any inventory can be assigned.- Parameters:
warehouseId- theIdof theWarehouse- Returns:
- list of assignable warehouse
Ids - Throws:
NullArgumentException-warehouseIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
getAssignableWarehouseIdsForInventory
IdList getAssignableWarehouseIdsForInventory(Id warehouseId, Id inventoryId) throws OperationFailedException Gets a list of warehouses including and under the given warehouse node in which a specific inventory can be assigned.- Parameters:
warehouseId- theIdof theWarehouseinventoryId- theIdof theInventory- Returns:
- list of assignable warehouse
Ids - Throws:
NullArgumentException-warehouseIdorinventoryIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
assignInventoryToWarehouse
void assignInventoryToWarehouse(Id inventoryId, Id warehouseId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds an existingInventoryto aWarehouse.- Parameters:
inventoryId- theIdof theInventorywarehouseId- theIdof theWarehouse- Throws:
AlreadyExistsException-inventoryIdis already assigned towarehouseIdNotFoundException-inventoryIdorwarehouseIdnot foundNullArgumentException-inventoryIdorwarehouseIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
unassignInventoryFromWarehouse
void unassignInventoryFromWarehouse(Id inventoryId, Id warehouseId) throws NotFoundException, OperationFailedException, PermissionDeniedException Removes anInventoryfrom aWarehouse.- Parameters:
inventoryId- theIdof theInventorywarehouseId- theIdof theWarehouse- Throws:
NotFoundException-inventoryIdorwarehouseIdnot found orinventoryIdnot assigned towarehouseIdNullArgumentException-inventoryIdorwarehouseIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
reassignInventoryToWarehouse
void reassignInventoryToWarehouse(Id inventoryId, Id fromWarehouseId, Id toWarehouseId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Moves anInventoryfrom oneWarehouseto another. Mappings to otherWarehousesare unaffected.- Parameters:
inventoryId- theIdof theInventoryfromWarehouseId- theIdof the currentWarehousetoWarehouseId- theIdof the destinationWarehouse- Throws:
AlreadyExistsException-inventoryIdalready assigned totoWarehouseIdNotFoundException-inventoryId, fromWarehouseId, ortoWarehouseIdnot found orinventoryIdnot mapped tofromWarehouseIdNullArgumentException-inventoryId, fromWarehouseId, ortoWarehouseIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-