Interface LocationMapAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface LocationMapAssignmentSession extends OsidSession

This session provides methods to re-assign Locations to Maps . A Location may appear in multiple Maps and removing the last reference to a Location is the equivalent of deleting it. Each Map may have its own authorizations governing who is allowed to operate on it.

Adding a reference of a Location to another Map is not a copy operation (eg: does not change its Id ).

  • Method Details

    • canAssignLocations

      boolean canAssignLocations()
      Tests if this user can alter location/map mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known location methods in this session will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.
      Returns:
      false if location is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canAssignLocationsToMap

      boolean canAssignLocationsToMap(Id mapId)
      Tests if this user can alter location/map mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known location methods in this session will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.
      Parameters:
      mapId - the Id of the Map
      Returns:
      false if mapping is not authorized, true otherwise
      Throws:
      NullArgumentException - mapId is null
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableMapIds

      IdList getAssignableMapIds(Id mapId) throws OperationFailedException
      Gets a list of maps including and under the given map node in which any location can be assigned.
      Parameters:
      mapId - the Id of the Map
      Returns:
      list of assignable map Ids
      Throws:
      NullArgumentException - mapId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableMapIdsForLocation

      IdList getAssignableMapIdsForLocation(Id mapId, Id locationId) throws OperationFailedException
      Gets a list of maps including and under the given map node in which a specific location can be assigned.
      Parameters:
      mapId - the Id of the Map
      locationId - the Id of the Location
      Returns:
      list of assignable map Ids
      Throws:
      NullArgumentException - mapId or locationId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • assignLocationToMap

      void assignLocationToMap(Id locationId, Id mapId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Adds an existing Location to a Map .
      Parameters:
      locationId - the Id of the Location
      mapId - the Id of the Map
      Throws:
      AlreadyExistsException - locationId is already assigned to mapId
      NotFoundException - locationId or mapId not found
      NullArgumentException - locationId or mapId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • unassignLocationFromMap

      void unassignLocationFromMap(Id locationId, Id mapId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Removes a Location from a Map .
      Parameters:
      locationId - the Id of the Location
      mapId - the Id of the Map
      Throws:
      NotFoundException - locationId or mapId not found or locationId not assigned to mapId
      NullArgumentException - locationId or mapId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • reassignLocationToMap

      void reassignLocationToMap(Id locationId, Id fromMapId, Id toMapId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Moves a Map from one Location to another. Mappings to other Locations are unaffected.
      Parameters:
      locationId - the Id of the Location
      fromMapId - the Id of the current Map
      toMapId - the Id of the destination Map
      Throws:
      AlreadyExistsException - locationId already assigned to toMapId
      NotFoundException - locationId, fromMapId , or toMapId not found or locationId not mapped to fromMapId
      NullArgumentException - locationId, fromMapId , or toMapId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.