public interface ShipmentAdminSession extends OsidSession
This session creates, updates, and deletes Shipments.
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
Shipment,
a ShipmentForm
is requested using
getShipmentFormForCreate()
specifying the desired record
Types
or none if no record Types
are needed. The
returned ShipmentForm
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 ShipmentForm
is submiited
to a create operation, it cannot be reused with another create operation
unless the first operation was unsuccessful. Each ShipmentForm
corresponds to an attempted transaction.
For updates, ShipmentForms
are requested to the
Shipment
Id
that is to be updated using
getShipmentFormForUpdate().
Similarly, the ShipmentForm
has metadata about the data that can be updated and it can perform
validation before submitting the update. The ShipmentForm
can only be used once for a successful update and cannot be reused.
The delete operations delete Shipments.
To unmap a
Shipment
from the current Warehouse,
the
ShipmentWarehouseAssignmentSession
should be used. These
delete operations attempt to remove the Shipment
itself
thus removing it from all known Warehouse
catalogs.
This session includes an Id
aliasing mechanism to
assign an external Id
to an internally assigned Id.
Modifier and Type | Method and Description |
---|---|
void |
aliasEntry(Id entryId,
Id aliasId)
Adds an
Id to an Entry for the purpose
of creating compatibility. |
void |
aliasShipment(Id shipmentId,
Id aliasId)
Adds an
Id to a Shipment for the purpose
of creating compatibility. |
boolean |
canCreateEntries()
Tests if this user can create
Entries. |
boolean |
canCreateEntriesWithRecordTypes(Type[] entryRecordTypes)
Tests if this user can create a single
Entry using the
desired record types. |
boolean |
canCreateShipments()
Tests if this user can create
Shipments. |
boolean |
canCreateShipmentWithRecordTypes(Type[] shipmentRecordTypes)
Tests if this user can create a single
Shipment using
the desired record types. |
boolean |
canDeleteEntries()
Tests if this user can delete
Entries. |
boolean |
canDeleteShipments()
Tests if this user can delete
Shipments. |
boolean |
canManageEntryAliases()
Tests if this user can manage
Id aliases for
Entries. |
boolean |
canManageShipmentAliases()
Tests if this user can manage
Id aliases for
Shipments. |
boolean |
canUpdateEntries()
Tests if this user can update
Entries. |
boolean |
canUpdateShipments()
Tests if this user can update
Shipments. |
Entry |
createEntry(EntryForm entryForm)
Creates a new
Entry. |
Shipment |
createShipment(ShipmentForm shipmentForm)
Creates a new
Shipment. |
void |
deleteEntry(Id entryId)
Deletes an
Entry. |
void |
deleteShipment(Id shipmentId)
Deletes a
Shipment. |
EntryForm |
getEntryFormForCreate(Id shipmentId,
Type[] entryRecordTypes)
Gets the entry form for creating new entries.
|
EntryForm |
getEntryFormForUpdate(Id entryId)
Gets the entry form for updating an existing entry.
|
ShipmentForm |
getShipmentFormForCreate(Type[] shipmentRecordTypes)
Gets the shipment form for creating new shipments.
|
ShipmentForm |
getShipmentFormForUpdate(Id shipmentId)
Gets the shipment form for updating an existing shipment.
|
Warehouse |
getWarehouse()
Gets the
Warehouse associated with this session. |
Id |
getWarehouseId()
Gets the
Warehouse Id associated with
this session. |
void |
updateEntry(EntryForm entryForm)
Updates an existing entry.
|
void |
updateShipment(ShipmentForm shipmentForm)
Updates an existing shipment.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getWarehouseId()
Warehouse
Id
associated with
this session. Warehouse Id
associated with this sessionmandatory
- This method must be implemented. Warehouse getWarehouse() throws OperationFailedException, PermissionDeniedException
Warehouse
associated with this session.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canCreateShipments()
Shipments.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known creating a Shipment
will
result in a PERMISSION_DENIED.
This is intended as a
hint to an application that may opt not to offer create operations to
an unauthorized user. false
if Shipment
creation is
not authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateShipmentWithRecordTypes(Type[] shipmentRecordTypes)
Shipment
using
the desired record types. While
InventoryShipmentManager.getShipmentRecordTypes()
can be used
to examine which records are supported, this method tests which
record(s) are required for creating a specific Shipment.
Providing an empty array tests if a Shipment
can be created with no records.shipmentRecordTypes
- array of shipment record types true
if Shipment
creation using
the specified record Types
is supported,
false
otherwiseNullArgumentException
- shipmentRecordTypes
is null
mandatory
- This method must be implemented. ShipmentForm getShipmentFormForCreate(Type[] shipmentRecordTypes) throws OperationFailedException, PermissionDeniedException
shipmentRecordTypes
- array of shipment record typesNullArgumentException
- shipmentRecordType
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. Shipment createShipment(ShipmentForm shipmentForm) throws OperationFailedException, PermissionDeniedException
Shipment.
shipmentForm
- the form for this Shipment
Shipment
IllegalStateException
- shipmentForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- shipmentForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- shipmentForm did not
originate from getShipmentFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateShipments()
Shipments.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known updating a Shipment
will
result in a PERMISSION_DENIED.
This is intended as a
hint to an application that may opt not to offer update operations to
an unauthorized user. false
if Shipment
modification
is not authorized, true
otherwisemandatory
- This method must be implemented. ShipmentForm getShipmentFormForUpdate(Id shipmentId) throws NotFoundException, OperationFailedException, PermissionDeniedException
shipmentId
- the Id
of the Shipment
NotFoundException
- shipmentId
is not
foundNullArgumentException
- shipmentId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateShipment(ShipmentForm shipmentForm) throws OperationFailedException, PermissionDeniedException
shipmentForm
- the form containing the elements to be updatedIllegalStateException
- shipmentForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- shipmentForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- shipmentForm did not
originate from getShipmentFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteShipments()
Shipments.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known deleting a Shipment
will
result in a PERMISSION_DENIED.
This is intended as a
hint to an application that may opt not to offer delete operations to
an unauthorized user. false
if Shipment
deletion is
not authorized, true
otherwisemandatory
- This method must be implemented. void deleteShipment(Id shipmentId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Shipment.
shipmentId
- the Id
of the Shipment
to removeNotFoundException
- shipmentId
not foundNullArgumentException
- shipmentId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageShipmentAliases()
Id
aliases for
Shipments.
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 Shipment
aliasing is
not authorized, true
otherwisemandatory
- This method must be implemented. void aliasShipment(Id shipmentId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to a Shipment
for the purpose
of creating compatibility. The primary Id
of the
Shipment
is determined by the provider. The new Id
performs as an alias to the primary Id.
If the
alias is a pointer to another shipment, it is reassigned to the given
shipment Id.
shipmentId
- the Id
of a Shipment
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is in
use as a primary Id
NotFoundException
- shipmentId
not foundNullArgumentException
- shipmentId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canCreateEntries()
Entries.
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known creating an Entry
will
result in a PERMISSION_DENIED.
This is intended as a
hint to an application that may opt not to offer create operations to
an unauthorized user. false
if Entry
creation is not
authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateEntriesWithRecordTypes(Type[] entryRecordTypes)
Entry
using the
desired record types. While
InventoryShippingManager.getEntryRecordTypes()
can be used to
examine which records are supported, this method tests which record(s)
are required for creating a specific Entry.
Providing
an empty array tests if an Entry
can be created with no
records.entryRecordTypes
- array of entry record types true
if Entry
creation using the
specified record Types
is supported,
false
otherwiseNullArgumentException
- entryRecordTypes
is null
mandatory
- This method must be implemented. EntryForm getEntryFormForCreate(Id shipmentId, Type[] entryRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
shipmentId
- a shipment Id
entryRecordTypes
- array of entry record typesNotFoundException
- shipmentId
is not
foundNullArgumentException
- entryRecordTypes
or shipmentId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. Entry createEntry(EntryForm entryForm) throws OperationFailedException, PermissionDeniedException
Entry.
entryForm
- the form for this Entry
Entry
IllegalStateException
- entryForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- entryForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- entry did not originate
from getEntryFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateEntries()
Entries.
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known updating an Entry
will
result in a PERMISSION_DENIED.
This is intended as a
hint to an application that may opt not to offer update operations to
an unauthorized user. false
if Entry
modification is
not authorized, true
otherwisemandatory
- This method must be implemented. EntryForm getEntryFormForUpdate(Id entryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
entryId
- the Id
of the Entry
NotFoundException
- entryId
is not foundNullArgumentException
- entryId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateEntry(EntryForm entryForm) throws OperationFailedException, PermissionDeniedException
entryForm
- the form containing the elements to be updatedIllegalStateException
- entryForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- entryForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- entryForm did not
originate from getEntryFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteEntries()
Entries.
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known deleting an Entry
will
result in a PERMISSION_DENIED.
This is intended as a
hint to an application that may opt not to offer delete operations to
an unauthorized user. false
if Entry
deletion is not
authorized, true
otherwisemandatory
- This method must be implemented. void deleteEntry(Id entryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Entry.
entryId
- the Id
of the Entry
to
removeNotFoundException
- entryId
not foundNullArgumentException
- entryId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageEntryAliases()
Id
aliases for
Entries.
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 Entry
aliasing is not
authorized, true
otherwisemandatory
- This method must be implemented. void aliasEntry(Id entryId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to an Entry
for the purpose
of creating compatibility. The primary Id
of the
Entry
is determined by the provider. The new Id
performs as an alias to the primary Id.
If the alias is
a pointer to another entry, it is reassigned to the given entry
Id.
entryId
- the Id
of an Entry
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is in
use as a primary Id
NotFoundException
- entryId
not foundNullArgumentException
- entryId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.