Interface AssetNotificationSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface AssetNotificationSession extends OsidSession

This session defines methods to receive notifications on adds/changes to Asset objects in this Repository . This also includes existing assets that may appear or disappear due to changes in the Repository hierarchy, 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 AssetLookupSession .

  • Method Details

    • getRepositoryId

      Id getRepositoryId()
      Gets the Repository Id associated with this session.
      Returns:
      the Repository Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getRepository

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

      boolean canRegisterForAssetNotifications()
      Tests if this user can register for Asset 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.
    • useFederatedRepositoryView

      void useFederatedRepositoryView()
      Federates the view for methods in this session. A federated view will include assets in repositories which are children of this repository in the repository hierarchy.
      Compliance:
      mandatory - This method is must be implemented.
    • useIsolatedRepositoryView

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

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

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

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

      void registerForNewAssets() throws OperationFailedException, PermissionDeniedException
      Register for notifications of new assets. AssetReceiver.newAssets() is invoked when a new Asset appears in this repository.
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForNewAssetsByGenusType

      void registerForNewAssetsByGenusType(Type assetGenusType) throws OperationFailedException, PermissionDeniedException
      Registers for notification of new assets of the given asset genus type. AssetReceiver.newAssets() is invoked when an asset is appears in this repository.
      Parameters:
      assetGenusType - the genus type of the Asset to monitor
      Throws:
      NullArgumentException - assetGenusType is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForChangedAssets

      void registerForChangedAssets() throws OperationFailedException, PermissionDeniedException
      Registers for notification of updated assets. AssetReceiver.changedAssets() is invoked when an asset in this repository is changed.
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForChangedAssetsByGenusType

      void registerForChangedAssetsByGenusType(Type assetGenusType) throws OperationFailedException, PermissionDeniedException
      Registers for notification of updated assets of the given asset genus type. AssetReceiver.changedAssets() is invoked when an asset in this repository is changed.
      Parameters:
      assetGenusType - the genus type of the Asset to monitor
      Throws:
      NullArgumentException - assetGenusType is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForChangedAsset

      void registerForChangedAsset(Id assetId) throws OperationFailedException, PermissionDeniedException
      Registers for notification of an updated asset. AssetReceiver.changedAssets() is invoked when the specified asset in this repository is changed.
      Parameters:
      assetId - the Id of the Asset to monitor
      Throws:
      NullArgumentException - assetId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForDeletedAssets

      void registerForDeletedAssets() throws OperationFailedException, PermissionDeniedException
      Registers for notification of deleted assets. AssetReceiver.deletedAssets() is invoked when an asset is deleted or removed from this repository.
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForDeletedAssetsByGenusType

      void registerForDeletedAssetsByGenusType(Type assetGenusType) throws OperationFailedException, PermissionDeniedException
      Registers for notification of deleted assets of the given asset genus type. AssetReceiver.deletedAssets() is invoked when an asset is deleted or removed from this repository.
      Parameters:
      assetGenusType - the genus type of the Asset to monitor
      Throws:
      NullArgumentException - assetGenusType is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForDeletedAsset

      void registerForDeletedAsset(Id assetId) throws OperationFailedException, PermissionDeniedException
      Registers for notification of a deleted asset. AssetReceiver.deletedAssets() is invoked when the specified asset is deleted or removed from this repository.
      Parameters:
      assetId - the Id of the Asset to monitor
      Throws:
      NullArgumentException - assetId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.