Class BandwidthConstraint
- java.lang.Object
-
- org.onosproject.net.intent.constraint.BooleanConstraint
-
- org.onosproject.net.intent.constraint.BandwidthConstraint
-
- All Implemented Interfaces:
Constraint
@Beta public final class BandwidthConstraint extends BooleanConstraint
Constraint that evaluates links based on available bandwidths.
-
-
Constructor Summary
Constructors Constructor Description BandwidthConstraint(Bandwidth bandwidth)
Creates a new bandwidth constraint.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Bandwidth
bandwidth()
Returns the bandwidth required by this constraint.boolean
equals(Object obj)
int
hashCode()
boolean
isValid(Link link, ResourceContext context)
Returns true if the specified link satisfies the constraint.static BandwidthConstraint
of(double v, DataRateUnit unit)
Creates a new bandwidth constraint.String
toString()
-
Methods inherited from class org.onosproject.net.intent.constraint.BooleanConstraint
cost, validate
-
-
-
-
Constructor Detail
-
BandwidthConstraint
public BandwidthConstraint(Bandwidth bandwidth)
Creates a new bandwidth constraint.- Parameters:
bandwidth
- required bandwidth
-
-
Method Detail
-
of
public static BandwidthConstraint of(double v, DataRateUnit unit)
Creates a new bandwidth constraint.- Parameters:
v
- required amount of bandwidthunit
-DataRateUnit
ofv
- Returns:
BandwidthConstraint
instance with given bandwidth requirement
-
isValid
public boolean isValid(Link link, ResourceContext context)
Description copied from class:BooleanConstraint
Returns true if the specified link satisfies the constraint.- Specified by:
isValid
in classBooleanConstraint
- Parameters:
link
- link to be validatedcontext
- resource context for checking available resources- Returns:
- true if link is viable
-
bandwidth
public Bandwidth bandwidth()
Returns the bandwidth required by this constraint.- Returns:
- required bandwidth
-
-