Interface EdgeAdminSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
All Known Subinterfaces:
EdgeBatchAdminSession

public interface EdgeAdminSession extends OsidSession

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.

  • Method Details

    • getGraphId

      Id getGraphId()
      Gets the Graph Id associated with this session.
      Returns:
      the Graph Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getGraph

      Gets the Graph associated with this session.
      Returns:
      the graph
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canCreateEdges

      boolean canCreateEdges()
      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.
      Returns:
      false if Edge creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateEdgeWithRecordTypes

      boolean canCreateEdgeWithRecordTypes(Type[] edgeRecordTypes)
      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.
      Parameters:
      edgeRecordTypes - array of edge record types
      Returns:
      true if Edge creation using the specified record Types is supported, false otherwise
      Throws:
      NullArgumentException - edgeRecordTypes is null
      Compliance:
      mandatory - This method must be implemented.
    • getEdgeFormForCreate

      EdgeForm getEdgeFormForCreate(Id sourceNodeId, Id destinationNodeId, Type[] edgeRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the edge form for creating new edges. A new form should be requested for each create transaction.
      Parameters:
      sourceNodeId - the Id of the starting node.
      destinationNodeId - the Id of the ending node.
      edgeRecordTypes - array of edge record types
      Returns:
      the edge form
      Throws:
      NotFoundException - sourceNodeId or destinationNodeId is not found
      NullArgumentException - sourceNodeId, destinationNodeId , or edgeRecordTypes is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - unable to get form for requested record types
      Compliance:
      mandatory - This method must be implemented.
    • createEdge

      Creates a new Edge .
      Parameters:
      edgeForm - the form for this Edge
      Returns:
      the new Edge
      Throws:
      IllegalStateException - edgeForm already used in a create transaction
      InvalidArgumentException - one or more of the form elements is invalid
      NullArgumentException - edgeForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - edgeForm did not originate from getEdgeFormForCreate()
      Compliance:
      mandatory - This method must be implemented.
    • canUpdateEdges

      boolean canUpdateEdges()
      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.
      Returns:
      false if Edge modification is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getEdgeFormForUpdate

      Gets the edge form for updating an existing edge. A new edge form should be requested for each update transaction.
      Parameters:
      edgeId - the Id of the Edge
      Returns:
      the edge form
      Throws:
      NotFoundException - edgeId is not found
      NullArgumentException - edgeId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • updateEdge

      void updateEdge(EdgeForm edgeForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing edge.
      Parameters:
      edgeForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - edgeForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - edgeForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - edgeForm did not originate from getEdgeFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteEdges

      boolean canDeleteEdges()
      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.
      Returns:
      false if Edge deletion is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • deleteEdge

      Deletes an Edge .
      Parameters:
      edgeId - the Id of the Edge to remove
      Throws:
      NotFoundException - edgeId not found
      NullArgumentException - edgeId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canManageEdgeAliases

      boolean canManageEdgeAliases()
      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.
      Returns:
      false if Edge aliasing is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • aliasEdge

      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 .
      Parameters:
      edgeId - the Id of an Edge
      aliasId - the alias Id
      Throws:
      AlreadyExistsException - aliasId is already assigned
      NotFoundException - edgeId not found
      NullArgumentException - edgeId or aliasId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.