Interface EdgeGraphAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface EdgeGraphAssignmentSession extends OsidSession

This session provides methods to re-assign Edges to Graph objects An Edge may appear in multiple Graph objects and removing the last reference to an Edge 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 an Edge to another Graph is not a copy operation (eg: does not change its Id ).

  • Method Details

    • canAssignEdges

      boolean canAssignEdges()
      Tests if this user can alter edge/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.
    • canAssignEdgesToGraph

      boolean canAssignEdgesToGraph(Id graphId)
      Tests if this user can alter edge/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 edge 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.
    • getAssignableGraphIdsForEdge

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

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

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

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