Class DefaultPolicer
- java.lang.Object
-
- org.onosproject.net.behaviour.trafficcontrol.DefaultPolicer
-
- All Implemented Interfaces:
Policer,PolicerEntry
@Beta public final class DefaultPolicer extends Object implements Policer, PolicerEntry
Default implementation of the policer interface.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDefaultPolicer.BuilderImplementation of the policer builder interface.-
Nested classes/interfaces inherited from interface org.onosproject.net.behaviour.trafficcontrol.Policer
Policer.Unit
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ApplicationIdapplicationId()The id of the application which created this policer.static DefaultPolicer.Builderbuilder()Returns a new builder reference.Stringdescription()Brief description of this policer.DeviceIddeviceId()The device of this policer, where policing is applied.booleanequals(Object o)inthashCode()booleanisColorAware()Indicates if this policer is aware of the marking indication in the ethernet frames.longlife()The lifetime in seconds of this policer.PolicerIdpolicerId()The id of this policer.longprocessedBytes()Stats which reports how many bytes have been processed so far.longprocessedPackets()Stats which reports how many packets have been processed so far.longreferenceCount()Returns how many are referencing this policer.voidsetLife(long l)Set the amount of time the policer has existed in seconds.voidsetProcessedBytes(long bytes)Updates the number of bytes seen by the policer.voidsetProcessedPackets(long packets)Updates the number of packets seen by this policer.voidsetReferenceCount(long count)Sets how many are using this policer.Collection<TokenBucket>tokenBuckets()The token buckets used within this policer.StringtoString()Policer.Unitunit()The unit used within this policer.
-
-
-
Method Detail
-
deviceId
public DeviceId deviceId()
Description copied from interface:PolicerThe device of this policer, where policing is applied.
-
applicationId
public ApplicationId applicationId()
Description copied from interface:PolicerThe id of the application which created this policer.- Specified by:
applicationIdin interfacePolicer- Returns:
- the identifier of the application
-
policerId
public PolicerId policerId()
Description copied from interface:PolicerThe id of this policer.
-
isColorAware
public boolean isColorAware()
Description copied from interface:PolicerIndicates if this policer is aware of the marking indication in the ethernet frames. TODO Understand for the future how it is implemented by the vendors- Specified by:
isColorAwarein interfacePolicer- Returns:
- true if this policer is color aware.
-
unit
public Policer.Unit unit()
Description copied from interface:PolicerThe unit used within this policer.
-
tokenBuckets
public Collection<TokenBucket> tokenBuckets()
Description copied from interface:PolicerThe token buckets used within this policer.- Specified by:
tokenBucketsin interfacePolicer- Returns:
- the list of the token buckets
-
description
public String description()
Description copied from interface:PolicerBrief description of this policer.- Specified by:
descriptionin interfacePolicer- Returns:
- human readable description
-
referenceCount
public long referenceCount()
Description copied from interface:PolicerReturns how many are referencing this policer. Availability of this information depends on the technology used for the implementation of this policer.- Specified by:
referenceCountin interfacePolicer- Returns:
- the reference count
-
setReferenceCount
public void setReferenceCount(long count)
Description copied from interface:PolicerEntrySets how many are using this policer.- Specified by:
setReferenceCountin interfacePolicerEntry- Parameters:
count- a reference count.
-
processedPackets
public long processedPackets()
Description copied from interface:PolicerStats which reports how many packets have been processed so far. Availability of this information depends on the technology used for the implementation of this policer.- Specified by:
processedPacketsin interfacePolicer- Returns:
- the processed packets
-
setProcessedPackets
public void setProcessedPackets(long packets)
Description copied from interface:PolicerEntryUpdates the number of packets seen by this policer.- Specified by:
setProcessedPacketsin interfacePolicerEntry- Parameters:
packets- a packet count.
-
processedBytes
public long processedBytes()
Description copied from interface:PolicerStats which reports how many bytes have been processed so far. Availability of this information depends on the technology used for the implementation of this policer.- Specified by:
processedBytesin interfacePolicer- Returns:
- the processed bytes
-
setProcessedBytes
public void setProcessedBytes(long bytes)
Description copied from interface:PolicerEntryUpdates the number of bytes seen by the policer.- Specified by:
setProcessedBytesin interfacePolicerEntry- Parameters:
bytes- a byte counter.
-
life
public long life()
Description copied from interface:PolicerThe lifetime in seconds of this policer. Availability of this information depends on the technology used for the implementation of this policer.
-
setLife
public void setLife(long l)
Description copied from interface:PolicerEntrySet the amount of time the policer has existed in seconds.- Specified by:
setLifein interfacePolicerEntry- Parameters:
l- number of seconds
-
builder
public static DefaultPolicer.Builder builder()
Returns a new builder reference.- Returns:
- a new builder
-
-