public interface MeterStore extends Store<MeterEvent,MeterStoreDelegate>
Modifier and Type | Method and Description |
---|---|
MeterId |
allocateMeterId(DeviceId deviceId)
Allocates the first available MeterId.
|
java.util.concurrent.CompletableFuture<MeterStoreResult> |
deleteMeter(Meter meter)
Deletes a meter from the store.
|
MeterStoreResult |
deleteMeterFeatures(DeviceId deviceId)
Deletes the meter features from the store.
|
void |
deleteMeterNow(Meter m)
Delete this meter immediately.
|
void |
failedMeter(MeterOperation op,
MeterFailReason reason)
Update the store by deleting the failed meter.
|
void |
freeMeterId(DeviceId deviceId,
MeterId meterId)
Frees the given meter id.
|
java.util.Collection<Meter> |
getAllMeters()
Returns all meters stored in the store.
|
java.util.Collection<Meter> |
getAllMeters(DeviceId deviceId)
Returns all meters stored in the store for a
precise device.
|
long |
getMaxMeters(MeterFeaturesKey key)
Retrieve maximum meters available for the device.
|
Meter |
getMeter(MeterKey key)
Obtains a meter matching the given meter key.
|
java.util.concurrent.CompletableFuture<MeterStoreResult> |
storeMeter(Meter meter)
Adds a meter to the store.
|
MeterStoreResult |
storeMeterFeatures(MeterFeatures meterfeatures)
Adds the meter features to the store.
|
java.util.concurrent.CompletableFuture<MeterStoreResult> |
updateMeter(Meter meter)
Updates a meter whose meter id is the same as the passed meter.
|
void |
updateMeterState(Meter meter)
Updates a given meter's state with the provided state.
|
hasDelegate, setDelegate, unsetDelegate
java.util.concurrent.CompletableFuture<MeterStoreResult> storeMeter(Meter meter)
meter
- a meterjava.util.concurrent.CompletableFuture<MeterStoreResult> deleteMeter(Meter meter)
meter
- a meterMeterStoreResult storeMeterFeatures(MeterFeatures meterfeatures)
meterfeatures
- the meter featuresMeterStoreResult deleteMeterFeatures(DeviceId deviceId)
deviceId
- the device idjava.util.concurrent.CompletableFuture<MeterStoreResult> updateMeter(Meter meter)
meter
- a new metervoid updateMeterState(Meter meter)
meter
- a meterMeter getMeter(MeterKey key)
key
- a meter keyjava.util.Collection<Meter> getAllMeters()
java.util.Collection<Meter> getAllMeters(DeviceId deviceId)
deviceId
- the device to get the meter list fromvoid failedMeter(MeterOperation op, MeterFailReason reason)
op
- a failed meter operationreason
- a failure reasonvoid deleteMeterNow(Meter m)
m
- a meterlong getMaxMeters(MeterFeaturesKey key)
key
- the meter features keyMeterId allocateMeterId(DeviceId deviceId)
deviceId
- the device id