Class BooleanConstraint
- java.lang.Object
-
- org.onosproject.net.intent.constraint.BooleanConstraint
-
- All Implemented Interfaces:
Constraint
- Direct Known Subclasses:
AnnotationConstraint,BandwidthConstraint,EncapsulationConstraint,LinkTypeConstraint,ObstacleConstraint,ProtectedConstraint
@Beta public abstract class BooleanConstraint extends java.lang.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 doublecost(Link link, ResourceContext context)Evaluates the specified link and provides the cost for its traversal.abstract booleanisValid(Link link, ResourceContext context)Returns true if the specified link satisfies the constraint.booleanvalidate(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:
costin 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:ConstraintValidates that the specified path satisfies the constraint.- Specified by:
validatein interfaceConstraint- Parameters:
path- path to be validatedcontext- resource context for validating availability of resources- Returns:
- cost of link traversal
-
-