Interface AssetNotificationSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, 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 Summary
Modifier and TypeMethodDescriptionvoidacknowledgeAssetNotification(Id notificationId) Acknowledge an asset notification.booleanTests if this user can register forAssetnotifications.Gets theRepositoryassociated with this session.Gets theRepositoryIdassociated with this session.voidregisterForChangedAsset(Id assetId) Registers for notification of an updated asset.voidRegisters for notification of updated assets.voidregisterForChangedAssetsByGenusType(Type assetGenusType) Registers for notification of updated assets of the given asset genus type.voidregisterForDeletedAsset(Id assetId) Registers for notification of a deleted asset.voidRegisters for notification of deleted assets.voidregisterForDeletedAssetsByGenusType(Type assetGenusType) Registers for notification of deleted assets of the given asset genus type.voidRegister for notifications of new assets.voidregisterForNewAssetsByGenusType(Type assetGenusType) Registers for notification of new assets of the given asset genus type.voidReliable notifications are desired.voidUnreliable notifications are desired.voidFederates the view for methods in this session.voidIsolates the view for methods in this session.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
Method Details
-
getRepositoryId
Id getRepositoryId()Gets theRepositoryIdassociated with this session.- Returns:
- the
Repository Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getRepository
Gets theRepositoryassociated with this session.- Returns:
- the
Repositoryassociated with this session - Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canRegisterForAssetNotifications
boolean canRegisterForAssetNotifications()Tests if this user can register forAssetnotifications. 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 aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer notification operations.- Returns:
falseif notification methods are not authorized,trueotherwise- 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 usingacknowledgeAssetNotification().- 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- theIdof the notification- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForNewAssets
Register for notifications of new assets.AssetReceiver.newAssets()is invoked when a newAssetappears in this repository.- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- 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 theAssetto monitor- Throws:
NullArgumentException-assetGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForChangedAssets
Registers for notification of updated assets.AssetReceiver.changedAssets()is invoked when an asset in this repository is changed.- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- 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 theAssetto monitor- Throws:
NullArgumentException-assetGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForChangedAsset
Registers for notification of an updated asset.AssetReceiver.changedAssets()is invoked when the specified asset in this repository is changed.- Parameters:
assetId- theIdof theAssetto monitor- Throws:
NullArgumentException-assetIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForDeletedAssets
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 requestPermissionDeniedException- 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 theAssetto monitor- Throws:
NullArgumentException-assetGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForDeletedAsset
Registers for notification of a deleted asset.AssetReceiver.deletedAssets()is invoked when the specified asset is deleted or removed from this repository.- Parameters:
assetId- theIdof theAssetto monitor- Throws:
NullArgumentException-assetIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-