Interface MeterNotificationSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface MeterNotificationSession extends 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 Details

    • getUtilityId

      Id getUtilityId()
      Gets the Utility Id associated with this session.
      Returns:
      the Utility Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getUtility

      Gets the Utility associated with this session.
      Returns:
      the Utility associated with this session
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canRegisterForMeterNotifications

      boolean canRegisterForMeterNotifications()
      Tests if this user can register for Meter notifications. 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 a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer notification operations.
      Returns:
      false if notification methods are not authorized, true otherwise
      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

      void registerForNewMeters() throws OperationFailedException, PermissionDeniedException
      Register for notifications of new meters. MeterReceiver.newMeters() is invoked when a new Meter is created.
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForChangedMeters

      void registerForChangedMeters() throws OperationFailedException, PermissionDeniedException
      Register for notifications of new meters. MeterReceiver.changedMeters() is invoked when a Meter is changed.
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForChangedMeter

      void registerForChangedMeter(Id meterId) throws OperationFailedException, PermissionDeniedException
      Registers for notification of an updated meter. MeterReceiver.changedMeters() is invoked when the specified meter in this utility is changed.
      Parameters:
      meterId - the Id of the Meter to monitor
      Throws:
      NullArgumentException - meterId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForDeletedMeters

      void registerForDeletedMeters() throws OperationFailedException, PermissionDeniedException
      Registers for notification of deleted meters. MeterReceiver.deletedMeters() is invoked when a meter is deleted.
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForDeletedMeter

      void registerForDeletedMeter(Id meterId) throws OperationFailedException, PermissionDeniedException
      Registers for notification of a deleted meter. MeterReceiver.deletedMeters() is invoked when the specified meter is deleted or removed from this utility.
      Parameters:
      meterId - the Id of the Meter to monitor
      Throws:
      NullArgumentException - meterId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • acknowledgeMeterNotification

      void acknowledgeMeterNotification(Id notificationId) throws OperationFailedException, PermissionDeniedException
      Acknowledge a meter notification.
      Parameters:
      notificationId - the Id of the notification
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.