public interface MeterStore extends Store<MeterEvent,MeterStoreDelegate>
| Modifier and Type | Method and Description |
|---|---|
MeterId |
allocateMeterId(DeviceId deviceId)
Allocates the first available MeterId.
|
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.
|
Collection<Meter> |
getAllMeters()
Returns all meters stored in the store.
|
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.
|
CompletableFuture<MeterStoreResult> |
storeMeter(Meter meter)
Adds a meter to the store.
|
MeterStoreResult |
storeMeterFeatures(MeterFeatures meterfeatures)
Adds the meter features to the store.
|
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, unsetDelegateCompletableFuture<MeterStoreResult> storeMeter(Meter meter)
meter - a meterCompletableFuture<MeterStoreResult> deleteMeter(Meter meter)
meter - a meterMeterStoreResult storeMeterFeatures(MeterFeatures meterfeatures)
meterfeatures - the meter featuresMeterStoreResult deleteMeterFeatures(DeviceId deviceId)
deviceId - the device idCompletableFuture<MeterStoreResult> updateMeter(Meter meter)
meter - a new metervoid updateMeterState(Meter meter)
meter - a meterMeter getMeter(MeterKey key)
key - a meter keyCollection<Meter> getAllMeters()
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