Interface MapAdminSession

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

public interface MapAdminSession extends OsidSession

This session creates, updates, and deletes Maps . The data for create and update is provided by the consumer via the form. OsidForms are requested for each create or update and may not be reused.

Create and update operations differ in their usage. To create a Map , a MapForm is requested using getMapFormForCreate() specifying the desired record Types or none if no record Types are needed. The returned MapForm 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 MapForm is submiited to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each MapForm corresponds to an attempted transaction.

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

The delete operations delete Maps .

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

  • Method Details

    • canCreateMaps

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

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

      MapForm getMapFormForCreate(Type[] mapRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the map form for creating new maps. A new form should be requested for each create transaction.
      Parameters:
      mapRecordTypes - array of map record types
      Returns:
      the map form
      Throws:
      NullArgumentException - mapRecordTypes 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.
    • createMap

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

      boolean canUpdateMaps()
      Tests if this user can update Maps . A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a Map will result in a PERMISSION_DENIED . This is intended as a hint to an application that may not wish to offer update operations to unauthorized users.
      Returns:
      false if Map modification is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getMapFormForUpdate

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

      Updates an existing map
      Parameters:
      mapForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - mapForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - mapId or mapForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - mapForm did not originate from getMapFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteMaps

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

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

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

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