Class EncapsulationConstraint
- java.lang.Object
-
- org.onosproject.net.intent.constraint.BooleanConstraint
-
- org.onosproject.net.intent.constraint.EncapsulationConstraint
-
- All Implemented Interfaces:
Constraint
public class EncapsulationConstraint extends BooleanConstraint
Encapsulation to manage core transportation.
-
-
Constructor Summary
Constructors Constructor Description EncapsulationConstraint(EncapsulationType encapType)
Creates a new encapsulation constraint.EncapsulationConstraint(EncapsulationType encapType, Identifier<?> identifier)
Creates a new encapsulation constraint with suggested identifier.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EncapsulationType
encapType()
Returns the encapsulation type 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.Optional<Identifier<?>>
suggestedIdentifier()
Returns the suggested identifier.String
toString()
-
Methods inherited from class org.onosproject.net.intent.constraint.BooleanConstraint
cost, validate
-
-
-
-
Constructor Detail
-
EncapsulationConstraint
public EncapsulationConstraint(EncapsulationType encapType)
Creates a new encapsulation constraint.- Parameters:
encapType
- the encapsulation typeEncapsulationType
-
EncapsulationConstraint
public EncapsulationConstraint(EncapsulationType encapType, Identifier<?> identifier)
Creates a new encapsulation constraint with suggested identifier.- Parameters:
encapType
- the encapsulation typeEncapsulationType
identifier
- the suggested identifier
-
-
Method Detail
-
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
-
encapType
public EncapsulationType encapType()
Returns the encapsulation type required by this constraint.- Returns:
- encapType
-
suggestedIdentifier
public Optional<Identifier<?>> suggestedIdentifier()
Returns the suggested identifier.- Returns:
- suggestedIdentifier
-
-