Interface ModelWarehouseAssignmentSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session provides methods to re-assign Models to
Warehouses.A Model may appear in multiple Warehouse
objects and removing the last reference to a Model 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 a Model to another Warehouse is
not a copy operation (eg: does not change its Id).
Like all OsidSessions,
ModelWarehouseAssignmentSessions are dedicated to single processing
threads and a single authenticated user.
-
Method Summary
Modifier and TypeMethodDescriptionvoidassignModelToWarehouse(Id modelId, Id warehouseId) Adds an existingModelto aWarehouse.booleanTests if this user can alter model/warehouse mappings.booleancanAssignModelToWarehouse(Id warehouseId) Tests if this user can alter model/warehouse mappings.getAssignableWarehouseIds(Id warehouseId) Gets a list of warehouses including and under the given warehouse node in which any model can be assigned.getAssignableWarehouseIdsForModel(Id warehouseId, Id modelId) Gets a list of warehouses including and under the given warehouse node in which a specific model can be assigned.voidreassignModelToWarehouse(Id modelId, Id fromWarehouseId, Id toWarehouseId) Moves aModelfrom oneWarehouseto another.voidunassignModelFromWarehouse(Id modelId, Id warehouseId) Removes aModelfrom aWarehouse.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatTypes, getLocales, isAuthenticated, startTransaction, supportsTransactions
-
Method Details
-
canAssignModels
boolean canAssignModels()Tests if this user can alter model/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.
-
canAssignModelToWarehouse
Tests if this user can alter model/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 model 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.
-
getAssignableWarehouseIdsForModel
IdList getAssignableWarehouseIdsForModel(Id warehouseId, Id modelId) throws OperationFailedException Gets a list of warehouses including and under the given warehouse node in which a specific model can be assigned.- Parameters:
warehouseId- theIdof theWarehousemodelId- theIdof theModel- Returns:
- list of assignable warehouse
Ids - Throws:
NullArgumentException-warehouseIdormodelIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
assignModelToWarehouse
void assignModelToWarehouse(Id modelId, Id warehouseId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds an existingModelto aWarehouse.- Parameters:
modelId- theIdof theModelwarehouseId- theIdof theWarehouse- Throws:
AlreadyExistsException-modelIdis already assigned towarehouseIdNotFoundException-modelIdorwarehouseIdnot foundNullArgumentException-modelIdorwarehouseIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
unassignModelFromWarehouse
void unassignModelFromWarehouse(Id modelId, Id warehouseId) throws NotFoundException, OperationFailedException, PermissionDeniedException Removes aModelfrom aWarehouse.- Parameters:
modelId- theIdof theModelwarehouseId- theIdof theWarehouse- Throws:
NotFoundException-modelIdorwarehouseIdnot found ormodelIdnot assigned towarehouseIdNullArgumentException-modelIdorwarehouseIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
reassignModelToWarehouse
void reassignModelToWarehouse(Id modelId, Id fromWarehouseId, Id toWarehouseId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Moves aModelfrom oneWarehouseto another. Mappings to otherWarehousesare unaffected.- Parameters:
modelId- theIdof theModelfromWarehouseId- theIdof the currentWarehousetoWarehouseId- theIdof the destinationWarehouse- Throws:
AlreadyExistsException-modelIdalready assigned totoWarehouseIdNotFoundException-modelId, fromWarehouseId, ortoWarehouseIdnot found ormodelIdnot mapped tofromWarehouseIdNullArgumentException-modelId, fromWarehouseId, ortoWarehouseIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-