Interface BranchBatchAdminSession
- All Superinterfaces:
AutoCloseable, BranchAdminSession, Closeable, OsidSession, OsidSession
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 .
-
Method Summary
Modifier and TypeMethodDescriptionaliasBranches(AliasRequestList aliasRequests) Adds anIdto aBranchfor the purpose of creating compatibility.createBranches(BranchBatchFormList branchForms) Creates a new set ofBranches.Deletes allBranchesin thisJournal.deleteBranches(IdList branchIds) Deletes branches for the givenIds.Deletes branches expired before the given date.getBranchFormsForCreate(IdList journalEntryIds, Type[] branchRecordTypes) Gets the branch forms for creating a bunch of new branches.getBranchFormsForUpdate(IdList branchIds) Gets the branch forms for updating an existing set of branches.updateBranches(BranchBatchFormList branchForms) Updates existing branches.Methods inherited from interface BranchAdminSession
aliasBranch, canCreateBranch, canCreateBranches, canCreateBranchWithRecordTypes, canDeleteBranches, canManageBranchAliases, canMergeBranches, canSupersedeBranches, canUpdateBranches, createBranch, deleteBranch, getBranchFormForCreate, getBranchFormForUpdate, getJournal, getJournalId, mergeBranches, supersedeBranch, updateBranchModifier and TypeMethodDescriptionvoidaliasBranch(Id branchId, Id aliasId) Adds anIdto aBranchfor the purpose of creating compatibility.booleancanCreateBranch(Id journalEntryId) Tests if this user can branch a specifiedJournalEntry.booleanTests if this user can create branches.booleancanCreateBranchWithRecordTypes(Type[] branchRecordTypes) Tests if this user can create a singleBranchusing the desired record types.booleanTests if this user can delete branches.booleanTests if this user can manageIdaliases for branches.booleanTests if this user can merge branches.booleanTests if this user can supersede branches.booleanTests if this user can update branches.createBranch(BranchForm branchForm) Creates a branch.voiddeleteBranch(Id branchId) Deletes a branch and all associated versions.getBranchFormForCreate(Id journalEntryId, Type[] branchRecordTypes) Gets the branch form for creating new entries.getBranchFormForUpdate(Id branchId) Gets the branch form for updating an existing branch.Gets theJournalassociated with this session.Gets theJournalIdassociated with this session.mergeBranches(Id srcBranchId, Id dstBranchId) Merges the source branch into the destination branch.supersedeBranch(Id srcBranchId, Id dstBranchId) Joins the source branch to the destination branch by creating a new journal entry.voidupdateBranch(BranchForm branchForm) Updates an existing branch.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
-
getBranchFormsForCreate
BranchBatchFormList getBranchFormsForCreate(IdList journalEntryIds, Type[] branchRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the branch forms for creating a bunch of new branches. A form is returned for each supplied journal entry.- Parameters:
journalEntryIds- a list of journal entryIdsbranchRecordTypes- array of branch record types to be included in each create operation or an empty list if none- Returns:
- the branch forms
- Throws:
NotFoundException- ajournalEntryIdis not foundNullArgumentException-journalEntryIdsorbranchRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createBranches
CreateResponseList createBranches(BranchBatchFormList branchForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofBranches. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
branchForms- the branch forms- Returns:
- the create responses
- Throws:
NullArgumentException-branchFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getBranchFormsForUpdate
BranchBatchFormList getBranchFormsForUpdate(IdList branchIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the branch forms for updating an existing set of branches. A new branch form should be requested for each update transaction.- Parameters:
branchIds- theIdsof theBranch- Returns:
- the branch form
- Throws:
NotFoundException- abranchIdis not foundNullArgumentException-branchIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateBranches
UpdateResponseList updateBranches(BranchBatchFormList branchForms) throws OperationFailedException, PermissionDeniedException Updates existing branches. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
branchForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-branchFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllBranches
Deletes allBranchesin thisJournal.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteBranches
DeleteResponseList deleteBranches(IdList branchIds) throws OperationFailedException, PermissionDeniedException Deletes branches for the givenIds.- Parameters:
branchIds- theIdsof the branches to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-branchIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteIneffectiveBranchesByDate
DeleteResponseList deleteIneffectiveBranchesByDate(DateTime date) throws OperationFailedException, PermissionDeniedException Deletes branches expired before the given date.- Parameters:
date- a date- Returns:
- the delete responses
- Throws:
NullArgumentException-dateisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasBranches
AliasResponseList aliasBranches(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aBranchfor the purpose of creating compatibility. The primaryIdof theBranchis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another branch, it is reassigned to the given branchId.- 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.
-