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 Summary
All Methods Instance Methods Abstract 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.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.ListenerService
addListener, removeListener
-
-
-
-
Method Detail
-
submit
Meter submit(MeterRequest meter)
Adds a meter to the system and performs it installation.- Parameters:
meter- a meter- Returns:
- a meter (with a meter id)
-
withdraw
void withdraw(MeterRequest meter, MeterId meterId)
Remove a meter from the system and the dataplane.- Parameters:
meter- a meter to removemeterId- the meter id of the meter to remove.
-
getMeter
Meter getMeter(DeviceId deviceId, MeterId id)
Fetch the meter by the meter id.- Parameters:
deviceId- a device idid- a meter id- Returns:
- a meter
-
getAllMeters
java.util.Collection<Meter> getAllMeters()
Fetches all the meters.- Returns:
- a collection of meters
-
getMeters
java.util.Collection<Meter> getMeters(DeviceId deviceId)
Fetches the meters by the device id.- Parameters:
deviceId- a device id- Returns:
- a collection of meters
-
allocateMeterId
MeterId 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
-
-