Package org.onosproject.net.meter
Interface MeterService
- 
- All Superinterfaces:
- ListenerService<MeterEvent,MeterListener>
 
 public interface MeterService extends ListenerService<MeterEvent,MeterListener> Service for add/updating and removing meters. Meters are are assigned to flow to rate limit them and provide a certain quality of service.
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description MeterIdallocateMeterId(DeviceId deviceId)Allocates a new meter id in the system.voidfreeMeterId(DeviceId deviceId, MeterId meterId)Frees the given meter id.java.util.Collection<Meter>getAllMeters()Fetches all the meters.MetergetMeter(DeviceId deviceId, MeterId id)Fetch the meter by the meter id.java.util.Collection<Meter>getMeters(DeviceId deviceId)Fetches the meters by the device id.default voidpurgeMeters(DeviceId deviceId)Purges all the meters on the specified device.Metersubmit(MeterRequest meter)Adds a meter to the system and performs it installation.voidwithdraw(MeterRequest meter, MeterId meterId)Remove a meter from the system and the dataplane.- 
Methods inherited from interface org.onosproject.event.ListenerServiceaddListener, removeListener
 
- 
 
- 
- 
- 
Method Detail- 
submitMeter submit(MeterRequest meter) Adds a meter to the system and performs it installation.- Parameters:
- meter- a meter
- Returns:
- a meter (with a meter id)
 
 - 
withdrawvoid 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.
 
 - 
getMeterMeter getMeter(DeviceId deviceId, MeterId id) Fetch the meter by the meter id.- Parameters:
- deviceId- a device id
- id- a meter id
- Returns:
- a meter
 
 - 
getAllMetersjava.util.Collection<Meter> getAllMeters() Fetches all the meters.- Returns:
- a collection of meters
 
 - 
getMetersjava.util.Collection<Meter> getMeters(DeviceId deviceId) Fetches the meters by the device id.- Parameters:
- deviceId- a device id
- Returns:
- a collection of meters
 
 - 
allocateMeterIdMeterId 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
 
 - 
freeMeterIdvoid freeMeterId(DeviceId deviceId, MeterId meterId) Frees the given meter id.- Parameters:
- deviceId- the device id
- meterId- the id to be freed
 
 - 
purgeMetersdefault void purgeMeters(DeviceId deviceId) Purges all the meters on the specified device.- Parameters:
- deviceId- device identifier
 
 
- 
 
-