Package org.onosproject.net.behaviour
Class BandwidthProfile
- java.lang.Object
-
- org.onosproject.net.behaviour.BandwidthProfile
-
@Beta public final class BandwidthProfile extends java.lang.Object
Implementation of a generic bandwidth profile (marker/policer).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BandwidthProfile.Builder
Builder of BandwidthProfile entities.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BandwidthProfile.Builder
builder()
Returns a new builder.java.lang.Integer
cbs()
Obtains the committed burst size (CBS) of this bandwidth profile.Bandwidth
cir()
Obtains the committed information rate (CIR) of this bandwidth profile.boolean
colorAware()
Obtains the color-aware mode of the bandwidth profile.java.lang.Integer
ebs()
Obtains the excess burst size (EBS) of this bandwidth profile.boolean
equals(java.lang.Object obj)
static BandwidthProfile
fromMeter(Meter meter)
Creates a bandwidth profile based on the parameters of a Meter.BandwidthProfileAction
greenAction()
Obtains the action to be taken for traffic marked as green.int
hashCode()
java.lang.String
name()
Obtains the name of this bandwidth profile.java.lang.Integer
pbs()
Obtains the peak burst size (PBS) of this bandwidth profile.Bandwidth
pir()
Obtains the peak information rate (PIR) of this bandwidth profile.BandwidthProfileAction
redAction()
Obtains the action to be taken for traffic marked as red.java.lang.String
toString()
org.onosproject.net.behaviour.BandwidthProfile.Type
type()
Obtains the bandwidth profile type depending on the profile parameters.BandwidthProfileAction
yellowAction()
Obtains the action to be taken for traffic marked as yellow.
-
-
-
Method Detail
-
name
public java.lang.String name()
Obtains the name of this bandwidth profile.- Returns:
- the bandwidth profile name
-
cir
public Bandwidth cir()
Obtains the committed information rate (CIR) of this bandwidth profile.- Returns:
- the CIR of the bandwidth profile
-
pir
public Bandwidth pir()
Obtains the peak information rate (PIR) of this bandwidth profile. If this profile does not have a PIR, null is returned.- Returns:
- the PIR of the profile; null if the profile does not have a PIR
-
cbs
public java.lang.Integer cbs()
Obtains the committed burst size (CBS) of this bandwidth profile. The CBS is measured in bytes. If this profile does not have a CBS, null is returned.- Returns:
- the CBS of the profile (bytes); null if the profile does not have a CBS
-
pbs
public java.lang.Integer pbs()
Obtains the peak burst size (PBS) of this bandwidth profile. The PBS is measured in bytes. If this profile does not have a PBS, null is returned.- Returns:
- the PBS of the bandwidth profile (bytes); null if the profile does not have a PBS
-
ebs
public java.lang.Integer ebs()
Obtains the excess burst size (EBS) of this bandwidth profile. The EBS is measured in bytes. If this profile does not have an EBS, null is returned.- Returns:
- the EBS of the bandwidth profile (bytes); null if the profile does not have an EBS
-
greenAction
public BandwidthProfileAction greenAction()
Obtains the action to be taken for traffic marked as green. Green color marking is applied to traffic that conforms to the CIR/CBS.- Returns:
- the action to be taken for traffic marked as green
-
yellowAction
public BandwidthProfileAction yellowAction()
Obtains the action to be taken for traffic marked as yellow. Yellow color marking is applied to traffic that does not conform to the CIR/CBS but conforms to one of:- EBS (srTCM type)
- PIR/PBS (trTCM type)
- Returns:
- the action to be taken for traffic marked as yellow; null if neither EBS nor PIR/PBS are defined
-
redAction
public BandwidthProfileAction redAction()
Obtains the action to be taken for traffic marked as red. Red color marking is applied to traffic that does not conform to one of the following:- CIR/CBS (sr2CM type)
- EBS (srTCM type)
- PIR/PBS (trTCM type)
- Returns:
- the action to be taken for traffic marked as red
-
colorAware
public boolean colorAware()
Obtains the color-aware mode of the bandwidth profile.- Returns:
- true if the bandwidth profile is color-aware; false otherwise
-
type
public org.onosproject.net.behaviour.BandwidthProfile.Type type()
Obtains the bandwidth profile type depending on the profile parameters.- When PIR is defined, the profile corresponds to a Two Rate Three Color Marker (trTCM)
- When EBS is defined, the profile corresponds to a Single Rate Three Color Marker (srTCM)
- When neither PIR nor EBS are defined, the profile corresponds to a Single Rate Two Color Marker/Policer (sr2CM)
- Returns:
- the bandwidth profile type
-
fromMeter
public static BandwidthProfile fromMeter(Meter meter)
Creates a bandwidth profile based on the parameters of a Meter. NOTE: The dropPrecedence in the Meter is interpreted as the DSCP class to set on the packet- Parameters:
meter
- the Meter to be used for creating the bandwidth profile- Returns:
- the bandwidth profile created
-
builder
public static BandwidthProfile.Builder builder()
Returns a new builder.- Returns:
- new builder
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-