OSID Logo
OSID Specifications
resource package
Version 3.0.0
Release Candidate Preview
Interfaceosid.resource.ResourceRelationshipAdminSession
Implementsosid.OsidSession
Description

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

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

The delete operations delete ResourceRelationships. To unmap s ResourceRelationship from the current Bin, the ResourceRelationshipBinAssignmentSession should be used. These delete operations attempt to remove the ResourceRelationship itself thus removing it from all known Bin catalogs.

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

MethodgetBinId
Description

Gets the Bin Id associated with this session.

Returnosid.id.Idthe Bin Id associated with this session
CompliancemandatoryThis method must be implemented.
MethodgetBin
Description

Gets the Bin associated with this session.

Returnosid.resource.Binthe bin
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanCreateResourceRelationships
Description

Tests if this user can create ResourceRelationships. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a ResourceRelationship will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.

Returnboolean false if ResourceRelationship creation is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodcanCreateResourceRelationshipWithRecordTypes
Description

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

Parametersosid.type.Type[]resourceRelationshipRecordTypesarray of resource relationship types
Returnboolean true if ResourceRelationship creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT resourceRelationshipRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetResourceRelationshipFormForCreate
Description

Gets the relationship form for creating new relationships. A new form should be requested for each create transaction.

Parametersosid.id.IdsourceResourceIdthe Id of the source Resource
osid.id.IddestinationResourceIdthe Id of the destination Resource
osid.type.Type[]resourceRelationshipRecordTypesarray of resource relationship types
Returnosid.resource.ResourceRelationshipFormthe relationship form
ErrorsNOT_FOUND sourceResourceId or destinationResourceId is not found
NULL_ARGUMENT resourceId or peerResourceId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form with requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateResourceRelationship
Description

Creates a new ResourceRelationship.

Parametersosid.resource.ResourceRelationshipFormresourceRelationshipFormthe form for this ResourceRelationship
Returnosid.resource.ResourceRelationshipthe new ResourceRelationship
ErrorsILLEGAL_STATE resourceRelationshipForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT resourceId, peerResourceId or resourceRelationshipForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED resourceRelationshipForm did not originate from getResourceRelationshipFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateResourceRelationships
Description

Tests if this user can update ResourceRelationships. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a ResourceRelationship will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.

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

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

Parametersosid.id.IdresourceRelationshipIdthe Id of the ResourceRelationship
Returnosid.resource.ResourceRelationshipFormthe relationship form
ErrorsNOT_FOUND resourceRelationshipId not found
NULL_ARGUMENT resourceRelationshipId or aliasId is null
OPERATION_FAILEDunable to complete request
CompliancemandatoryThis method must be implemented.
MethodupdateResourceRelationship
Description

Updates an existing relationship.

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

Tests if this user can delete ResourceRelationships. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a ResourceRelationship will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.

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

Deletes the ResourceRelationship identified by the given Id.

Parametersosid.id.IdresourceRelationshipIdthe Id of the ResourceRelationship to delete
ErrorsNOT_FOUNDa ResourceRelationship was not found identified by the given Id
NULL_ARGUMENT resourceRelationshipId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageResourceRelationshipAliases
Description

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

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

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