Class DefaultTokenBucket.Builder
- java.lang.Object
-
- org.onosproject.net.behaviour.trafficcontrol.DefaultTokenBucket.Builder
-
- All Implemented Interfaces:
TokenBucket.Builder
- Enclosing class:
- DefaultTokenBucket
public static final class DefaultTokenBucket.Builder extends java.lang.Object implements TokenBucket.Builder
Implementation of the token bucket builder interface.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DefaultTokenBucketbuild()Builds the token bucket based on the specified parameters when possible.TokenBucket.BuilderwithAction(TokenBucket.Action a)Assigns the action to this token bucket.TokenBucket.BuilderwithBurstSize(long bS)Assigns the burst size to this token bucket.TokenBucket.BuilderwithDscp(short d)Assigns the dscp value to this token bucket.TokenBucket.BuilderwithRate(long r)Assigns the rate to this token bucket.TokenBucket.BuilderwithType(TokenBucket.Type t)Assigns the type to this token bucket.
-
-
-
Method Detail
-
withRate
public TokenBucket.Builder withRate(long r)
Description copied from interface:TokenBucket.BuilderAssigns the rate to this token bucket.- Specified by:
withRatein interfaceTokenBucket.Builder- Parameters:
r- a rate value- Returns:
- this
-
withBurstSize
public TokenBucket.Builder withBurstSize(long bS)
Description copied from interface:TokenBucket.BuilderAssigns the burst size to this token bucket. Default to 2 * 1500 bytes.- Specified by:
withBurstSizein interfaceTokenBucket.Builder- Parameters:
bS- a burst size- Returns:
- this
-
withAction
public TokenBucket.Builder withAction(TokenBucket.Action a)
Description copied from interface:TokenBucket.BuilderAssigns the action to this token bucket.Note: mandatory setter for this builder
- Specified by:
withActionin interfaceTokenBucket.Builder- Parameters:
a- an action- Returns:
- this
-
withDscp
public TokenBucket.Builder withDscp(short d)
Description copied from interface:TokenBucket.BuilderAssigns the dscp value to this token bucket.- Specified by:
withDscpin interfaceTokenBucket.Builder- Parameters:
d- a dscp value- Returns:
- this
-
withType
public TokenBucket.Builder withType(TokenBucket.Type t)
Description copied from interface:TokenBucket.BuilderAssigns the type to this token bucket.Note: mandatory setter for this builder
- Specified by:
withTypein interfaceTokenBucket.Builder- Parameters:
t- the type- Returns:
- this
-
build
public DefaultTokenBucket build()
Description copied from interface:TokenBucket.BuilderBuilds the token bucket based on the specified parameters when possible.- Specified by:
buildin interfaceTokenBucket.Builder- Returns:
- a token bucket
-
-