Interface ValueNotificationSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session defines methods to receive notifications on changes to
Values . A particular value in a set may have been added or
deleted, but all changes appear as a change to a parameter. Once a change
notification is received, the new value list can be obtained through the
ValueLookupSession . This session is intended for adapters and
providers needing to synchronize their state with this service without the
use of polling. Notifications are cancelled when this session is closed.
Two views are defined;
- federated: parameters defined in configurations that are a parent of this configuration in the configuration hierarchy are included for notifications
- isolated: notifications are restricted to parameters are defined to within this configuration
The methods federateValuerView() and
isolateValueView() behave as a radio group and one should be selected
before invoking any lookup methods.
-
Method Summary
Modifier and TypeMethodDescriptionvoidacknowledgeValueNotification(Id notificationId) Acknowledge a value notification.booleanTests if this user can register forValuenotifications.Gets theConfigurationassociated with this session.Gets theConfigurationIdassociated with this session.voidregisterForChangedValue(Id valueId) Assigns a callback for notifications of an update to a value in this configuration.voidAssigns a callback for notification of updated parameter values in this configuration.voidregisterForChangedValuesForParameter(Id parameterId) Assigns a callback for notifications of changed values for the given parameter.voidregisterForDeletedValue(Id valueId) Assigns a callback for notifications of an update to a value in this configuration.voidAssigns a callback for notification of deleted values in this configuration.voidregisterForDeletedValuesForParameter(Id parameterId) Assigns a callback for notifications of changed values for the given parameter.voidAssigns a callback for notifications of new values.voidregisterForNewValuesForParameter(Id parameterId) Assigns a callback for notifications of new values for the given parameter.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
-
getConfigurationId
Id getConfigurationId()Gets theConfigurationIdassociated with this session.- Returns:
- the
ConfigurationIdassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getConfiguration
Gets theConfigurationassociated with this session.- Returns:
- the
Configurationassociated with this session - Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canRegisterForValueNotifications
boolean canRegisterForValueNotifications()Tests if this user can register forValuenotifications. 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.
-
useFederatedConfigurationView
void useFederatedConfigurationView()Federates the view for methods in this session. A federated view will include parameters in configurations of which this configuration is a child in the configuration hierarchy.- Compliance:
mandatory- This method is must be implemented.
-
useIsolatedConfigurationView
void useIsolatedConfigurationView()Isolates the view for methods in this session. An isolated view restricts notifications for parameter values to this configuration only.- Compliance:
mandatory- This method is must be implemented.
-
reliableValueNotifications
void reliableValueNotifications()Reliable notifications are desired. In reliable mode, notifications are to be acknowledged usingacknowledgeValueNotification().- Compliance:
mandatory- This method is must be implemented.
-
unreliableValueNotifications
void unreliableValueNotifications()Unreliable notifications are desired. In unreliable mode, notifications do not need to be acknowledged.- Compliance:
mandatory- This method is must be implemented.
-
acknowledgeValueNotification
void acknowledgeValueNotification(Id notificationId) throws OperationFailedException, PermissionDeniedException Acknowledge a value notification.- Parameters:
notificationId- theIdof the notification- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForNewValues
Assigns a callback for notifications of new values.ValueReceiver.newValues()is invoked when a newValueis added to this configuration.- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForNewValuesForParameter
void registerForNewValuesForParameter(Id parameterId) throws OperationFailedException, PermissionDeniedException Assigns a callback for notifications of new values for the given parameter.ValueReceiver.newValues()is invoked when a newValueis added to this configuration.- Parameters:
parameterId- theIdof theParameterto monitor- Throws:
NullArgumentException-parameterIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForChangedValues
Assigns a callback for notification of updated parameter values in this configuration.ValueReceiver.changedValues()is invoked when aValueis changed in this configuration.- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForChangedValuesForParameter
void registerForChangedValuesForParameter(Id parameterId) throws OperationFailedException, PermissionDeniedException Assigns a callback for notifications of changed values for the given parameter.ValueReceiver.changedValues()is invoked when aValueis updated to this configuration.- Parameters:
parameterId- theIdof theParameterto monitor- Throws:
NullArgumentException-parameterIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForChangedValue
Assigns a callback for notifications of an update to a value in this configuration.ValueReceiver.changedValues()is invoked when the specifiedValueis updated in this configuration.- Parameters:
valueId- theIdof theValueto monitor- Throws:
NullArgumentException-valueIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForDeletedValues
Assigns a callback for notification of deleted values in this configuration.ValueReceiver.changedValues()is invoked when aValueis removed from this configuration.- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForDeletedValuesForParameter
void registerForDeletedValuesForParameter(Id parameterId) throws OperationFailedException, PermissionDeniedException Assigns a callback for notifications of changed values for the given parameter.ValueReceiver.changedValues()is invoked when aValueis removed from this configuration.- Parameters:
parameterId- theIdof theParameterto monitor- Throws:
NullArgumentException-parameterIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForDeletedValue
Assigns a callback for notifications of an update to a value in this configuration.ValueReceiver.changedValues()is invoked when the specifiedValueis removed from this configuration.- Parameters:
valueId- theIdof theValueto monitor- Throws:
NullArgumentException-valueIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-