Interface ObstacleAdminSession

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

public interface ObstacleAdminSession extends OsidSession

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

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

The delete operations delete Obstacles . To unmap an Obstacle from the current Map , the ObstacleMapAssignmentSession should be used. These delete operations attempt to remove the Obstacle 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.
    • canCreateObstacles

      boolean canCreateObstacles()
      Tests if this user can create Obstacles . A return of true does not guarantee successful authorization. A return of false indicates that it is known creating an Obstacle 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 Obstacle creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateObstacleWithRecordTypes

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

      ObstacleForm getObstacleFormForCreate(Id pathId, Type[] obstacleRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the obstable form for creating new obstables. A new form should be requested for each create transaction.
      Parameters:
      pathId - the Id of the path
      obstacleRecordTypes - array of obstacle record types
      Returns:
      the obstable form
      Throws:
      NotFoundException - pathId is not found
      NullArgumentException - pathId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - unable to get form with given record types
      Compliance:
      mandatory - This method must be implemented.
    • createObstacle

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

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

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

      void updateObstacle(ObstacleForm obstacleForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing obstable.
      Parameters:
      obstacleForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - obstacleForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - obstacleId or obstableForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - obstacleForm did not originate from getObstacleFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteObstacles

      boolean canDeleteObstacles()
      Tests if this user can delete Obstacles . A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting an Obstacle 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 Obstacle deletion is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • deleteObstacle

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

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

      Adds an Id to an Obstacle for the purpose of creating compatibility. The primary Id of the Obstacle is determined by the provider. The new Id performs as an alias to the primary Id . If the alias is a pointer to another obstabce, it is reassigned to the given obstacle Id .
      Parameters:
      obstacleId - the Id of an Obstacle
      aliasId - the alias Id
      Throws:
      AlreadyExistsException - aliasId is already assigned
      NotFoundException - obstacleId not found
      NullArgumentException - obstacleId or aliasId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.