Package org.onosproject.net.meter
Class DefaultMeter
- java.lang.Object
-
- org.onosproject.net.AbstractAnnotated
-
- org.onosproject.net.meter.DefaultMeter
-
- All Implemented Interfaces:
Annotated
,Meter
,MeterEntry
,PiTranslatable
public final class DefaultMeter extends AbstractAnnotated implements Meter, MeterEntry
A default implementation of a meter.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DefaultMeter.Builder
-
Nested classes/interfaces inherited from interface org.onosproject.net.meter.Meter
Meter.Unit
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ApplicationId
appId()
The id of the application which created this meter.Collection<Band>
bands()
The collection of bands to apply on the dataplane.static DefaultMeter.Builder
builder()
long
bytesSeen()
Number of bytes processed by this meter.DeviceId
deviceId()
The target device for this meter.boolean
equals(Object o)
int
hashCode()
MeterId
id()
This meters id.boolean
isBurst()
Signals whether this meter applies to bursts only.long
life()
The lifetime in seconds of this meter.MeterCellId
meterCellId()
Returns the meter cell identifier of this meter.long
packetsSeen()
Number of packets processed by this meter.long
referenceCount()
The number of flows pointing to this meter.void
setLife(long life)
Set the amount of time the meter has existed in seconds.void
setProcessedBytes(long bytes)
Updates the number of bytes seen by the meter.void
setProcessedPackets(long packets)
Updates the number of packets seen by this meter.void
setReferenceCount(long count)
Sets the number of flows which are using this meter.void
setState(MeterState state)
Updates the state of this meter.MeterState
state()
Fetches the state of this meter.String
toString()
Meter.Unit
unit()
The unit used within this meter.-
Methods inherited from class org.onosproject.net.AbstractAnnotated
annotations
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.onosproject.net.Annotated
annotations
-
-
-
-
Method Detail
-
deviceId
public DeviceId deviceId()
Description copied from interface:Meter
The target device for this meter.
-
meterCellId
public MeterCellId meterCellId()
Description copied from interface:Meter
Returns the meter cell identifier of this meter.- Specified by:
meterCellId
in interfaceMeter
- Returns:
- a meter identifier
-
appId
public ApplicationId appId()
Description copied from interface:Meter
The id of the application which created this meter. Could be null if the meter is read from the controller southbound.
-
unit
public Meter.Unit unit()
Description copied from interface:Meter
The unit used within this meter.
-
isBurst
public boolean isBurst()
Description copied from interface:Meter
Signals whether this meter applies to bursts only.
-
bands
public Collection<Band> bands()
Description copied from interface:Meter
The collection of bands to apply on the dataplane.
-
state
public MeterState state()
Description copied from interface:Meter
Fetches the state of this meter.
-
life
public long life()
Description copied from interface:Meter
The lifetime in seconds of this meter.
-
referenceCount
public long referenceCount()
Description copied from interface:Meter
The number of flows pointing to this meter.- Specified by:
referenceCount
in interfaceMeter
- Returns:
- a reference count
-
packetsSeen
public long packetsSeen()
Description copied from interface:Meter
Number of packets processed by this meter.- Specified by:
packetsSeen
in interfaceMeter
- Returns:
- a packet count
-
bytesSeen
public long bytesSeen()
Description copied from interface:Meter
Number of bytes processed by this meter.
-
builder
public static DefaultMeter.Builder builder()
-
setState
public void setState(MeterState state)
Description copied from interface:MeterEntry
Updates the state of this meter.- Specified by:
setState
in interfaceMeterEntry
- Parameters:
state
- a meter state
-
setLife
public void setLife(long life)
Description copied from interface:MeterEntry
Set the amount of time the meter has existed in seconds.- Specified by:
setLife
in interfaceMeterEntry
- Parameters:
life
- number of seconds
-
setReferenceCount
public void setReferenceCount(long count)
Description copied from interface:MeterEntry
Sets the number of flows which are using this meter.- Specified by:
setReferenceCount
in interfaceMeterEntry
- Parameters:
count
- a reference count.
-
setProcessedPackets
public void setProcessedPackets(long packets)
Description copied from interface:MeterEntry
Updates the number of packets seen by this meter.- Specified by:
setProcessedPackets
in interfaceMeterEntry
- Parameters:
packets
- a packet count.
-
setProcessedBytes
public void setProcessedBytes(long bytes)
Description copied from interface:MeterEntry
Updates the number of bytes seen by the meter.- Specified by:
setProcessedBytes
in interfaceMeterEntry
- Parameters:
bytes
- a byte counter.
-
-