Konstantinos Kanonakis
Committed by Gerrit Code Review

Fixed issue in MeterManager.java

- Added check in pushMeterMetrics method to delete Meter only when it is in the PENDING_REMOVE state
- Minor change: Corrected description in MeterId.java to indicate that MeterIds are unique only within a device

Change-Id: I40e8a0cfaa93884b026e899e9c879e22133ba63b
......@@ -19,7 +19,7 @@ import static com.google.common.base.Preconditions.checkArgument;
/**
* A representation of a meter id.
* Uniquely identifies a meter system wide.
* Uniquely identifies a meter in the scope of a single device.
*/
public final class MeterId {
......
......@@ -222,7 +222,7 @@ public class MeterManager extends AbstractListenerProviderRegistry<MeterEvent, M
provider().performMeterOperation(m.deviceId(),
new MeterOperation(m,
MeterOperation.Type.ADD));
} else {
} else if ((m.state() == MeterState.PENDING_REMOVE)) {
store.deleteMeterNow(m);
}
});
......