Interface MeterService

    • Method Detail

      • submit

        Meter submit​(MeterRequest meter)
        Adds a meter to the system and performs it installation.
        Parameters:
        meter - a meter
        Returns:
        a meter (with a meter id)
      • withdraw

        void withdraw​(MeterRequest meter,
                      MeterId meterId)
        Remove a meter from the system and the dataplane.
        Parameters:
        meter - a meter to remove
        meterId - the meter id of the meter to remove.
      • getMeter

        Meter getMeter​(DeviceId deviceId,
                       MeterId id)
        Fetch the meter by the meter id.
        Parameters:
        deviceId - a device id
        id - a meter id
        Returns:
        a meter
      • getAllMeters

        Collection<Meter> getAllMeters()
        Fetches all the meters.
        Returns:
        a collection of meters
      • getMeters

        Collection<Meter> getMeters​(DeviceId deviceId)
        Fetches the meters by the device id.
        Parameters:
        deviceId - a device id
        Returns:
        a collection of meters
      • allocateMeterId

        MeterId allocateMeterId​(DeviceId deviceId)
        Allocates a new meter id in the system.
        Parameters:
        deviceId - the device id
        Returns:
        the allocated meter id, null if there is an internal error or there are no meter ids available
      • freeMeterId

        void freeMeterId​(DeviceId deviceId,
                         MeterId meterId)
        Frees the given meter id.
        Parameters:
        deviceId - the device id
        meterId - the id to be freed
      • purgeMeters

        default void purgeMeters​(DeviceId deviceId)
        Purges all the meters on the specified device.
        Parameters:
        deviceId - device identifier