@Beta public final class DefaultPolicer extends Object implements Policer, PolicerEntry
Modifier and Type | Class and Description |
---|---|
static class |
DefaultPolicer.Builder
Implementation of the policer builder interface.
|
Policer.Unit
Modifier and Type | Method and Description |
---|---|
ApplicationId |
applicationId()
The id of the application which created this policer.
|
static DefaultPolicer.Builder |
builder()
Returns a new builder reference.
|
String |
description()
Brief description of this policer.
|
DeviceId |
deviceId()
The device of this policer, where policing
is applied.
|
boolean |
equals(Object o) |
int |
hashCode() |
boolean |
isColorAware()
Indicates if this policer is aware of the marking indication
in the ethernet frames.
|
long |
life()
The lifetime in seconds of this policer.
|
PolicerId |
policerId()
The id of this policer.
|
long |
processedBytes()
Stats which reports how many bytes have been
processed so far.
|
long |
processedPackets()
Stats which reports how many packets have been
processed so far.
|
long |
referenceCount()
Returns how many are referencing this policer.
|
void |
setLife(long l)
Set the amount of time the policer has existed in seconds.
|
void |
setProcessedBytes(long bytes)
Updates the number of bytes seen by the policer.
|
void |
setProcessedPackets(long packets)
Updates the number of packets seen by this policer.
|
void |
setReferenceCount(long count)
Sets how many are using this policer.
|
Collection<TokenBucket> |
tokenBuckets()
The token buckets used within this policer.
|
String |
toString() |
Policer.Unit |
unit()
The unit used within this policer.
|
public DeviceId deviceId()
Policer
public ApplicationId applicationId()
Policer
applicationId
in interface Policer
public PolicerId policerId()
Policer
public boolean isColorAware()
Policer
isColorAware
in interface Policer
public Policer.Unit unit()
Policer
public Collection<TokenBucket> tokenBuckets()
Policer
tokenBuckets
in interface Policer
public String description()
Policer
description
in interface Policer
public long referenceCount()
Policer
referenceCount
in interface Policer
public void setReferenceCount(long count)
PolicerEntry
setReferenceCount
in interface PolicerEntry
count
- a reference count.public long processedPackets()
Policer
processedPackets
in interface Policer
public void setProcessedPackets(long packets)
PolicerEntry
setProcessedPackets
in interface PolicerEntry
packets
- a packet count.public long processedBytes()
Policer
processedBytes
in interface Policer
public void setProcessedBytes(long bytes)
PolicerEntry
setProcessedBytes
in interface PolicerEntry
bytes
- a byte counter.public long life()
Policer
public void setLife(long l)
PolicerEntry
setLife
in interface PolicerEntry
l
- number of secondspublic static DefaultPolicer.Builder builder()