Package org.onosproject.net.meter
Class DefaultMeter
- java.lang.Object
-
- org.onosproject.net.meter.DefaultMeter
-
- All Implemented Interfaces:
Meter,MeterEntry,PiTranslatable
public final class DefaultMeter extends java.lang.Object implements Meter, MeterEntry
A default implementation of a meter.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDefaultMeter.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 ApplicationIdappId()The id of the application which created this meter.java.util.Collection<Band>bands()The collection of bands to apply on the dataplane.static DefaultMeter.Builderbuilder()longbytesSeen()Number of bytes processed by this meter.DeviceIddeviceId()The target device for this meter.booleanequals(java.lang.Object o)inthashCode()MeterIdid()This meters id.booleanisBurst()Signals whether this meter applies to bursts only.longlife()The lifetime in seconds of this meter.MeterCellIdmeterCellId()Returns the meter cell identifier of this meter.longpacketsSeen()Number of packets processed by this meter.longreferenceCount()The number of flows pointing to this meter.voidsetLife(long life)Set the amount of time the meter has existed in seconds.voidsetProcessedBytes(long bytes)Updates the number of bytes seen by the meter.voidsetProcessedPackets(long packets)Updates the number of packets seen by this meter.voidsetReferenceCount(long count)Sets the number of flows which are using this meter.voidsetState(MeterState state)Updates the state of this meter.MeterStatestate()Fetches the state of this meter.java.lang.StringtoString()Meter.Unitunit()The unit used within this meter.
-
-
-
Method Detail
-
deviceId
public DeviceId deviceId()
Description copied from interface:MeterThe target device for this meter.
-
meterCellId
public MeterCellId meterCellId()
Description copied from interface:MeterReturns the meter cell identifier of this meter.- Specified by:
meterCellIdin interfaceMeter- Returns:
- a meter identifier
-
appId
public ApplicationId appId()
Description copied from interface:MeterThe id of the application which created this meter.
-
unit
public Meter.Unit unit()
Description copied from interface:MeterThe unit used within this meter.
-
isBurst
public boolean isBurst()
Description copied from interface:MeterSignals whether this meter applies to bursts only.
-
bands
public java.util.Collection<Band> bands()
Description copied from interface:MeterThe collection of bands to apply on the dataplane.
-
state
public MeterState state()
Description copied from interface:MeterFetches the state of this meter.
-
life
public long life()
Description copied from interface:MeterThe lifetime in seconds of this meter.
-
referenceCount
public long referenceCount()
Description copied from interface:MeterThe number of flows pointing to this meter.- Specified by:
referenceCountin interfaceMeter- Returns:
- a reference count
-
packetsSeen
public long packetsSeen()
Description copied from interface:MeterNumber of packets processed by this meter.- Specified by:
packetsSeenin interfaceMeter- Returns:
- a packet count
-
bytesSeen
public long bytesSeen()
Description copied from interface:MeterNumber of bytes processed by this meter.
-
builder
public static DefaultMeter.Builder builder()
-
setState
public void setState(MeterState state)
Description copied from interface:MeterEntryUpdates the state of this meter.- Specified by:
setStatein interfaceMeterEntry- Parameters:
state- a meter state
-
setLife
public void setLife(long life)
Description copied from interface:MeterEntrySet the amount of time the meter has existed in seconds.- Specified by:
setLifein interfaceMeterEntry- Parameters:
life- number of seconds
-
setReferenceCount
public void setReferenceCount(long count)
Description copied from interface:MeterEntrySets the number of flows which are using this meter.- Specified by:
setReferenceCountin interfaceMeterEntry- Parameters:
count- a reference count.
-
setProcessedPackets
public void setProcessedPackets(long packets)
Description copied from interface:MeterEntryUpdates the number of packets seen by this meter.- Specified by:
setProcessedPacketsin interfaceMeterEntry- Parameters:
packets- a packet count.
-
setProcessedBytes
public void setProcessedBytes(long bytes)
Description copied from interface:MeterEntryUpdates the number of bytes seen by the meter.- Specified by:
setProcessedBytesin interfaceMeterEntry- Parameters:
bytes- a byte counter.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-