OSID Logo
OSID Specifications
relationship package
Version 3.0.0
Release Candidate Preview
Interfaceosid.relationship.RelationshipAdminSession
Implementsosid.OsidSession
Description

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

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

The delete operations delete Relationships. To unmap a Relationship from the current Family, the RelationshipFamilyAssignmentSession should be used. These delete operations attempt to remove the Relationship itself thus removing it from all known Family catalogs.

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

MethodgetFamilyId
Description

Gets the Familt Id associated with this session.

Returnosid.id.Idthe Family Id associated with this session
CompliancemandatoryThis method must be implemented.
MethodgetFamily
Description

Gets the Family associated with this session.

Returnosid.relationship.Familythe family
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanCreateRelationships
Description

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

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

Parametersosid.type.Type[]relationshipRecordTypesarray of relationship record types
Returnboolean true if Relationship creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT relationshipRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetRelationshipFormForCreate
Description

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

Parametersosid.id.IdsourceId Id of a peer
osid.id.IddestinationId Id of the related peer
osid.type.Type[]relationshipRecordTypesarray of relationship record types
Returnosid.relationship.RelationshipFormthe relationship form
ErrorsNOT_FOUND sourceId or destinationId is not found
NULL_ARGUMENT sourceId or destinationId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested recod types
CompliancemandatoryThis method must be implemented.
MethodcreateRelationship
Description

Creates a new Relationship.

Parametersosid.relationship.RelationshipFormrelationshipFormthe form for this Relationship
Returnosid.relationship.Relationshipthe new Relationship
ErrorsILLEGAL_STATE relationshipForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT relationshipForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED relationshipForm did not originate from getRelationshipFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateRelationships
Description

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

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

Parametersosid.id.IdrelationshipIdthe Id of the Relationship
Returnosid.relationship.RelationshipFormthe relationship form
ErrorsNOT_FOUND relationshipId is not found
NULL_ARGUMENT relationshipId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateRelationship
Description

Updates an existing relationship.

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

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

Deletes a Relationship.

Parametersosid.id.IdrelationshipIdthe Id of the Relationship to remove
ErrorsNOT_FOUND relationshipId not found
NULL_ARGUMENT relationshipId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageRelationshipAliases
Description

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

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

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