public interface DispatchAdminSession extends OsidSession
This session creates, updates, and deletes Dispatches.
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
Dispatch,
a DispatchForm
is requested using
getDispatchFormForCreate()
specifying the desired relationship
peers and record Types
or none if no record Types
are needed. The returned DispatchForm
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 DispatchForm
is submiited to a create operation, it cannot be reused with
another create operation unless the first operation was unsuccessful. Each
DispatchForm
corresponds to an attempted transaction.
For updates, DispatchForms
are requested to the
Dispatch
Id
that is to be updated using
getDispatchFormForUpdate().
Similarly, the DispatchForm
has metadata about the data that can be updated and it can perform
validation before submitting the update. The DispatchForm
can only be used once for a successful update and cannot be reused.
The delete operations delete Dispatches.
To unmap a
Dispatch
from the current Publisher,
the
DispatchPublisherAssignmentSession
should be used. These
delete operations attempt to remove the Dispatch
itself
thus removing it from all known Publisher
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 |
aliasDispatch(Id dispatchId,
Id aliasId)
Adds an
Id to a Dispatch for the purpose
of creating compatibility. |
boolean |
canCreateDispatches()
Tests if this user can create
Dispatches. |
boolean |
canCreateDispatchWithRecordTypes(Type[] dispatchRecordTypes)
Tests if this user can create a single
Dispatch using
the desired record interface types. |
boolean |
canDeleteDispatches()
Tests if this user can delete
Dispatches A return of
true does not guarantee successful authorization. |
boolean |
canManageDispatchAliases()
Tests if this user can manage
Id aliases for
Dispatches. |
boolean |
canUpdateDispatches()
Tests if this user can update
Dispatches. |
Dispatch |
createDispatch(DispatchForm dispatchForm)
Creates a new
Dispatch. |
void |
deleteDispatch(Id dispatchId)
Deletes a
Dispatch. |
DispatchForm |
getDispatchFormForCreate(Type[] dispatchRecordTypes)
Gets the dispatch form for creating new dispatches.
|
DispatchForm |
getDispatchFormForUpdate(Id dispatchId)
Gets the dispatch form for updating an existing dispatch.
|
Publisher |
getPublisher()
Gets the
Publisher associated with this session. |
Id |
getPublisherId()
Gets the
Publisher Id associated with
this session. |
void |
updateDispatch(DispatchForm dispatchForm)
Updates an existing dispatch.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getPublisherId()
Publisher
Id
associated with
this session. Publisher Id
associated with this sessionmandatory
- This method must be implemented. Publisher getPublisher() throws OperationFailedException, PermissionDeniedException
Publisher
associated with this session.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canCreateDispatches()
Dispatches.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known creating a Dispatch
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 Dispatch
creation is
not authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateDispatchWithRecordTypes(Type[] dispatchRecordTypes)
Dispatch
using
the desired record interface types. While
SubscriptionManager.getDispatchRecordTypes()
can be used to
examine which record interfaces are supported, this method tests which
record(s) are required for creating a specific Dispatch.
Providing an empty array tests if a Dispatch
can be created with no records.dispatchRecordTypes
- array of dispatch record types true
if Dispatch
creation using
the specified record Types
is supported,
false
otherwiseNullArgumentException
- dispatchRecordTypes
is null
mandatory
- This method must be implemented. DispatchForm getDispatchFormForCreate(Type[] dispatchRecordTypes) throws OperationFailedException, PermissionDeniedException
dispatchRecordTypes
- array of dispatch record typesNullArgumentException
- dispatchRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get from for requested
record typesmandatory
- This method must be implemented. Dispatch createDispatch(DispatchForm dispatchForm) throws OperationFailedException, PermissionDeniedException
Dispatch.
dispatchForm
- the form for this Dispatch
Dispatch
IllegalStateException
- dispatchForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- dispatchForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- dispatchForm
did
not originate from getDispatchFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateDispatches()
Dispatches.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known updating a Dispatch
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 Dispatch
modification
is not authorized, true
otherwisemandatory
- This method must be implemented. DispatchForm getDispatchFormForUpdate(Id dispatchId) throws NotFoundException, OperationFailedException, PermissionDeniedException
dispatchId
- the Id
of the Dispatch
NotFoundException
- dispatchId
is not
foundNullArgumentException
- dispatchId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateDispatch(DispatchForm dispatchForm) throws OperationFailedException, PermissionDeniedException
dispatchForm
- the form containing the elements to be updatedIllegalStateException
- dispatchForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- dispatchId
or
dispatchForm
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- dispatchForm
did
not originate from getDispatchFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteDispatches()
Dispatches
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known deleting a Dispatch
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 Dispatch
deletion is
not authorized, true
otherwisemandatory
- This method must be implemented. void deleteDispatch(Id dispatchId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Dispatch.
dispatchId
- the Id
of the Dispatch
to removeNotFoundException
- dispatchId
not foundNullArgumentException
- dispatchId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageDispatchAliases()
Id
aliases for
Dispatches.
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 Dispatch
aliasing is
not authorized, true
otherwisemandatory
- This method must be implemented. void aliasDispatch(Id dispatchId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to a Dispatch
for the purpose
of creating compatibility. The primary Id
of the
Dispatch
is determined by the provider. The new Id
performs as an alias to the primary Id.
If the
alias is a pointer to another dispatch, it is reassigned to the given
dispatch Id.
dispatchId
- the Id
of a Dispatch
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is
already assignedNotFoundException
- dispatchId
not foundNullArgumentException
- dispatchId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.