Interface DirectionNotificationSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface DirectionNotificationSession extends OsidSession

This session defines methods to receive notifications on adds/changes to Direction objects in this Cookbook . 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.

The two views defined in this session correspond to the views in the DirectionLookupSession .

  • Method Details

    • getCookbookId

      Id getCookbookId()
      Gets the Cookbook Id associated with this session.
      Returns:
      the Cookbook Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getCookbook

      Gets the Cookbook associated with this session.
      Returns:
      the cookbook
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canRegisterForDirectionNotifications

      boolean canRegisterForDirectionNotifications()
      Tests if this user can register for Direction 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 opt not to offer notification operations.
      Returns:
      false if notification methods are not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • useFederatedCookbookView

      void useFederatedCookbookView()
      Federates the view for methods in this session. A federated view will include directions in cookbooks which are children of this cookbook in the cookbook hierarchy.
      Compliance:
      mandatory - This method is must be implemented.
    • useIsolatedCookbookView

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

      void reliableDirectionNotifications()
      Reliable notifications are desired. In reliable mode, notifications are to be acknowledged using acknowledgeDirectionNotification() .
      Compliance:
      mandatory - This method is must be implemented.
    • unreliableDirectionNotifications

      void unreliableDirectionNotifications()
      Unreliable notifications are desired. In unreliable mode, notifications do not need to be acknowledged.
      Compliance:
      mandatory - This method is must be implemented.
    • acknowledgeDirectionNotification

      void acknowledgeDirectionNotification(Id notificationId) throws OperationFailedException, PermissionDeniedException
      Acknowledge a direction notification.
      Parameters:
      notificationId - the Id of the notification
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForNewDirections

      void registerForNewDirections() throws OperationFailedException, PermissionDeniedException
      Register for notifications of new directions. DirectionReceiver.newDirections() is invoked when a new Direction appears in this cookbook.
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForNewDirectionsForRecipe

      void registerForNewDirectionsForRecipe(Id recipeId) throws OperationFailedException, PermissionDeniedException
      Register for notifications of new directions related to the given recipe. DirectionReceiver.newDirections() is invoked when a new Direction appears in this cookbook.
      Parameters:
      recipeId - the Id of the Recipe to monitor
      Throws:
      NullArgumentException - recipeId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForChangedDirections

      void registerForChangedDirections() throws OperationFailedException, PermissionDeniedException
      Registers for notification of updated directions. DirectionReceiver.changedDirections() is invoked when a direction in this cookbook is changed.
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForChangedDirectionsForRecipe

      void registerForChangedDirectionsForRecipe(Id recipeId) throws OperationFailedException, PermissionDeniedException
      Registers for notification of updated directions related to the given recipe. DirectionReceiver.changedDirections() is invoked when a direction related to the recipe in this cookbook is changed.
      Parameters:
      recipeId - the Id of the Recipe to monitor
      Throws:
      NullArgumentException - recipeId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForChangedDirection

      void registerForChangedDirection(Id directionId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Registers for notification of an updated direction. DirectionReceiver.changedDirections() is invoked when the specified direction in this cookbook is changed.
      Parameters:
      directionId - the Id of the Direction to monitor
      Throws:
      NotFoundException - a direction was not found in this cookbook identified by the given Id
      NullArgumentException - directionId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForDeletedDirections

      void registerForDeletedDirections() throws OperationFailedException, PermissionDeniedException
      Registers for notification of deleted directions. DirectionReceiver.deletedDirection() is invoked when a direction is deleted or removed from this cookbook.
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForDeletedDirectionsForRecipe

      void registerForDeletedDirectionsForRecipe(Id recipeId) throws OperationFailedException, PermissionDeniedException
      Registers for notification of deleted direction for a recipe. DirectionReceiver.deletedDirections() is invoked when the related direction is deleted or removed from this cookbook.
      Parameters:
      recipeId - the Id of the Recipe to monitor
      Throws:
      NullArgumentException - recipeId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForDeletedDirection

      void registerForDeletedDirection(Id directionId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Registers for notification of a deleted direction. DirectionReceiver.deletedDirections() is invoked when the specified direction is deleted or removed from this cookbook.
      Parameters:
      directionId - the Id of the Direction to monitor
      Throws:
      NotFoundException - a direction was not found identified by the given Id
      NullArgumentException - directionId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.