Package org.btrplace.model.constraint
Class AllowAllConstraintChecker<C extends SatConstraint>
java.lang.Object
org.btrplace.model.constraint.AllowAllConstraintChecker<C>
- All Implemented Interfaces:
SatConstraintChecker<C>
- Direct Known Subclasses:
AmongChecker
,BanChecker
,DeadlineChecker
,DenyMyVMsActions
,FenceChecker
,GatherChecker
,LonelyChecker
,MaxOnlineChecker
,NoDelayChecker
,OfflineChecker
,OnlineChecker
,OverbookChecker
,PrecedenceChecker
,PreserveChecker
,QuarantineChecker
,ResourceCapacityChecker
,RootChecker
,RunningCapacityChecker
,ScheduleChecker
,SeqChecker
,SerializeChecker
,SplitAmongChecker
,SplitChecker
,SpreadChecker
,SyncChecker
public class AllowAllConstraintChecker<C extends SatConstraint> extends Object implements SatConstraintChecker<C>
A default constraint checker that allow every action and event.
In addition,
SubstitutedVMEvent
events are tracked and
considered to maintain the set of VMs that is involved in
the constraint.- Author:
- Fabien Hermenier
-
Constructor Summary
Constructors Constructor Description AllowAllConstraintChecker(C c)
Make a new checker. -
Method Summary
Modifier and Type Method Description boolean
consume(AllocateEvent e)
Notify for the beginning of an event.boolean
consume(SubstitutedVMEvent e)
Notify for the beginning of an event.void
end(Allocate e)
Notify for the end of an action.void
end(BootNode a)
Notify for the end of an action.void
end(BootVM a)
Notify for the end of an action.void
end(ForgeVM a)
Notify for the end of an action.void
end(KillVM a)
Notify for the end of an action.void
end(MigrateVM a)
Notify for the end of an action.void
end(ResumeVM a)
Notify for the end of an action.void
end(ShutdownNode a)
Notify for the end of an action.void
end(ShutdownVM a)
Notify for the end of an action.void
end(SuspendVM a)
Notify for the end of an action.void
endRunningVMPlacement(RunningVMPlacement a)
Notify the end of aRunningVMPlacement
action.boolean
endsWith(Model mo)
Notify for the model that is reached once the reconfiguration has been applied.C
getConstraint()
Get the constraint associated to the checker.Set<Node>
getNodes()
Get the nodes involved in the constraint.Set<VM>
getVMs()
Get the VMs involved in the constraint.boolean
start(Allocate e)
Notify for the beginning of an action.boolean
start(BootNode a)
Notify for the beginning of an action.boolean
start(BootVM a)
Notify for the beginning of an action.boolean
start(ForgeVM a)
Notify for the beginning of an action.boolean
start(KillVM a)
Notify for the beginning of an action.boolean
start(MigrateVM a)
Notify for the beginning of an action.boolean
start(ResumeVM a)
Notify for the beginning of an action.boolean
start(ShutdownNode a)
Notify for the beginning of an action.boolean
start(ShutdownVM a)
Notify for the beginning of an action.boolean
start(SuspendVM a)
Notify for the beginning of an action.boolean
startRunningVMPlacement(RunningVMPlacement a)
Allow all theRunningVMPlacement
actions.boolean
startsWith(Model mo)
Notify for the model at the source of the reconfiguration.boolean
track(Collection<VM> c)
Register a new set of VMs int to track.
-
Constructor Details
-
AllowAllConstraintChecker
Make a new checker.- Parameters:
c
- the constraint associated to the checker.
-
-
Method Details
-
track
Register a new set of VMs int to track. EachSubstitutedVMEvent
event is caught and all of the registered collections are updated accordingly- Parameters:
c
- the collection to register- Returns:
true
iff the collection has been added
-
startsWith
Description copied from interface:SatConstraintChecker
Notify for the model at the source of the reconfiguration.- Specified by:
startsWith
in interfaceSatConstraintChecker<C extends SatConstraint>
- Parameters:
mo
- the model- Returns:
true
iff the model is valid wrt. the constraint
-
start
Description copied from interface:SatConstraintChecker
Notify for the beginning of an action.- Specified by:
start
in interfaceSatConstraintChecker<C extends SatConstraint>
- Parameters:
a
- the executed that will be executed- Returns:
startRunningVMPlacement(a)
-
end
Notify for the end of an action. ExecutesendRunningVMPlacement(a)
- Specified by:
end
in interfaceSatConstraintChecker<C extends SatConstraint>
- Parameters:
a
- the executed that will be executed
-
start
Description copied from interface:SatConstraintChecker
Notify for the beginning of an action.- Specified by:
start
in interfaceSatConstraintChecker<C extends SatConstraint>
- Parameters:
a
- the executed that will be executed- Returns:
startRunningVMPlacement(a)
-
end
Notify for the end of an action. ExecutesendRunningVMPlacement(a)
- Specified by:
end
in interfaceSatConstraintChecker<C extends SatConstraint>
- Parameters:
a
- the executed that will be executed
-
start
Description copied from interface:SatConstraintChecker
Notify for the beginning of an action.- Specified by:
start
in interfaceSatConstraintChecker<C extends SatConstraint>
- Parameters:
a
- the executed that will be executed- Returns:
true
iff the action execution is valid wrt. the constraint
-
end
Description copied from interface:SatConstraintChecker
Notify for the end of an action.- Specified by:
end
in interfaceSatConstraintChecker<C extends SatConstraint>
- Parameters:
a
- the action that ends
-
start
Description copied from interface:SatConstraintChecker
Notify for the beginning of an action.- Specified by:
start
in interfaceSatConstraintChecker<C extends SatConstraint>
- Parameters:
a
- the action that will be executed- Returns:
true
iff the action execution is valid wrt. the constraint
-
end
Description copied from interface:SatConstraintChecker
Notify for the end of an action.- Specified by:
end
in interfaceSatConstraintChecker<C extends SatConstraint>
- Parameters:
a
- the action that ends
-
start
Description copied from interface:SatConstraintChecker
Notify for the beginning of an action.- Specified by:
start
in interfaceSatConstraintChecker<C extends SatConstraint>
- Parameters:
a
- the action that will be executed- Returns:
true
iff the action execution is valid wrt. the constraint
-
end
Description copied from interface:SatConstraintChecker
Notify for the end of an action.- Specified by:
end
in interfaceSatConstraintChecker<C extends SatConstraint>
- Parameters:
a
- the action that ends
-
start
Description copied from interface:SatConstraintChecker
Notify for the beginning of an action.- Specified by:
start
in interfaceSatConstraintChecker<C extends SatConstraint>
- Parameters:
a
- the action that will be executed- Returns:
true
iff the action execution is valid wrt. the constraint
-
end
Description copied from interface:SatConstraintChecker
Notify for the end of an action.- Specified by:
end
in interfaceSatConstraintChecker<C extends SatConstraint>
- Parameters:
a
- the action that ends
-
start
Description copied from interface:SatConstraintChecker
Notify for the beginning of an action.- Specified by:
start
in interfaceSatConstraintChecker<C extends SatConstraint>
- Parameters:
a
- the action that will be executed- Returns:
true
iff the action execution is valid wrt. the constraint
-
end
Description copied from interface:SatConstraintChecker
Notify for the end of an action.- Specified by:
end
in interfaceSatConstraintChecker<C extends SatConstraint>
- Parameters:
a
- the action that ends
-
start
Description copied from interface:SatConstraintChecker
Notify for the beginning of an action.- Specified by:
start
in interfaceSatConstraintChecker<C extends SatConstraint>
- Parameters:
a
- the action that will be executed- Returns:
true
iff the action execution is valid wrt. the constraint
-
end
Description copied from interface:SatConstraintChecker
Notify for the end of an action.- Specified by:
end
in interfaceSatConstraintChecker<C extends SatConstraint>
- Parameters:
a
- the action that ends
-
start
Description copied from interface:SatConstraintChecker
Notify for the beginning of an action.- Specified by:
start
in interfaceSatConstraintChecker<C extends SatConstraint>
- Parameters:
a
- the action that will be executed- Returns:
true
iff the action execution is valid wrt. the constraint
-
end
Description copied from interface:SatConstraintChecker
Notify for the end of an action.- Specified by:
end
in interfaceSatConstraintChecker<C extends SatConstraint>
- Parameters:
a
- the action that ends
-
endsWith
Description copied from interface:SatConstraintChecker
Notify for the model that is reached once the reconfiguration has been applied.- Specified by:
endsWith
in interfaceSatConstraintChecker<C extends SatConstraint>
- Parameters:
mo
- the model- Returns:
true
iff the model is valid wrt. the constraint
-
consume
Description copied from interface:SatConstraintChecker
Notify for the beginning of an event.- Specified by:
consume
in interfaceSatConstraintChecker<C extends SatConstraint>
- Parameters:
e
- the event that will be executed- Returns:
true
iff the action execution is valid wrt. the constraint
-
consume
Description copied from interface:SatConstraintChecker
Notify for the beginning of an event.- Specified by:
consume
in interfaceSatConstraintChecker<C extends SatConstraint>
- Parameters:
e
- the event that will be executed- Returns:
true
iff the action execution is valid wrt. the constraint
-
start
Description copied from interface:SatConstraintChecker
Notify for the beginning of an action.- Specified by:
start
in interfaceSatConstraintChecker<C extends SatConstraint>
- Parameters:
e
- the action that will be executed- Returns:
true
iff the action execution is valid wrt. the constraint
-
end
Description copied from interface:SatConstraintChecker
Notify for the end of an action.- Specified by:
end
in interfaceSatConstraintChecker<C extends SatConstraint>
- Parameters:
e
- the action that ends
-
startRunningVMPlacement
Allow all theRunningVMPlacement
actions.- Parameters:
a
- the action to allow- Returns:
true
-
endRunningVMPlacement
Notify the end of aRunningVMPlacement
action.- Parameters:
a
- the notified action
-
getConstraint
Description copied from interface:SatConstraintChecker
Get the constraint associated to the checker.- Specified by:
getConstraint
in interfaceSatConstraintChecker<C extends SatConstraint>
- Returns:
- a non-null constraint
-
getVMs
Get the VMs involved in the constraint. The set is automatically updated by theSubstitutedVMEvent
events.- Returns:
- a set of VMs that may be empty
-
getNodes
Get the nodes involved in the constraint.- Returns:
- a set of nodes that may be empty
-