OSID Logo
OSID Specifications
hierarchy package
Version 3.0.0
Release Candidate Preview
Interfaceosid.hierarchy.HierarchyAdminSession
Implementsosid.OsidSession
Description

This session creates, updates, and deletes Hierarchies. 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 Hierarchy, a HierarchyForm is requested using getHierarchyFormForCreate() specifying the desired record Types or none if no record Types are needed. The returned HierarchyForm 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 HierarchyForm is submiited to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each HierarchyForm corresponds to an attempted transaction.

For updates, HierarchyForms are requested to the Hierarchy Id that is to be updated using getHierarchyFormForUpdate(). Similarly, the HierarchyForm has metadata about the data that can be updated and it can perform validation before submitting the update. The HierarchyForm can only be used once for a successful update and cannot be reused.

The delete operations delete Hierarchies.

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

MethodcanCreateHierarchies
Description

Tests if this user can create Hierarchy objects. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a Hierarchy 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 Hierarchy creation is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodcanCreateHierarchyWithRecordTypes
Description

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

Parametersosid.type.Type[]hierarchyRecordTypesarray of hierarchy record types
Returnboolean true if Hierarchy creation using the specified Types is supported, false otherwise
ErrorsNULL_ARGUMENT hierarchyRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetHierarchyFormForCreate
Description

Gets the hierarchy form for creating new hierarchies. A new form should be requested for each create transaction. This method is used for creating new hierarchies, where only the Hierarchy Type is known.

Parametersosid.type.Type[]hierarchyRecordTypesarray of hierarchy record types
Returnosid.hierarchy.HierarchyFormthe hierarchy form
ErrorsNULL_ARGUMENT hierarchyRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateHierarchy
Description

Creates a new Hierarchy.

Parametersosid.hierarchy.HierarchyFormhierarchyFormthe form for this Hierarchy
Returnosid.hierarchy.Hierarchythe new Hierarchy
ErrorsILLEGAL_STATE hierarchyForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT hierarchyForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED hierarchyForm did not originate from getHierarchyFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateHierarchies
Description

Tests if this user can update Hierarchy objects. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a Hierarchy 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 Hierarchy modification is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodgetHierarchyFormForUpdate
Description

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

Parametersosid.id.IdhierarchyIdthe Id of the Hierarchy
Returnosid.hierarchy.HierarchyFormthe hierarchy form
ErrorsNOT_FOUND hierarchyId is not found
NULL_ARGUMENT hierarchyId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateHierarchy
Description

Updates an existing hierarchy.

Parametersosid.hierarchy.HierarchyFormhierarchyFormthe form containing the elements to be updated
ErrorsILLEGAL_STATE hierarchyForm already used in an update transaction
INVALID_ARGUMENTthe form contains an invalid value
NULL_ARGUMENT hierarchyId or hierarchyForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED hierarchyForm did not originate from getHierarchyFormForUpdate()
CompliancemandatoryThis method must be implemented.
MethodcanDeleteHierarchies
Description

Tests if this user can delete Hierarchy objects. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a Hierarchy 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 Hierarchy deletion is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethoddeleteHierarchy
Description

Deletes a Hierarchy.

Parametersosid.id.IdhierarchyIdthe Id of the Hierarchy to remove
ErrorsNOT_FOUND hierarchyId not found
NULL_ARGUMENT hierarchyId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageHierarchyAliases
Description

Tests if this user can manage Id aliases for Hierarchy objects. 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 Hierarchy aliasing is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodaliasHierarchy
Description

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

Parametersosid.id.IdhierarchyIdthe Id of an Hierarchy
osid.id.IdaliasIdthe alias Id
ErrorsALREADY_EXISTS aliasId is already assigned
NOT_FOUND hierarchyId not found
NULL_ARGUMENT hierarchyId or aliasId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.