Class LatencyConstraint
- java.lang.Object
-
- org.onosproject.net.intent.constraint.LatencyConstraint
-
- All Implemented Interfaces:
Constraint
@Beta public class LatencyConstraint extends java.lang.Object implements Constraint
Constraint that evaluates the latency through a path.
-
-
Constructor Summary
Constructors Constructor Description LatencyConstraint(java.time.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 double
cost(Link link, ResourceContext context)
Evaluates the specified link and provides the cost for its traversal.boolean
equals(java.lang.Object obj)
int
hashCode()
java.time.Duration
latency()
java.lang.String
toString()
boolean
validate(Path path, ResourceContext context)
Validates that the specified path satisfies the constraint.
-
-
-
Method Detail
-
latency
public java.time.Duration latency()
-
cost
public double cost(Link link, ResourceContext context)
Description copied from interface:Constraint
Evaluates the specified link and provides the cost for its traversal.- 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
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-