Interface PathAdminSession

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

public interface PathAdminSession extends OsidSession

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

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

The delete operations delete Paths . To unmap a Path from the current Map , the PathMapAssignmentSession should be used. These delete operations attempt to remove the Path 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.
    • canCreatePaths

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

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

      PathForm getPathFormForCreate(Type[] pathRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the path form for creating new paths. A new form should be requested for each create transaction.
      Parameters:
      pathRecordTypes - array of path record types
      Returns:
      the path form
      Throws:
      NullArgumentException - pathRecordTypes 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.
    • createPath

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

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

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

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

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

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

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

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