Interface RuleNotificationSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session defines methods to receive notifications on adds/changes
to Rules. 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.
Like all OsidSessions, RuleNotificationSessions are
dedicated to single processing threads and a single authenticated user.
-
Method Summary
Modifier and TypeMethodDescriptionvoidacknowledgeRuleNotification(Id notificationId) Acknowledge a rule notification.booleanTests if this user can register forRulenotifications.Gets theEngineassociated with this session.Gets theEngineIdassociated with this session.voidregisterForChangedRule(Id ruleId) Registers for notification of an updated rule.voidRegisters for notification of updated rules.voidregisterForDeletedRule(Id ruleId) Registers for notification of a deleted rule.voidRegisters for notification of deleted rules.voidRegister for notifications of new rules.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, getFormatTypes, getLocales, isAuthenticated, startTransaction, supportsTransactions
-
Method Details
-
getEngineId
Id getEngineId()Gets theEngineIdassociated with this session.- Returns:
- the
Engine Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getEngine
Gets theEngineassociated with this session.- Returns:
- the
Engineassociated with this session - Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canRegisterForRuleNotifications
boolean canRegisterForRuleNotifications()Tests if this user can register forRulenotifications. 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.
-
useFederatedEngineView
void useFederatedEngineView()Federates the view for methods in this session. A federated view will include notifications for rules in engines which are children of this engine in the engine hierarchy.- Compliance:
mandatory- This method must be implemented.
-
useIsolatedEngineView
void useIsolatedEngineView()Isolates the view for methods in this session. An isolated view restricts notifications to this engine only.- Compliance:
mandatory- This method must be implemented.
-
reliableRuleNotifications
void reliableRuleNotifications()Reliable notifications are desired. In reliable mode, notifications are to be acknowledged usingacknowledgeRuleNotification().- Compliance:
mandatory- This method must be implemented.
-
unreliableRuleNotifications
void unreliableRuleNotifications()Unreliable notifications are desired. In unreliable mode, notifications do not need to be acknowledged.- Compliance:
mandatory- This method must be implemented.
-
acknowledgeRuleNotification
void acknowledgeRuleNotification(Id notificationId) throws OperationFailedException, PermissionDeniedException Acknowledge a rule notification.- Parameters:
notificationId- theIdof the notification- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForNewRules
Register for notifications of new rules.RuleReceiver.newRules()is invoked when a newRuleis created.- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForChangedRules
Registers for notification of updated rules.RuleReceiver.changedRules()is invoked when a rule is changed.- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForChangedRule
Registers for notification of an updated rule.RuleReceiver.changedRules()is invoked when the specified rule is changed.- Parameters:
ruleId- theIdof theRuleto monitor- Throws:
NullArgumentException-ruleIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForDeletedRules
Registers for notification of deleted rules.RuleReceiver.deletedRules()is invoked when a rule is removed from this engine.- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForDeletedRule
Registers for notification of a deleted rule.RuleReceiver.deletedRules()is invoked when the specified rule is removed from this engine.- Parameters:
ruleId- theIdof theRuleto monitor- Throws:
NullArgumentException-ruleIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-