OSID Logo
OSID Specifications
journaling package
Version 3.0.0
Release Candidate Preview
Interfaceosid.journaling.BranchAdminSession
Implementsosid.OsidSession
Description

This session creates, updates, and deletes Branches. 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 getBranchFormForCreate() specifying the desired record Types or none if no record Types are needed. The returned BranchForm 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 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.

For updates, BranchForms are requested to the Branch Id that is to be updated using getBranchFormForUpdate(). 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.

The delete operations delete Branches.

This session includes an Id aliasing mechanism to assign an external Id to an internally assigned Id.

MethodgetJournalId
Description

Gets the Journal Id associated with this session.

Returnosid.id.Idthe Journal Id associated with this session
CompliancemandatoryThis method must be implemented.
MethodgetJournal
Description

Gets the Journal associated with this session.

Returnosid.journaling.Journalthe journal
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanCreateBranches
Description

Tests if this user can branch a version chain. A return of true does not guarantee successful authorization. A return of false indicates that it is known branching 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.

Returnboolean false if journal branching is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodcanCreateBranch
Description

Tests if this user can branch a specified JournalEntry. A return of true does not guarantee successful authorization. A return of false indicates that it is known branching the JournalEntry 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.

Parametersosid.id.IdjournalEntryIdthe Id of the JournalEntry
Returnboolean false if branching is not authorized, true otherwise
ErrorsNULL_ARGUMENT journalEntryId is null
CompliancemandatoryThis method must be implemented.
Provider Notes

If the journalEntryId is not found, then it is acceptable to return false to indicate the lack of branching available.

MethodcanCreateBranchWithRecordTypes
Description

Tests if this user can create a single Branch using the desired record types. While JournalingManager.getBranchRecordTypes() can be used to examine which records are supported, this method tests which record(s) are required for creating a specific Branch. Providing an empty array tests if a Branch can be created with no records.

Parametersosid.type.Type[]branchRecordTypesarray of branch record types
Returnboolean true if Branch creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT branchyRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetBranchFormForCreate
Description

Gets the branch form for creating new entries. A new form should be requested for each create transaction.

Parametersosid.id.IdjournalEntryIdthe Id of the JournalEntry
osid.type.Type[]branchRecordTypesarray of branch record types
Returnosid.journaling.BranchFormthe branch form
ErrorsNOT_FOUND journalEntryId is not found
NULL_ARGUMENT journalEntryId or branchRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateBranch
Description

Creates a branch.

Parametersosid.journaling.BranchFormbranchFormthe branch form
Returnosid.journaling.Brancha the new branch
ErrorsILLEGAL_STATE branchForm already used in a create transaction
INVALID_ARGUMENTthe form contains an invalid value
NULL_ARGUMENT branchForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED branchForm did not originate from getBranchFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateBranches
Description

Tests if this user can update branches. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a Branch 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.

Returnboolean false if Branch modification is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodgetBranchFormForUpdate
Description

Gets the branch form for updating an existing branch. A new journal entry form should be requested for each update transaction.

Parametersosid.id.IdbranchIdthe Id of the Branch
Returnosid.journaling.BranchFormthe branch form
ErrorsNOT_FOUND branchId is not found
NULL_ARGUMENT branchId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateBranch
Description

Updates an existing branch.

Parametersosid.journaling.BranchFormbranchFormthe form containing the elements to be updated
ErrorsILLEGAL_STATE branchForm already used in an update transaction
INVALID_ARGUMENTthe form contains an invalid value
NULL_ARGUMENT branchForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED branchForm did not originate from getBranchFormForUpdate()
CompliancemandatoryThis method must be implemented.
MethodcanMergeBranches
Description

Tests if this user can merge branches. A return of true does not guarantee successful authorization. A return of false indicates that it is known merging Branches will result in a PERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer merging operations to unauthorized users.

Returnboolean false if Branch merging is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodmergeBranches
Description

Merges the source branch into the destination branch. A new journal entry is created to join the two branches.

Parametersosid.id.IdsrcBranchIdthe Id of the Branch to merge from
osid.id.IddstBranchIdthe Id of the Branch to merge into
Returnosid.journaling.JournalEntrya the new journal entry
ErrorsNOT_FOUND branchId not found
NULL_ARGUMENT branchId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanSupersedeBranches
Description

Tests if this user can supersede branches. A return of true does not guarantee successful authorization. A return of false indicates that it is known merging Branches will result in a PERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer superseding operations to unauthorized users.

Returnboolean false if Branch superseding is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodsupersedeBranch
Description

Joins the source branch to the destination branch by creating a new journal entry. The most recent version of the source branch supsrsedes the most recent versiuon of the desitination branch.

Parametersosid.id.IdsrcBranchIdthe Id of the superseding Branch
osid.id.IddstBranchIdthe Id of the Branch to override
Returnosid.journaling.JournalEntrya the new journal entry
ErrorsNOT_FOUND branchId not found
NULL_ARGUMENT branchId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanDeleteBranches
Description

Tests if this user can delete branches. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a Branch 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.

Returnboolean false if Branch deletion is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethoddeleteBranch
Description

Deletes a branch and all associated versions.

Parametersosid.id.IdbranchIdthe Id of the Branch to remove
ErrorsNOT_FOUND branchId not found
NULL_ARGUMENT branchId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageBranchAliases
Description

Tests if this user can manage Id aliases for branches. 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.

Returnboolean false if Branch aliasing is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodaliasBranch
Description

Adds an Id to a Branch for the purpose of creating compatibility. The primary Id of the Branch is determined by the provider. The new Id performs as an alias to the primary Id. If the alias is a pointer to another branch it is reassigned to the given branch Id.

Parametersosid.id.IdbranchIdthe Id of a Branch
osid.id.IdaliasIdthe alias Id
ErrorsALREADY_EXISTS aliasId is already assigned
NOT_FOUND branchId not found
NULL_ARGUMENT branchId or aliasId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.