Interface MeterNotificationSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session defines methods to receive notifications on new or deleted meters. 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.
This session registers notifications for the Meter itself.
-
Method Summary
Modifier and TypeMethodDescriptionvoidacknowledgeMeterNotification(Id notificationId) Acknowledge a meter notification.booleanTests if this user can register forMeternotifications.Gets theUtilityassociated with this session.Gets theUtilityIdassociated with this session.voidregisterForChangedMeter(Id meterId) Registers for notification of an updated meter.voidRegister for notifications of new meters.voidregisterForDeletedMeter(Id meterId) Registers for notification of a deleted meter.voidRegisters for notification of deleted meters.voidRegister for notifications of new meters.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
-
getUtilityId
Id getUtilityId()Gets theUtilityIdassociated with this session.- Returns:
- the
Utility Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getUtility
Gets theUtilityassociated with this session.- Returns:
- the
Utilityassociated with this session - Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canRegisterForMeterNotifications
boolean canRegisterForMeterNotifications()Tests if this user can register forMeternotifications. 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.
-
useFederatedUtilityView
void useFederatedUtilityView()Federates the view for methods in this session. A federated view will include meters from parent utilities in the utility hierarchy.- Compliance:
mandatory- This method is must be implemented.
-
useIsolatedUtilityView
void useIsolatedUtilityView()Isolates the view for methods in this session. An isolated view restricts notifications for meters to this utility only.- Compliance:
mandatory- This method is must be implemented.
-
registerForNewMeters
Register for notifications of new meters.MeterReceiver.newMeters()is invoked when a newMeteris created.- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForChangedMeters
Register for notifications of new meters.MeterReceiver.changedMeters()is invoked when aMeteris changed.- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForChangedMeter
Registers for notification of an updated meter.MeterReceiver.changedMeters()is invoked when the specified meter in this utility is changed.- Parameters:
meterId- theIdof theMeterto monitor- Throws:
NullArgumentException-meterIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForDeletedMeters
Registers for notification of deleted meters.MeterReceiver.deletedMeters()is invoked when a meter is deleted.- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForDeletedMeter
Registers for notification of a deleted meter.MeterReceiver.deletedMeters()is invoked when the specified meter is deleted or removed from this utility.- Parameters:
meterId- theIdof theMeterto monitor- Throws:
NullArgumentException-meterIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
acknowledgeMeterNotification
void acknowledgeMeterNotification(Id notificationId) throws OperationFailedException, PermissionDeniedException Acknowledge a meter notification.- Parameters:
notificationId- theIdof the notification- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-