Interface FunctionNotificationSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface FunctionNotificationSession extends OsidSession

This session defines methods to receive asynchronous notifications on adds/changes to Function objects. 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 FunctionLookupSession .

  • Method Details

    • getVaultId

      Id getVaultId()
      Gets the Vault Id associated with this session.
      Returns:
      the Vault Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getVault

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

      boolean canRegisterForFunctionNotifications()
      Tests if this user can register for Function 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.
    • useFederatedVaultView

      void useFederatedVaultView()
      Federates the view for methods in this session. A federated view will include functions in vaults which are children of this vault in the vault hierarchy.
      Compliance:
      mandatory - This method is must be implemented.
    • useIsolatedVaultView

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

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

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

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

      void registerForNewFunctions() throws OperationFailedException, PermissionDeniedException
      Register for notifications of new functions. FunctionReceiver.newFunctions() is invoked when a new Function is created.
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForChangedFunctions

      void registerForChangedFunctions() throws OperationFailedException, PermissionDeniedException
      Registers for notification of updated functions. FunctionReceiver.changedFunctions() is invoked when a function is changed.
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForChangedFunction

      void registerForChangedFunction(Id functionId) throws OperationFailedException, PermissionDeniedException
      Registers for notification of an updated function. FunctionReceiver.changedFunctions() is invoked when the specified function is changed.
      Parameters:
      functionId - the Id of the Function to monitor
      Throws:
      NullArgumentException - functionId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForDeletedFunctions

      void registerForDeletedFunctions() throws OperationFailedException, PermissionDeniedException
      Registers for notification of deleted functions. FunctionReceiver.deletedFunctions() is invoked when a function is removed from this vault.
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForDeletedFunction

      void registerForDeletedFunction(Id functionId) throws OperationFailedException, PermissionDeniedException
      Registers for notification of a deleted function. FunctionReceiver.changedFunctions() is invoked when the specified function is removed from this vault.
      Parameters:
      functionId - the Id of the Function to monitor
      Throws:
      NullArgumentException - functionId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.