Class DefaultPolicer.Builder
- java.lang.Object
-
- org.onosproject.net.behaviour.trafficcontrol.DefaultPolicer.Builder
-
- All Implemented Interfaces:
Policer.Builder
- Enclosing class:
- DefaultPolicer
public static final class DefaultPolicer.Builder extends Object implements Policer.Builder
Implementation of the policer builder interface.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DefaultPolicerbuild()Builds the policer based on the specified parameters when possible.Policer.BuildercolorAware(boolean isColorAware)Sets this policer to be color aware.Policer.BuilderforDeviceId(DeviceId dId)Assigns the device for this policer.Policer.BuilderfromApp(ApplicationId appId)Assigns the application that built this policer.Policer.BuilderwithDescription(String d)Assigns description for this policer.Policer.BuilderwithId(PolicerId id)Assigns the id to this policer.Policer.BuilderwithPolicingResource(PolicingResource policingResource)Assigns policer id and device id for this policer.Policer.BuilderwithTokenBuckets(Collection<TokenBucket> tB)Assigns token buckets for this policer.Policer.BuilderwithUnit(Policer.Unit u)Assigns the unit to use for this policer.
-
-
-
Method Detail
-
forDeviceId
public Policer.Builder forDeviceId(DeviceId dId)
Description copied from interface:Policer.BuilderAssigns the device for this policer.Note: mandatory setter for this builder
- Specified by:
forDeviceIdin interfacePolicer.Builder- Parameters:
dId- a device id- Returns:
- this
-
fromApp
public Policer.Builder fromApp(ApplicationId appId)
Description copied from interface:Policer.BuilderAssigns the application that built this policer.Note: mandatory setter for this builder
- Specified by:
fromAppin interfacePolicer.Builder- Parameters:
appId- an application id- Returns:
- this
-
withId
public Policer.Builder withId(PolicerId id)
Description copied from interface:Policer.BuilderAssigns the id to this policer.Note: mandatory setter for this builder
- Specified by:
withIdin interfacePolicer.Builder- Parameters:
id- an identifier- Returns:
- this
-
colorAware
public Policer.Builder colorAware(boolean isColorAware)
Description copied from interface:Policer.BuilderSets this policer to be color aware. Defaults to false.- Specified by:
colorAwarein interfacePolicer.Builder- Parameters:
isColorAware- if it is color aware or not- Returns:
- this
-
withUnit
public Policer.Builder withUnit(Policer.Unit u)
Description copied from interface:Policer.BuilderAssigns the unit to use for this policer. Defaults to MB/s.- Specified by:
withUnitin interfacePolicer.Builder- Parameters:
u- a unit- Returns:
- this
-
withPolicingResource
public Policer.Builder withPolicingResource(PolicingResource policingResource)
Description copied from interface:Policer.BuilderAssigns policer id and device id for this policer.- Specified by:
withPolicingResourcein interfacePolicer.Builder- Parameters:
policingResource- the policing resource- Returns:
- this
-
withTokenBuckets
public Policer.Builder withTokenBuckets(Collection<TokenBucket> tB)
Description copied from interface:Policer.BuilderAssigns token buckets for this policer.Note: at least one token bucket
- Specified by:
withTokenBucketsin interfacePolicer.Builder- Parameters:
tB- the collection of token buckets- Returns:
- this
-
withDescription
public Policer.Builder withDescription(String d)
Description copied from interface:Policer.BuilderAssigns description for this policer. Default is empty description.- Specified by:
withDescriptionin interfacePolicer.Builder- Parameters:
d- the description- Returns:
- this
-
build
public DefaultPolicer build()
Description copied from interface:Policer.BuilderBuilds the policer based on the specified parameters when possible.- Specified by:
buildin interfacePolicer.Builder- Returns:
- a policer
-
-