Package org.btrplace.model.constraint
Class Fence
java.lang.Object
org.btrplace.model.constraint.SimpleConstraint
org.btrplace.model.constraint.Fence
- All Implemented Interfaces:
Constraint
,SatConstraint
@SideConstraint(args={"v : vms","ns <: nodes"}, inv="vmState(v) = running --> host(v) : ns") public class Fence extends SimpleConstraint
A constraint to force the given VM, when running,
to be hosted on a given group of nodes.
- Author:
- Fabien Hermenier
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description boolean
equals(Object o)
FenceChecker
getChecker()
Get the validator used to check if a plan satisfies the constraint.Collection<Node>
getInvolvedNodes()
Get the nodes involved in the constraint.Collection<VM>
getInvolvedVMs()
Get the VMs involved in the constraint.int
hashCode()
static List<Fence>
newFence(Collection<VM> vms, Collection<Node> nodes)
Instantiate discrete constraints for a collection of VMs.String
toString()
Methods inherited from class org.btrplace.model.constraint.SimpleConstraint
isContinuous, setContinuous
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.btrplace.model.constraint.SatConstraint
isSatisfied, isSatisfied
-
Constructor Details
-
Fence
Make a new discrete constraint.- Parameters:
vm
- the involved VMnodes
- the involved nodes
-
Fence
Make a new discrete constraint.- Parameters:
vm
- the involved VMn
- the involved nodes
-
Fence
Make a new constraint.- Parameters:
vm
- the VM identifiersnodes
- the nodes identifierscontinuous
-true
for a continuous constraint.
-
-
Method Details
-
toString
-
equals
-
hashCode
public int hashCode() -
getChecker
Description copied from interface:SatConstraint
Get the validator used to check if a plan satisfies the constraint.- Returns:
- a non-null
SatConstraintChecker
-
getInvolvedNodes
Description copied from interface:SatConstraint
Get the nodes involved in the constraint.- Returns:
- a set of nodes identifiers that may be empty
-
getInvolvedVMs
Description copied from interface:SatConstraint
Get the VMs involved in the constraint.- Returns:
- a set of VM identifiers that may be empty
-
newFence
Instantiate discrete constraints for a collection of VMs.- Parameters:
vms
- the VMs to integratenodes
- the hosts to disallow- Returns:
- the associated list of constraints
-