Interface WarehouseAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session creates, updates, and deletes Warehouses . The
data for create and update is provided by the consumer via the form
object. OsidForms are requested for each create or update and may
not be reused.
Create and update operations differ in their usage. To create a
Warehouse , a WarehouseForm is requested using
getWarehouseFormForCreate() specifying the desired record Types
or none if no record Types are needed. The returned
WarehouseForm will indicate that it is to be used with a create operation
and can be used to examine metdata or validate data prior to creation.
Once the WarehouseForm is submiited to a create operation, it
cannot be reused with another create operation unless the first operation
was unsuccessful. Each WarehouseForm corresponds to an attempted
transaction.
For updates, WarehouseForms are requested to the
Warehouse Id that is to be updated using
getWarehouseFormForUpdate() . Similarly, the WarehouseForm has
metadata about the data that can be updated and it can perform validation
before submitting the update. The WarehouseForm can only be used
once for a successful update and cannot be reused.
The delete operations delete Warehouses .
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasWarehouse(Id warehouseId, Id aliasId) Adds anIdto aWarehousefor the purpose of creating compatibility.booleanTests if this user can createWarehouses.booleancanCreateWarehouseWithRecordTypes(Type[] warehouseRecordTypes) Tests if this user can create a singleWarehouseusing the desired record types.booleanTests if this user can deleteWarehouses.booleanTests if this user can manageIdaliases forWarehouses.booleanTests if this user can updateWarehouses.createWarehouse(WarehouseForm warehouseForm) Creates a newWarehouse.voiddeleteWarehouse(Id warehouseId) Deletes aWarehouse.getWarehouseFormForCreate(Type[] warehouseRecordTypes) Gets the warehouse form for creating new warehouses.getWarehouseFormForUpdate(Id warehouseId) Gets the warehouse form for updating an existing warehouse.voidupdateWarehouse(WarehouseForm warehouseForm) Updates an existing warehouse.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
-
canCreateWarehouses
boolean canCreateWarehouses()Tests if this user can createWarehouses. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aWarehouse. will result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer create operations to unauthorized users.- Returns:
falseifWarehousecreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateWarehouseWithRecordTypes
Tests if this user can create a singleWarehouseusing the desired record types. WhileInventoryManager.getWarehouseRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificWarehouse. Providing an empty array tests if aWarehousecan be created with no records.- Parameters:
warehouseRecordTypes- array of warehouse record types- Returns:
trueifWarehousecreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-warehouseRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getWarehouseFormForCreate
WarehouseForm getWarehouseFormForCreate(Type[] warehouseRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the warehouse form for creating new warehouses. A new form should be requested for each create transaction.- Parameters:
warehouseRecordTypes- array of warehouse record types- Returns:
- the warehouse form
- Throws:
NullArgumentException-warehouseRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createWarehouse
Warehouse createWarehouse(WarehouseForm warehouseForm) throws OperationFailedException, PermissionDeniedException Creates a newWarehouse.- Parameters:
warehouseForm- the form for thisWarehouse- Returns:
- the new
Warehouse - Throws:
IllegalStateException-warehouseFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-warehouseFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-warehouseFormdid not originate fromgetWarehouseFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateWarehouses
boolean canUpdateWarehouses()Tests if this user can updateWarehouses. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aWarehousewill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer update operations to unauthorized users.- Returns:
falseifWarehousemodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getWarehouseFormForUpdate
WarehouseForm getWarehouseFormForUpdate(Id warehouseId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the warehouse form for updating an existing warehouse. A new warehouse form should be requested for each update transaction.- Parameters:
warehouseId- theIdof theWarehouse- Returns:
- the warehouse form
- Throws:
NotFoundException-warehouseIdis not foundNullArgumentException-warehouseIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateWarehouse
void updateWarehouse(WarehouseForm warehouseForm) throws OperationFailedException, PermissionDeniedException Updates an existing warehouse.- Parameters:
warehouseForm- the form containing the elements to be updated- Throws:
IllegalStateException-warehouseFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-warehouseFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-warehouseFormdid not originate fromgetWarehouseFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteWarehouses
boolean canDeleteWarehouses()Tests if this user can deleteWarehouses. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aWarehousewill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer delete operations to unauthorized users.- Returns:
falseifWarehousedeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteWarehouse
void deleteWarehouse(Id warehouseId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aWarehouse.- Parameters:
warehouseId- theIdof theWarehouseto remove- Throws:
NotFoundException-warehouseIdnot foundNullArgumentException-warehouseIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageWarehouseAliases
boolean canManageWarehouseAliases()Tests if this user can manageIdaliases forWarehouses. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.- Returns:
falseifWarehousealiasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasWarehouse
void aliasWarehouse(Id warehouseId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aWarehousefor the purpose of creating compatibility. The primaryIdof theWarehouseis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another warehouse, it is reassigned to the given warehouseId.- Parameters:
warehouseId- theIdof aWarehousealiasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-aliasIdis in use as a primaryIdNullArgumentException-warehouseIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-