Interface IntersectionAdminSession

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

public interface IntersectionAdminSession extends OsidSession

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

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

The delete operations delete Intersections . To unmap an Intersection from the current Map , the IntersectionMapAssignmentSession should be used. These delete operations attempt to remove the Intersection itself thus removing it from all known Map catalogs.

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

  • Method Details

    • getMapId

      Id getMapId()
      Gets the Map Id associated with this session.
      Returns:
      the Map Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getMap

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

      boolean canCreateIntersections()
      Tests if this user can create Intersections . A return of true does not guarantee successful authorization. A return of false indicates that it is known creating an Intersection will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer create operations to unauthorized users.
      Returns:
      false if Intersection creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateIntersectionWithRecordTypes

      boolean canCreateIntersectionWithRecordTypes(Type[] intersectionRecordTypes)
      Tests if this user can create a single Intersection using the desired record types. While MappingPathManager.getIntersectionRecordTypes() can be used to examine which records are supported, this method tests which record(s) are required for creating a specific Intersection . Providing an empty array tests if an Intersection can be created with no records.
      Parameters:
      intersectionRecordTypes - array of intersection record types
      Returns:
      true if Intersection creation using the specified record Types is supported, false otherwise
      Throws:
      NullArgumentException - intersectionRecordTypes is null
      Compliance:
      mandatory - This method must be implemented.
    • getIntersectionFormForCreate

      IntersectionForm getIntersectionFormForCreate(Id[] pathIds, Type[] intersectionRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the intersection form for creating new intersections. A new form should be requested for each create transaction.
      Parameters:
      pathIds - the Id of the paths
      intersectionRecordTypes - array of intersection record types
      Returns:
      the intersection form
      Throws:
      NotFoundException - a pathId is not found
      NullArgumentException - pathIds or intersectionRecordTypes is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - unable to get a form with given record types
      Compliance:
      mandatory - This method must be implemented.
    • createIntersection

      Creates a new Intersection .
      Parameters:
      intersectionForm - an intersection form
      Returns:
      the new Intersection
      Throws:
      IllegalStateException - intersectionForm already used in a create transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - pathIds or intersectionForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - intersectionForm did not originate from getIntersectionFormForCreate()
      Compliance:
      mandatory - This method must be implemented.
    • canUpdateIntersections

      boolean canUpdateIntersections()
      Tests if this user can update Intersections . A return of true does not guarantee successful authorization. A return of false indicates that it is known updating an Intersection 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 Intersection modification is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canUpdateIntersection

      boolean canUpdateIntersection(Id intersectionId)
      Tests if this user can update a specified Intersection . A return of true does not guarantee successful authorization. A return of false indicates that it is known updating the Intersection will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer an update operation to an unauthorized user for this intersection.
      Parameters:
      intersectionId - the Id of the Intersection
      Returns:
      false if intersection modification is not authorized, true otherwise
      Throws:
      NullArgumentException - intersectionId is null
      Compliance:
      mandatory - This method must be implemented.
      Notes:
      If - the {@code intersectionId} is not found, then it is acceptable to return false to indicate the lack of an update available.
    • getIntersectionFormForUpdate

      IntersectionForm getIntersectionFormForUpdate(Id intersectionId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the intersection form for updating an existing intersection. A new intersection form should be requested for each update transaction.
      Parameters:
      intersectionId - the Id of the Intersection
      Returns:
      the intersection form
      Throws:
      NotFoundException - intersectionId is not found
      NullArgumentException - intersectionId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • updateIntersection

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

      void addPathToIntersection(Id intersectionId, Id pathId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Adds a path to an existing intersection.
      Parameters:
      intersectionId - the Id of the Intersection
      pathId - the Id of the a Path
      Throws:
      NotFoundException - intersectionId or pathId is not found
      NullArgumentException - intersectionId or pathId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteIntersections

      boolean canDeleteIntersections()
      Tests if this user can delete Intersections . A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting an Intersection will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer delete operations to unauthorized users.
      Returns:
      false if Intersection deletion is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • deleteIntersection

      void deleteIntersection(Id intersectionId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Deletes an Intersection .
      Parameters:
      intersectionId - the Id of the Intersection to remove
      Throws:
      NotFoundException - intersectionId not found
      NullArgumentException - intersectionId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • removePathFromIntersection

      void removePathFromIntersection(Id intersectionId, Id pathId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Removes a path from an existing intersection.
      Parameters:
      intersectionId - the Id of the Intersection
      pathId - the Id of the Path to remove
      Throws:
      NotFoundException - intersectionId or pathId not found
      NullArgumentException - intersectionId or pathId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canManageIntersectionAliases

      boolean canManageIntersectionAliases()
      Tests if this user can manage Id aliases for Intersections . 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 Intersection aliasing is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • aliasIntersection

      void aliasIntersection(Id intersectionId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Adds an Id to an Intersection for the purpose of creating compatibility. The primary Id of the Intersection is determined by the provider. The new Id performs as an alias to the primary Id .
      Parameters:
      intersectionId - the Id of an Intersection
      aliasId - the alias Id
      Throws:
      AlreadyExistsException - aliasId is already assigned
      NotFoundException - intersectionId not found
      NullArgumentException - intersectionId or aliasId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.