Interface UtilityNotificationSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session defines methods to receive notifications on adds/changes
to Utility 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.
Notifications are triggered with changes to the Utility object
itself. Adding and removing entries result in notifications available from
the notification session for meters.
-
Method Summary
Modifier and TypeMethodDescriptionvoidacknowledgeUtilityNotification(Id notificationId) Acknowledge a utility notification.booleanTests if this user can register forUtilitynotifications.voidRegisters for notification of updated utilities.voidregisterForChangedUtility(Id utilityId) Registers for notification of an updated utility.voidRegisters for notification of an updated utility hierarchy structure.voidregisterForChangedUtilityHierarchyForAncestors(Id utilityId) Registers for notification of an updated utility hierarchy structure.voidRegisters for notification of an updated utility hierarchy structure.voidRegisters for notification of deleted utilities.voidregisterForDeletedUtility(Id utilityId) Registers for notification of a deleted utility.voidregisterForDeletedUtilityAncestors(Id utilityId) Registers for notification of an updated hierarchy structure that removes an ancestor of the specified utility.voidregisterForDeletedUtilityDescendants(Id utilityId) Registers for notification of an updated hierarchy structure that removes a descendant of the specified utility.voidRegister for notifications of new utilities.voidregisterForNewUtilityAncestors(Id utilityId) Registers for notification of an updated hierarchy structure that introduces a new ancestor of the specified utility.voidregisterForNewUtilityDescendants(Id utilityId) Registers for notification of an updated hierarchy structure that introduces a new descendant of the specified utility.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
-
canRegisterForUtilityNotifications
boolean canRegisterForUtilityNotifications()Tests if this user can register forUtilitynotifications. 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.
-
registerForNewUtilities
Register for notifications of new utilities.UtilityReceiver.newUtilities()is invoked when a newUtilityis created.- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForNewUtilityAncestors
void registerForNewUtilityAncestors(Id utilityId) throws OperationFailedException, PermissionDeniedException Registers for notification of an updated hierarchy structure that introduces a new ancestor of the specified utility.UtilityReceiver.newAncestorUtility()is invoked when the specified utility node gets a new ancestor.- Parameters:
utilityId- theIdof theUtilitynode to monitor- Throws:
NullArgumentException-utilityIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForNewUtilityDescendants
void registerForNewUtilityDescendants(Id utilityId) throws OperationFailedException, PermissionDeniedException Registers for notification of an updated hierarchy structure that introduces a new descendant of the specified utility.UtilityReceiver.newDescendantUtility()is invoked when the specified utility node gets a new descendant.- Parameters:
utilityId- theIdof theUtilitynode to monitor- Throws:
NullArgumentException-utilityIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForChangedUtilities
Registers for notification of updated utilities.UtilityReceiver.changedUtilities()is invoked when a utility is changed.- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForChangedUtility
void registerForChangedUtility(Id utilityId) throws OperationFailedException, PermissionDeniedException Registers for notification of an updated utility.UtilityReceiver.changedUtilities()is invoked when the specified utility is changed.- Parameters:
utilityId- theIdof theUtilityto monitor- Throws:
NullArgumentException-utilityIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForDeletedUtilities
Registers for notification of deleted utilities.UtilityReceiver.deletedUtilities()is invoked when a utility is deleted.- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForDeletedUtility
void registerForDeletedUtility(Id utilityId) throws OperationFailedException, PermissionDeniedException Registers for notification of a deleted utility.UtilityReceiver.deletedUtilities()is invoked when the specified utility is deleted.- Parameters:
utilityId- theIdof theUtilityto monitor- Throws:
NullArgumentException-utilityIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForDeletedUtilityAncestors
void registerForDeletedUtilityAncestors(Id utilityId) throws OperationFailedException, PermissionDeniedException Registers for notification of an updated hierarchy structure that removes an ancestor of the specified utility.UtilityReceiver.deletedAncestor()is invoked when the specified utility node loses an ancestor.- Parameters:
utilityId- theIdof theUtilitynode to monitor- Throws:
NullArgumentException-utilityIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForDeletedUtilityDescendants
void registerForDeletedUtilityDescendants(Id utilityId) throws OperationFailedException, PermissionDeniedException Registers for notification of an updated hierarchy structure that removes a descendant of the specified utility.UtilityReceiver.deletedDescendant()is invoked when the specified utility node loses a descendant.- Parameters:
utilityId- theIdof theUtilitynode to monitor- Throws:
NullArgumentException-utilityIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
acknowledgeUtilityNotification
void acknowledgeUtilityNotification(Id notificationId) throws OperationFailedException, PermissionDeniedException Acknowledge a utility notification.- Parameters:
notificationId- theIdof the notification- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForChangedUtilityHierarchy
void registerForChangedUtilityHierarchy() throws OperationFailedException, PermissionDeniedExceptionRegisters for notification of an updated utility hierarchy structure.UtilityReceiver.changedChildOfUtilities()is invoked when a node experiences a change in its children.- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForChangedUtilityHierarchyForAncestors
void registerForChangedUtilityHierarchyForAncestors(Id utilityId) throws OperationFailedException, PermissionDeniedException Registers for notification of an updated utility hierarchy structure.UtilityReceiver.changedChildOfUtilities()is invoked when a node experiences a change in its children.- Parameters:
utilityId- theIdof theUtilitynode to monitor- Throws:
NullArgumentException-utilityIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForChangedUtilityHierarchyForDescendants
void registerForChangedUtilityHierarchyForDescendants(Id utilityId) throws OperationFailedException, PermissionDeniedException Registers for notification of an updated utility hierarchy structure.UtilityReceiver.changedChildOfUtilities()is invoked when a node experiences a change in its children.- Parameters:
utilityId- theIdof theUtilitynode to monitor- Throws:
NullArgumentException-utilityIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-