public interface BranchBatchAdminSession extends BranchAdminSession
This session creates, updates, and deletes Branches
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
Branch,
a BranchForm
is requested using
getBranchFormsForCreate()
specifying the desired work, resource,
and record Types
or none if no record Types
are needed. Each of the returned BranchForms
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 BranchForm
is submiited to a create operation, it cannot be reused with
another create operation unless the first operation was unsuccessful. Each
BranchForm
corresponds to an attempted transaction.
The BranchForms
returned from
getBranchFormsForCreate()
may be linked to the originating request
through the peer Ids
of the BranchForm.
In
the case where there may be duplicates, any BranchForm
of
the same peer Ids
may be used for a create operation.
Once a batch of BranchForms
are submitted for create, a
CreateResponse
is returned for each BranchForm,
although the ordering is not defined. Only errors that pertain to
the entire create operation are returned from createBranches(),
errors specific to an individual BranchForm
are
indicated in the corresponding CreateResponse.
CreateResponses
may be linked to the originating BranchForm
through the BranchForm
Id
.
For updates, BranchForms
are requested to the
Branch
Id
that is to be updated using
getBranchFormsForUpdate()
where the reference Id
in
the BranchForm
may be used to link the request. Similarly,
the BranchForm
has metadata about the data that can be
updated and it can perform validation before submitting the update. The
BranchForm
can only be used once for a successful update
and cannot be reused.
Once a batch of BranchForms
are submitted for update,
an UpdateResponse
is returned for each BranchForm,
although the ordering is not defined. Only errors that pertain to
the entire update operation are returned from updateBranches(),
errors specific to an individual BranchForm
are
indicated in the corresponding UpdateResponse.
UpdateResponses
may be linked to the originating BranchForm
through the BranchForm
Id.
The delete operations delete Branches
in bulk. To unmap
a Branch
from the current Journal,
the
BranchJournalAssignmentSession
should be used. These delete
operations attempt to remove the Branch
itself thus
removing it from all known Journal
catalogs. Bulk delete
operations return the results in DeleteResponses.
Modifier and Type | Method and Description |
---|---|
AliasResponseList |
aliasBranches(AliasRequestList aliasRequests)
Adds an
Id to a Branch for the purpose
of creating compatibility. |
CreateResponseList |
createBranches(BranchBatchFormList branchForms)
Creates a new set of
Branches. |
DeleteResponseList |
deleteAllBranches()
Deletes all
Branches in this Journal . |
DeleteResponseList |
deleteBranches(IdList branchIds)
Deletes branches for the given
Ids. |
DeleteResponseList |
deleteIneffectiveBranchesByDate(DateTime date)
Deletes branches expired before the given date.
|
BranchBatchFormList |
getBranchFormsForCreate(IdList journalEntryIds,
Type[] branchRecordTypes)
Gets the branch forms for creating a bunch of new branches.
|
BranchBatchFormList |
getBranchFormsForUpdate(IdList branchIds)
Gets the branch forms for updating an existing set of branches.
|
UpdateResponseList |
updateBranches(BranchBatchFormList branchForms)
Updates existing branches.
|
aliasBranch, canCreateBranch, canCreateBranches, canCreateBranchWithRecordTypes, canDeleteBranches, canManageBranchAliases, canMergeBranches, canSupersedeBranches, canUpdateBranches, createBranch, deleteBranch, getBranchFormForCreate, getBranchFormForUpdate, getJournal, getJournalId, mergeBranches, supersedeBranch, updateBranch
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
BranchBatchFormList getBranchFormsForCreate(IdList journalEntryIds, Type[] branchRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
journalEntryIds
- a list of journal entry Ids
branchRecordTypes
- array of branch record types to be included
in each create operation or an empty list if noneNotFoundException
- a journalEntryId
is
not foundNullArgumentException
- journalEntryIds
or branchRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to request forms with
given record typesmandatory
- This method must be implemented. CreateResponseList createBranches(BranchBatchFormList branchForms) throws OperationFailedException, PermissionDeniedException
Branches.
This method returns an
error if the entire operation fails. Otherwise, the status of an
individual create operation is indicated in the
BatchCreateResponse
.branchForms
- the branch formsNullArgumentException
- branchForms
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. BranchBatchFormList getBranchFormsForUpdate(IdList branchIds) throws NotFoundException, OperationFailedException, PermissionDeniedException
branchIds
- the Ids
of the Branch
NotFoundException
- a branchId
is not
foundNullArgumentException
- branchIds
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. UpdateResponseList updateBranches(BranchBatchFormList branchForms) throws OperationFailedException, PermissionDeniedException
BatchCreateResponse
.branchForms
- the form containing the elements to be updatedNullArgumentException
- branchForms
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DeleteResponseList deleteAllBranches() throws OperationFailedException, PermissionDeniedException
Branches
in this Journal
.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DeleteResponseList deleteBranches(IdList branchIds) throws OperationFailedException, PermissionDeniedException
Ids.
branchIds
- the Ids
of the branches to deleteNullArgumentException
- branchIds
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DeleteResponseList deleteIneffectiveBranchesByDate(DateTime date) throws OperationFailedException, PermissionDeniedException
date
- a dateNullArgumentException
- date
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. AliasResponseList aliasBranches(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException
Id
to a Branch
for the purpose
of creating compatibility. The primary Id
of the
Branch
is determined by the provider. The new Id
is an alias to the primary Id.
If the alias is
a pointer to another branch, it is reassigned to the given branch
Id.
aliasRequests
- the alias requestsNullArgumentException
- aliasRequests
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.