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

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

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

The delete operations delete Nodes. To unmap a Node from the current Graph, the NodeGraphAssignmentSession should be used. These delete operations attempt to remove the Node 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.
MethodcanCreateNodes
Description

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

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

Parametersosid.type.Type[]nodeRecordTypesarray of node record types
Returnboolean true if Node creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT nodeRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetNodeFormForCreate
Description

Gets the node form for creating new nodes. A new form should be requested for each create transaction.

Parametersosid.type.Type[]nodeRecordTypesarray of node record types
Returnosid.topology.NodeFormthe node form
ErrorsNULL_ARGUMENT nodeRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateNode
Description

Creates a new Node.

Parametersosid.topology.NodeFormnodeFormthe form for this Node
Returnosid.topology.Nodethe new Node
ErrorsILLEGAL_STATEnodeForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT nodeForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED nodeForm did not originate from getNodeFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateNodes
Description

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

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

Parametersosid.id.IdnodeIdthe Id of the Node
Returnosid.topology.NodeFormthe node form
ErrorsNOT_FOUND nodeId is not found
NULL_ARGUMENT nodeId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateNode
Description

Updates an existing node.

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

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

Deletes a Node.

Parametersosid.id.IdnodeIdthe Id of the Node to remove
ErrorsNOT_FOUND nodeId not found
NULL_ARGUMENT nodeId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageNodeAliases
Description

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

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

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