Interface ResourcePositionNotificationSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface ResourcePositionNotificationSession extends OsidSession

This session defines methods to receive notifications on adds/changes to resource positions in this Map . This session is intended for consumers needing to synchronize their state with this service without the use of polling. Notifications are cancelled when this session is closed.

  • 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.
    • canRegisterForResourcePathNotifications

      boolean canRegisterForResourcePathNotifications()
      Tests if this user can register for notifications. A return of true does not guarantee successful authorization. A return of false indicates that it is known all methods in this session will result in a PERMISSION_DENIED . This is intended as a hint to an application that may wish not to offer notification operations to unauthorized users.
      Returns:
      false if notification methods are not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • useFederatedMapView

      void useFederatedMapView()
      Federates the view for methods in this session. A federated view will include positions in maps which are children of this map in the map hierarchy.
      Compliance:
      mandatory - This method is must be implemented.
    • useIsolatedMapView

      void useIsolatedMapView()
      Isolates the view for methods in this session. An isolated view restricts notifications to this map only.
      Compliance:
      mandatory - This method is must be implemented.
    • registerForMovedResources

      void registerForMovedResources() throws OperationFailedException, PermissionDeniedException
      Registers for notification of moved resources. ResourcePositionReceiver.movedResource() is invoked when a resource changes coordinates.
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForMovedResource

      void registerForMovedResource(Id resourceId) throws OperationFailedException, PermissionDeniedException
      Registers for notification of moved resources. ResourcePositionReceiver.movedResource() is invoked when the specified resource changes coordinates.
      Parameters:
      resourceId - the Id of the Resource to monitor
      Throws:
      NullArgumentException - resourceId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForMovedResourcesByGenusType

      void registerForMovedResourcesByGenusType(Type resourceGenusType) throws OperationFailedException, PermissionDeniedException
      Registers for notification of moved resources for the given resource genus type. ResourcePositionReceiver.movedResource() is invoked when a resource changes coordinates.
      Parameters:
      resourceGenusType - the genus type of the Resource to monitor
      Throws:
      NullArgumentException - resourceGenusType is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForEnteredSpatialUnit

      void registerForEnteredSpatialUnit(SpatialUnit spatialUnit) throws OperationFailedException, PermissionDeniedException
      Register for notifications of an entered spatial unit. ResourcePositionReceiver.enteredSpatialUnit() is invoked when a resource appears in the specified spatial unit.
      Parameters:
      spatialUnit - the SpatialUnit to monitor
      Throws:
      NullArgumentException - spatialUnit is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - spatial unit not supported
      Compliance:
      mandatory - This method must be implemented.
    • registerForEnteredSpatialUnitForResource

      void registerForEnteredSpatialUnitForResource(Id resourceId, SpatialUnit spatialUnit) throws OperationFailedException, PermissionDeniedException
      Register for notifications of an entered spatial unit. ResourcePositionReceiver.enteredSpatialUnit() is invoked when the specified resource appears in the specified spatial unit.
      Parameters:
      resourceId - the Id of the Resource to monitor
      spatialUnit - the SpatialUnit to monitor
      Throws:
      NullArgumentException - resourceId or spatialUnit is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - spatial unit not supported
      Compliance:
      mandatory - This method must be implemented.
    • registerForEnteredSpatialUnitForResourceByGenusType

      void registerForEnteredSpatialUnitForResourceByGenusType(Id resourceGenusType, SpatialUnit spatialUnit) throws OperationFailedException, PermissionDeniedException
      Register for notifications of an entered spatial unit for resources of the given resource genus type. ResourcePositionReceiver.enteredSpatialUnit() is invoked when the specified resource appears in the specified spatial unit.
      Parameters:
      resourceGenusType - the genus type of the Resource to monitor
      spatialUnit - the SpatialUnit to monitor
      Throws:
      NullArgumentException - resourceGenusType or spatialUnit is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - spatial unit not supported
      Compliance:
      mandatory - This method must be implemented.
    • registerForExitedSpatialUnit

      void registerForExitedSpatialUnit(SpatialUnit spatialUnit) throws OperationFailedException, PermissionDeniedException
      Register for notifications of an exited spatial unit. ResourcePositionReceiver.exitedSpatialUnit() is invoked when a resource exits the specified spatial unit.
      Parameters:
      spatialUnit - the SpatialUnit to monitor
      Throws:
      NullArgumentException - spatialUnit is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - spatial unit not supported
      Compliance:
      mandatory - This method must be implemented.
    • registerForExitedSpatialUnitForResource

      void registerForExitedSpatialUnitForResource(Id resourceId, SpatialUnit spatialUnit) throws OperationFailedException, PermissionDeniedException
      Register for notifications of an exited spatial unit. ResourcePositionReceiver.exitedSpatialUnit() is invoked when the specified resource exits the specified spatial unit.
      Parameters:
      resourceId - the Id of the Resource to monitor
      spatialUnit - the SpatialUnit to monitor
      Throws:
      NullArgumentException - resourceId or spatialUnit is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - spatial unit not supported
      Compliance:
      mandatory - This method must be implemented.
    • registerForExitedSpatialUnitForResourcesByGenusType

      void registerForExitedSpatialUnitForResourcesByGenusType(Type resourceGenusType, SpatialUnit spatialUnit) throws OperationFailedException, PermissionDeniedException
      Register for notifications of an exited spatial unit for the given resource genus type. ResourcePositionReceiver.exitedSpatialUnit() is invoked when a resource exits the specified spatial unit.
      Parameters:
      resourceGenusType - the genus type of the Resource to monitor
      spatialUnit - the SpatialUnit to monitor
      Throws:
      NullArgumentException - resourceGenusTYpe or spatialUnit is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - spatial unit not supported
      Compliance:
      mandatory - This method must be implemented.