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

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

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

The delete operations delete Graphs.

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

MethodcanCreateGraphs
Description

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

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

Parametersosid.type.Type[]graphRecordTypesarray of graph record types
Returnboolean true if Graph creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT graphRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetGraphFormForCreate
Description

Gets the graph form for creating new graphs. A new form should be requested for each create transaction.

Parametersosid.type.Type[]graphRecordTypesarray of graph record types
Returnosid.topology.GraphFormthe graph form
ErrorsNULL_ARGUMENT graphRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateGraph
Description

Creates a new Graph.

Parametersosid.topology.GraphFormgraphFormthe form for this Graph
Returnosid.topology.Graphthe new Graph
ErrorsILLEGAL_STATE graphForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT graphForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED graphForm did not originate from getGraphFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateGraphs
Description

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

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

Parametersosid.id.IdgraphIdthe Id of the Graph
Returnosid.topology.GraphFormthe graph form
ErrorsNOT_FOUND graphId is not found
NULL_ARGUMENT graphId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateGraph
Description

Updates an existing graph

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

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

Deletes a Graph.

Parametersosid.id.IdgraphIdthe Id of the Graph to remove
ErrorsNOT_FOUND graphId not found
NULL_ARGUMENT graphId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageGraphAliases
Description

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

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

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