Interface Policer.Builder
-
- All Known Implementing Classes:
DefaultPolicer.Builder
- Enclosing interface:
- Policer
public static interface Policer.Builder
A policer builder.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Policer
build()
Builds the policer based on the specified parameters when possible.Policer.Builder
colorAware(boolean isColorAware)
Sets this policer to be color aware.Policer.Builder
forDeviceId(DeviceId deviceId)
Assigns the device for this policer.Policer.Builder
fromApp(ApplicationId appId)
Assigns the application that built this policer.Policer.Builder
withDescription(java.lang.String description)
Assigns description for this policer.Policer.Builder
withId(PolicerId id)
Assigns the id to this policer.Policer.Builder
withPolicingResource(PolicingResource policingResource)
Assigns policer id and device id for this policer.Policer.Builder
withTokenBuckets(java.util.Collection<TokenBucket> tokenBuckets)
Assigns token buckets for this policer.Policer.Builder
withUnit(Policer.Unit unit)
Assigns the unit to use for this policer.
-
-
-
Method Detail
-
forDeviceId
Policer.Builder forDeviceId(DeviceId deviceId)
Assigns the device for this policer.Note: mandatory setter for this builder
- Parameters:
deviceId
- a device id- Returns:
- this
-
fromApp
Policer.Builder fromApp(ApplicationId appId)
Assigns the application that built this policer.Note: mandatory setter for this builder
- Parameters:
appId
- an application id- Returns:
- this
-
withId
Policer.Builder withId(PolicerId id)
Assigns the id to this policer.Note: mandatory setter for this builder
- Parameters:
id
- an identifier- Returns:
- this
-
colorAware
Policer.Builder colorAware(boolean isColorAware)
Sets this policer to be color aware. Defaults to false.- Parameters:
isColorAware
- if it is color aware or not- Returns:
- this
-
withUnit
Policer.Builder withUnit(Policer.Unit unit)
Assigns the unit to use for this policer. Defaults to MB/s.- Parameters:
unit
- a unit- Returns:
- this
-
withPolicingResource
Policer.Builder withPolicingResource(PolicingResource policingResource)
Assigns policer id and device id for this policer.- Parameters:
policingResource
- the policing resource- Returns:
- this
-
withTokenBuckets
Policer.Builder withTokenBuckets(java.util.Collection<TokenBucket> tokenBuckets)
Assigns token buckets for this policer.Note: at least one token bucket
- Parameters:
tokenBuckets
- the collection of token buckets- Returns:
- this
-
withDescription
Policer.Builder withDescription(java.lang.String description)
Assigns description for this policer. Default is empty description.- Parameters:
description
- the description- Returns:
- this
-
build
Policer build()
Builds the policer based on the specified parameters when possible.- Returns:
- a policer
-
-