Interface NodeGraphAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface NodeGraphAssignmentSession extends OsidSession

This session provides methods to re-assign Nodes to Graph objects A Node may appear in multiple Graph objects and removing the last reference to a Node is the equivalent of deleting it. Each Graph may have its own authorizations governing who is allowed to operate on it.

Adding a reference of a Node to another Graph is not a copy operation (eg: does not change its Id ).

  • Method Details

    • canAssignNodes

      boolean canAssignNodes()
      Tests if this user can alter node/graph mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.
      Returns:
      false if mapping is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canAssignNodesToGraph

      boolean canAssignNodesToGraph(Id graphId)
      Tests if this user can alter node/graph mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.
      Parameters:
      graphId - the Id of the Graph
      Returns:
      false if mapping is not authorized, true otherwise
      Throws:
      NullArgumentException - graphId is null
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableGraphIds

      IdList getAssignableGraphIds(Id graphId) throws OperationFailedException
      Gets a list of graphs including and under the given graph node in which any node can be assigned.
      Parameters:
      graphId - the Id of the Graph
      Returns:
      list of assignable graph Ids
      Throws:
      NullArgumentException - graphId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableGraphIdsForNode

      IdList getAssignableGraphIdsForNode(Id graphId, Id nodeId) throws OperationFailedException
      Gets a list of graphs including and under the given graph node in which a specific node can be assigned.
      Parameters:
      graphId - the Id of the Graph
      nodeId - the Id of the Node
      Returns:
      list of assignable graph Ids
      Throws:
      NullArgumentException - graphId or nodeId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • assignNodeToGraph

      Adds an existing Node to a Graph .
      Parameters:
      nodeId - the Id of the Node
      graphId - the Id of the Graph
      Throws:
      AlreadyExistsException - nodeId is already assigned to graphId
      NotFoundException - nodeId or graphId not found
      NullArgumentException - nodeId or graphId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • unassignNodeFromGraph

      void unassignNodeFromGraph(Id nodeId, Id graphId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Removes a Node from a Graph .
      Parameters:
      nodeId - the Id of the Node
      graphId - the Id of the Graph
      Throws:
      NotFoundException - nodeId or graphId not found or nodeId not assigned to graphId
      NullArgumentException - nodeId or graphId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • reassignNodeToGraph

      void reassignNodeToGraph(Id nodeId, Id fromGraphId, Id toGraphId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Moves a Node from one Graph to another. Mappings to other Graphs are unaffected.
      Parameters:
      nodeId - the Id of the Node
      fromGraphId - the Id of the current Graph
      toGraphId - the Id of the destination Graph
      Throws:
      AlreadyExistsException - nodeId already assigned to toGraphId
      NotFoundException - nodeId, fromGraphId , or toGraphId not found or nodeId not mapped to fromGraphId
      NullArgumentException - nodeId, fromGraphId , or toGraphId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.