Class LatencyConstraint
- java.lang.Object
-
- org.onosproject.net.intent.constraint.LatencyConstraint
-
- All Implemented Interfaces:
Constraint
@Beta public class LatencyConstraint extends Object implements Constraint
Constraint that evaluates the latency through a path.
-
-
Constructor Summary
Constructors Constructor Description LatencyConstraint(Duration latency)Creates a new constraint to keep under specified latency through a path.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublecost(Link link, ResourceContext context)Evaluates the specified link and provides the cost for its traversal.booleanequals(Object obj)inthashCode()Durationlatency()StringtoString()booleanvalidate(Path path, ResourceContext context)Validates that the specified path satisfies the constraint.
-
-
-
Constructor Detail
-
LatencyConstraint
public LatencyConstraint(Duration latency)
Creates a new constraint to keep under specified latency through a path.- Parameters:
latency- latency to be kept
-
-
Method Detail
-
latency
public Duration latency()
-
cost
public double cost(Link link, ResourceContext context)
Description copied from interface:ConstraintEvaluates the specified link and provides the cost for its traversal.- 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
-
-