Package org.onosproject.net.behaviour
Class BandwidthProfile
- java.lang.Object
- 
- org.onosproject.net.behaviour.BandwidthProfile
 
- 
 @Beta public final class BandwidthProfile extends Object Implementation of a generic bandwidth profile (marker/policer).
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classBandwidthProfile.BuilderBuilder of BandwidthProfile entities.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BandwidthProfile.Builderbuilder()Returns a new builder.Integercbs()Obtains the committed burst size (CBS) of this bandwidth profile.Bandwidthcir()Obtains the committed information rate (CIR) of this bandwidth profile.booleancolorAware()Obtains the color-aware mode of the bandwidth profile.Integerebs()Obtains the excess burst size (EBS) of this bandwidth profile.booleanequals(Object obj)static BandwidthProfilefromMeter(Meter meter)Creates a bandwidth profile based on the parameters of a Meter.BandwidthProfileActiongreenAction()Obtains the action to be taken for traffic marked as green.inthashCode()Stringname()Obtains the name of this bandwidth profile.Integerpbs()Obtains the peak burst size (PBS) of this bandwidth profile.Bandwidthpir()Obtains the peak information rate (PIR) of this bandwidth profile.BandwidthProfileActionredAction()Obtains the action to be taken for traffic marked as red.StringtoString()org.onosproject.net.behaviour.BandwidthProfile.Typetype()Obtains the bandwidth profile type depending on the profile parameters.BandwidthProfileActionyellowAction()Obtains the action to be taken for traffic marked as yellow.
 
- 
- 
- 
Method Detail- 
namepublic String name() Obtains the name of this bandwidth profile.- Returns:
- the bandwidth profile name
 
 - 
cirpublic Bandwidth cir() Obtains the committed information rate (CIR) of this bandwidth profile.- Returns:
- the CIR of the bandwidth profile
 
 - 
pirpublic 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
 
 - 
cbspublic 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
 
 - 
pbspublic 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
 
 - 
ebspublic 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
 
 - 
greenActionpublic 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
 
 - 
yellowActionpublic 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
 
 - 
redActionpublic 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
 
 - 
colorAwarepublic boolean colorAware() Obtains the color-aware mode of the bandwidth profile.- Returns:
- true if the bandwidth profile is color-aware; false otherwise
 
 - 
typepublic 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
 
 - 
fromMeterpublic 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
 
 - 
builderpublic static BandwidthProfile.Builder builder() Returns a new builder.- Returns:
- new builder
 
 
- 
 
-