Package org.onosproject.net.meter
Class DefaultMeterRequest.Builder
- java.lang.Object
-
- org.onosproject.net.meter.DefaultMeterRequest.Builder
-
- All Implemented Interfaces:
MeterRequest.Builder
- Enclosing class:
- DefaultMeterRequest
public static final class DefaultMeterRequest.Builder extends java.lang.Object implements MeterRequest.Builder
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MeterRequest
add()
Requests the addition of a meter.MeterRequest.Builder
burst()
Sets this meter as applicable to burst traffic only.MeterRequest.Builder
forDevice(DeviceId deviceId)
Assigns the target device for this meter.MeterRequest.Builder
fromApp(ApplicationId appId)
Assigns the application that built this meter.MeterRequest
remove()
Requests the removal of a meter.MeterRequest.Builder
withBands(java.util.Collection<Band> bands)
Assigns bands to this meter.MeterRequest.Builder
withContext(MeterContext context)
Assigns an execution context for this meter request.MeterRequest.Builder
withUnit(Meter.Unit unit)
Assigns the @See Unit to use for this meter.
-
-
-
Method Detail
-
forDevice
public MeterRequest.Builder forDevice(DeviceId deviceId)
Description copied from interface:MeterRequest.Builder
Assigns the target device for this meter.- Specified by:
forDevice
in interfaceMeterRequest.Builder
- Parameters:
deviceId
- a device id- Returns:
- this
-
fromApp
public MeterRequest.Builder fromApp(ApplicationId appId)
Description copied from interface:MeterRequest.Builder
Assigns the application that built this meter.- Specified by:
fromApp
in interfaceMeterRequest.Builder
- Parameters:
appId
- an application id- Returns:
- this
-
withUnit
public MeterRequest.Builder withUnit(Meter.Unit unit)
Description copied from interface:MeterRequest.Builder
Assigns the @See Unit to use for this meter. Defaults to kb/s- Specified by:
withUnit
in interfaceMeterRequest.Builder
- Parameters:
unit
- a unit- Returns:
- this
-
burst
public MeterRequest.Builder burst()
Description copied from interface:MeterRequest.Builder
Sets this meter as applicable to burst traffic only. Defaults to false.- Specified by:
burst
in interfaceMeterRequest.Builder
- Returns:
- this
-
withBands
public MeterRequest.Builder withBands(java.util.Collection<Band> bands)
Description copied from interface:MeterRequest.Builder
Assigns bands to this meter. There must be at least one band.- Specified by:
withBands
in interfaceMeterRequest.Builder
- Parameters:
bands
- a collection of bands- Returns:
- this
-
withContext
public MeterRequest.Builder withContext(MeterContext context)
Description copied from interface:MeterRequest.Builder
Assigns an execution context for this meter request.- Specified by:
withContext
in interfaceMeterRequest.Builder
- Parameters:
context
- a meter context- Returns:
- this
-
add
public MeterRequest add()
Description copied from interface:MeterRequest.Builder
Requests the addition of a meter.- Specified by:
add
in interfaceMeterRequest.Builder
- Returns:
- a meter request
-
remove
public MeterRequest remove()
Description copied from interface:MeterRequest.Builder
Requests the removal of a meter.- Specified by:
remove
in interfaceMeterRequest.Builder
- Returns:
- a meter request
-
-