Package org.onosproject.net.meter
Interface MeterStore
- 
- All Superinterfaces:
- Store<MeterEvent,MeterStoreDelegate>
 
 public interface MeterStore extends Store<MeterEvent,MeterStoreDelegate> Entity that stores and distributed meter objects.
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description MeterIdallocateMeterId(DeviceId deviceId)Allocates the first available MeterId.java.util.concurrent.CompletableFuture<MeterStoreResult>deleteMeter(Meter meter)Deletes a meter from the store.MeterStoreResultdeleteMeterFeatures(DeviceId deviceId)Deletes the meter features from the store.voiddeleteMeterNow(Meter m)Delete this meter immediately.voidfailedMeter(MeterOperation op, MeterFailReason reason)Update the store by deleting the failed meter.voidfreeMeterId(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.longgetMaxMeters(MeterFeaturesKey key)Retrieve maximum meters available for the device.MetergetMeter(MeterKey key)Obtains a meter matching the given meter key.voidpurgeMeter(DeviceId deviceId)Removes all meters of given device from store.java.util.concurrent.CompletableFuture<MeterStoreResult>storeMeter(Meter meter)Adds a meter to the store.MeterStoreResultstoreMeterFeatures(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.voidupdateMeterState(Meter meter)Updates a given meter's state with the provided state.- 
Methods inherited from interface org.onosproject.store.StorehasDelegate, setDelegate, unsetDelegate
 
- 
 
- 
- 
- 
Method Detail- 
storeMeterjava.util.concurrent.CompletableFuture<MeterStoreResult> storeMeter(Meter meter) Adds a meter to the store.- Parameters:
- meter- a meter
- Returns:
- a future indicating the result of the store operation
 
 - 
deleteMeterjava.util.concurrent.CompletableFuture<MeterStoreResult> deleteMeter(Meter meter) Deletes a meter from the store.- Parameters:
- meter- a meter
- Returns:
- a future indicating the result of the store operation
 
 - 
storeMeterFeaturesMeterStoreResult storeMeterFeatures(MeterFeatures meterfeatures) Adds the meter features to the store.- Parameters:
- meterfeatures- the meter features
- Returns:
- the result of the store operation
 
 - 
deleteMeterFeaturesMeterStoreResult deleteMeterFeatures(DeviceId deviceId) Deletes the meter features from the store.- Parameters:
- deviceId- the device id
- Returns:
- a future indicating the result of the store operation
 
 - 
updateMeterjava.util.concurrent.CompletableFuture<MeterStoreResult> updateMeter(Meter meter) Updates a meter whose meter id is the same as the passed meter.- Parameters:
- meter- a new meter
- Returns:
- a future indicating the result of the store operation
 
 - 
updateMeterStatevoid updateMeterState(Meter meter) Updates a given meter's state with the provided state.- Parameters:
- meter- a meter
 
 - 
getMeterMeter getMeter(MeterKey key) Obtains a meter matching the given meter key.- Parameters:
- key- a meter key
- Returns:
- a meter
 
 - 
getAllMetersjava.util.Collection<Meter> getAllMeters() Returns all meters stored in the store.- Returns:
- a collection of meters
 
 - 
getAllMetersjava.util.Collection<Meter> getAllMeters(DeviceId deviceId) Returns all meters stored in the store for a precise device.- Parameters:
- deviceId- the device to get the meter list from
- Returns:
- a collection of meters
 
 - 
failedMetervoid failedMeter(MeterOperation op, MeterFailReason reason) Update the store by deleting the failed meter. Notifies the delegate that the meter failed to allow it to nofity the app.- Parameters:
- op- a failed meter operation
- reason- a failure reason
 
 - 
deleteMeterNowvoid deleteMeterNow(Meter m) Delete this meter immediately.- Parameters:
- m- a meter
 
 - 
getMaxMeterslong getMaxMeters(MeterFeaturesKey key) Retrieve maximum meters available for the device.- Parameters:
- key- the meter features key
- Returns:
- the maximum number of meters supported by the device
 
 - 
allocateMeterIdMeterId allocateMeterId(DeviceId deviceId) Allocates the first available MeterId.- Parameters:
- deviceId- the device id
- Returns:
- the meter Id or null if it was not possible to allocate a meter id
 
 - 
freeMeterIdvoid freeMeterId(DeviceId deviceId, MeterId meterId) Frees the given meter id.- Parameters:
- deviceId- the device id
- meterId- the id to be freed
 
 - 
purgeMetervoid purgeMeter(DeviceId deviceId) Removes all meters of given device from store.- Parameters:
- deviceId- the device id
 
 
- 
 
-