OSID Logo
OSID Specifications
topology package
Version 3.0.0
Release Candidate Preview
Interfaceosid.topology.EdgeAdminSession
Implementsosid.OsidSession
Description

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

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

The delete operations delete Edges. To unmap an Edge from the current Graph, the EdgeGraphAssignmentSession should be used. These delete operations attempt to remove the Edge itself thus removing it from all known Graph catalogs.

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

MethodgetGraphId
Description

Gets the Graph Id associated with this session.

Returnosid.id.Idthe Graph Id associated with this session
CompliancemandatoryThis method must be implemented.
MethodgetGraph
Description

Gets the Graph associated with this session.

Returnosid.topology.Graphthe graph
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanCreateEdges
Description

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

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

Parametersosid.type.Type[]edgeRecordTypesarray of edge record types
Returnboolean true if Edge creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT edgeRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetEdgeFormForCreate
Description

Gets the edge form for creating new edges. A new form should be requested for each create transaction.

Parametersosid.id.IdsourceNodeIdthe Id of the starting node.
osid.id.IddestinationNodeIdthe Id of the ending node.
osid.type.Type[]edgeRecordTypesarray of edge record types
Returnosid.topology.EdgeFormthe edge form
ErrorsNOT_FOUND sourceNodeId or destinationNodeId is not found
NULL_ARGUMENT sourceNodeId, destinationNodeId, or edgeRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateEdge
Description

Creates a new Edge.

Parametersosid.topology.EdgeFormedgeFormthe form for this Edge
Returnosid.topology.Edgethe new Edge
ErrorsILLEGAL_STATE edgeForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT edgeForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED edgeForm did not originate from getEdgeFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateEdges
Description

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

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

Parametersosid.id.IdedgeIdthe Id of the Edge
Returnosid.topology.EdgeFormthe edge form
ErrorsNOT_FOUND edgeId is not found
NULL_ARGUMENT edgeId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateEdge
Description

Updates an existing edge.

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

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

Deletes an Edge.

Parametersosid.id.IdedgeIdthe Id of the Edge to remove
ErrorsNOT_FOUND edgeId not found
NULL_ARGUMENT edgeId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageEdgeAliases
Description

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

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

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