public interface WarehouseAdminSession extends 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.
Modifier and Type | Method and Description |
---|---|
void |
aliasWarehouse(Id warehouseId,
Id aliasId)
Adds an
Id to a Warehouse for the
purpose of creating compatibility. |
boolean |
canCreateWarehouses()
Tests if this user can create
Warehouses. |
boolean |
canCreateWarehouseWithRecordTypes(Type[] warehouseRecordTypes)
Tests if this user can create a single
Warehouse using
the desired record types. |
boolean |
canDeleteWarehouses()
Tests if this user can delete
Warehouses. |
boolean |
canManageWarehouseAliases()
Tests if this user can manage
Id aliases for
Warehouses. |
boolean |
canUpdateWarehouses()
Tests if this user can update
Warehouses. |
Warehouse |
createWarehouse(WarehouseForm warehouseForm)
Creates a new
Warehouse. |
void |
deleteWarehouse(Id warehouseId)
Deletes a
Warehouse. |
WarehouseForm |
getWarehouseFormForCreate(Type[] warehouseRecordTypes)
Gets the warehouse form for creating new warehouses.
|
WarehouseForm |
getWarehouseFormForUpdate(Id warehouseId)
Gets the warehouse form for updating an existing warehouse.
|
void |
updateWarehouse(WarehouseForm warehouseForm)
Updates an existing warehouse.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
boolean canCreateWarehouses()
Warehouses.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known creating a Warehouse.
will
result in a PERMISSION_DENIED.
This is intended as a
hint to an application that may not wish to offer create operations to
unauthorized users. false
if Warehouse
creation is
not authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateWarehouseWithRecordTypes(Type[] warehouseRecordTypes)
Warehouse
using
the desired record types. While
InventoryManager.getWarehouseRecordTypes()
can be used to
examine which records are supported, this method tests which record(s)
are required for creating a specific Warehouse.
Providing an empty array tests if a Warehouse
can be
created with no records.warehouseRecordTypes
- array of warehouse record types true
if Warehouse
creation using
the specified record Types
is supported,
false
otherwiseNullArgumentException
- warehouseRecordTypes
is null
mandatory
- This method must be implemented. WarehouseForm getWarehouseFormForCreate(Type[] warehouseRecordTypes) throws OperationFailedException, PermissionDeniedException
warehouseRecordTypes
- array of warehouse record typesNullArgumentException
- warehouseRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. Warehouse createWarehouse(WarehouseForm warehouseForm) throws OperationFailedException, PermissionDeniedException
Warehouse.
warehouseForm
- the form for this Warehouse
Warehouse
IllegalStateException
- warehouseForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- warehouseForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- warehouseForm
did
not originate from getWarehouseFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateWarehouses()
Warehouses.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known updating a Warehouse
will
result in a PERMISSION_DENIED.
This is intended as a
hint to an application that may not wish to offer update operations to
unauthorized users. false
if Warehouse
modification
is not authorized, true
otherwisemandatory
- This method must be implemented. WarehouseForm getWarehouseFormForUpdate(Id warehouseId) throws NotFoundException, OperationFailedException, PermissionDeniedException
warehouseId
- the Id
of the Warehouse
NotFoundException
- warehouseId
is not
foundNullArgumentException
- warehouseId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateWarehouse(WarehouseForm warehouseForm) throws OperationFailedException, PermissionDeniedException
warehouseForm
- the form containing the elements to be updatedIllegalStateException
- warehouseForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- warehouseForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- warehouseForm
did
not originate from getWarehouseFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteWarehouses()
Warehouses.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known deleting a Warehouse
will
result in a PERMISSION_DENIED.
This is intended as a
hint to an application that may not wish to offer delete operations to
unauthorized users. false
if Warehouse
deletion is
not authorized, true
otherwisemandatory
- This method must be implemented. void deleteWarehouse(Id warehouseId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Warehouse.
warehouseId
- the Id
of the Warehouse
to removeNotFoundException
- warehouseId
not
foundNullArgumentException
- warehouseId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageWarehouseAliases()
Id
aliases for
Warehouses.
A return of true does not guarantee successful
authorization. A return of false indicates that it is known changing
an alias will result in a PERMISSION_DENIED.
This is
intended as a hint to an application that may opt not to offer alias
operations to an unauthorized user. false
if Warehouse
aliasing is
not authorized, true
otherwisemandatory
- This method must be implemented. void aliasWarehouse(Id warehouseId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to a Warehouse
for the
purpose of creating compatibility. The primary Id
of
the Warehouse
is determined by the provider. The new
Id
performs as an alias to the primary Id
. If the alias is a pointer to another warehouse, it is
reassigned to the given warehouse Id.
warehouseId
- the Id
of a Warehouse
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is
already assignedNotFoundException
- aliasId
is in use as
a primary Id
NullArgumentException
- warehouseId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.