Interface DispatchBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, DispatchAdminSession, OsidSession, OsidSession
This session creates, updates, and deletes Dispatches in bulk.
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
getDispatchFormsForCreate() specifying the desired record Types
or none if no record Types are needed. Each of the returned
DispatchForms 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 a 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.
The DispatchForms returned from
getDispatchFormsForCreate() may be linked to the originating request
through the peer Ids of the DispatchForm . In the case
where there may be duplicates, any DispatchForm of the same peer
Ids may be used for a create operation.
Once a batch of DispatchForms are submitted for create, a
CreateResponse is returned for each DispatchForm ,
although the ordering is not defined. Only errors that pertain to the
entire create operation are returned from createDispatches() ,
errors specific to an individual DispatchForm are indicated in the
corresponding CreateResponse . CreateResponses may be
linked to the originating DispatchForm through the
DispatchForm Id .
For updates, DispatchForms are requested to the
Dispatch Id that is to be updated using
getDispatchFormsForUpdate() where the reference Id in the
DispatchForm may be used to link the request. 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.
Once a batch of DispatchForms are submitted for update, an
UpdateResponse is returned for each DispatchForm ,
although the ordering is not defined. Only errors that pertain to the
entire update operation are returned from updateDispatches() ,
errors specific to an individual DispatchForm are indicated in the
corresponding UpdateResponse . UpdateResponses may be
linked to the originating DispatchForm through the
DispatchForm Id .
The delete operations delete Dispatches in bulk. 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. Bulk delete operations return
the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasDispatches(AliasRequestList aliasRequests) Adds anIdto aDispatchfor the purpose of creating compatibility.createDispatches(DispatchBatchFormList dispatchForms) Creates a new set ofDispatches.Deletes allDispatchesin thisPublisher.deleteDispatches(IdList dispatchIds) Deletes dispatches for the givenIds.getDispatchFormsForCreate(long number, Type[] dispatchRecordTypes) Gets the dispatch forms for creating a bunch of new dispatches.getDispatchFormsForUpdate(IdList dispatchIds) Gets the dispatch forms for updating an existing set of dispatches.updateDispatches(DispatchBatchFormList dispatchForms) Updates existing dispatches.Methods inherited from interface DispatchAdminSession
aliasDispatch, canCreateDispatches, canCreateDispatchWithRecordTypes, canDeleteDispatches, canManageDispatchAliases, canUpdateDispatches, createDispatch, deleteDispatch, getDispatchFormForCreate, getDispatchFormForUpdate, getPublisher, getPublisherId, updateDispatchModifier and TypeMethodDescriptionvoidaliasDispatch(Id dispatchId, Id aliasId) Adds anIdto aDispatchfor the purpose of creating compatibility.booleanTests if this user can createDispatches.booleancanCreateDispatchWithRecordTypes(Type[] dispatchRecordTypes) Tests if this user can create a singleDispatchusing the desired record interface types.booleanTests if this user can deleteDispatchesA return of true does not guarantee successful authorization.booleanTests if this user can manageIdaliases forDispatches.booleanTests if this user can updateDispatches.createDispatch(DispatchForm dispatchForm) Creates a newDispatch.voiddeleteDispatch(Id dispatchId) Deletes aDispatch.getDispatchFormForCreate(Type[] dispatchRecordTypes) Gets the dispatch form for creating new dispatches.getDispatchFormForUpdate(Id dispatchId) Gets the dispatch form for updating an existing dispatch.Gets thePublisherassociated with this session.Gets thePublisherIdassociated with this session.voidupdateDispatch(DispatchForm dispatchForm) Updates an existing dispatch.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
-
getDispatchFormsForCreate
DispatchBatchFormList getDispatchFormsForCreate(long number, Type[] dispatchRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the dispatch forms for creating a bunch of new dispatches.- Parameters:
number- the number of forms to retrievedispatchRecordTypes- array of dispatch record types to be included in each create operation or an empty list if none- Returns:
- the dispatch forms
- Throws:
NullArgumentException-dispatchRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createDispatches
CreateResponseList createDispatches(DispatchBatchFormList dispatchForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofDispatches. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
dispatchForms- the dispatch forms- Returns:
- the create responses
- Throws:
NullArgumentException-dispatchFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getDispatchFormsForUpdate
DispatchBatchFormList getDispatchFormsForUpdate(IdList dispatchIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the dispatch forms for updating an existing set of dispatches. A new dispatch form should be requested for each update transaction.- Parameters:
dispatchIds- theIdsof theDispatch- Returns:
- the dispatch form
- Throws:
NotFoundException- adispatchIdis not foundNullArgumentException-dispatchIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateDispatches
UpdateResponseList updateDispatches(DispatchBatchFormList dispatchForms) throws OperationFailedException, PermissionDeniedException Updates existing dispatches. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
dispatchForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-dispatchFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllDispatches
Deletes allDispatchesin thisPublisher.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteDispatches
DeleteResponseList deleteDispatches(IdList dispatchIds) throws OperationFailedException, PermissionDeniedException Deletes dispatches for the givenIds.- Parameters:
dispatchIds- theIdsof the dispatches to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-dispatchIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasDispatches
AliasResponseList aliasDispatches(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aDispatchfor the purpose of creating compatibility. The primaryIdof theDispatchis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another dispatch, it is reassigned to the given dispatchId.- Parameters:
aliasRequests- the alias requests- Returns:
- the alias responses
- Throws:
NullArgumentException-aliasRequestsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-