Class BooleanConstraint
- java.lang.Object
-
- org.onosproject.net.intent.constraint.BooleanConstraint
-
- All Implemented Interfaces:
Constraint
- Direct Known Subclasses:
AnnotationConstraint
,BandwidthConstraint
,EncapsulationConstraint
,LinkTypeConstraint
,MeteredConstraint
,ObstacleConstraint
,ProtectedConstraint
,TierConstraint
@Beta public abstract class BooleanConstraint extends Object implements Constraint
Abstract base class for various constraints that evaluate link viability in a yes/no fashion.
-
-
Constructor Summary
Constructors Constructor Description BooleanConstraint()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description double
cost(Link link, ResourceContext context)
Evaluates the specified link and provides the cost for its traversal.abstract boolean
isValid(Link link, ResourceContext context)
Returns true if the specified link satisfies the constraint.boolean
validate(Path path, ResourceContext context)
Validates that the specified path satisfies the constraint.
-
-
-
Method Detail
-
isValid
public abstract boolean isValid(Link link, ResourceContext context)
Returns true if the specified link satisfies the constraint.- Parameters:
link
- link to be validatedcontext
- resource context for checking available resources- Returns:
- true if link is viable
-
cost
public double cost(Link link, ResourceContext context)
Evaluates the specified link and provides the cost for its traversal. Negative return value means the specified link does not satisfy this constraint.- Specified by:
cost
in interfaceConstraint
- Parameters:
link
- link to be evaluatedcontext
- resource context for validating availability of resources- Returns:
- cost of link traversal
-
validate
public boolean validate(Path path, ResourceContext context)
Description copied from interface:Constraint
Validates that the specified path satisfies the constraint.- Specified by:
validate
in interfaceConstraint
- Parameters:
path
- path to be validatedcontext
- resource context for validating availability of resources- Returns:
- cost of link traversal
-
-