Package org.btrplace.plan.event
Class ShutdownVM
java.lang.Object
org.btrplace.plan.event.Action
org.btrplace.plan.event.ShutdownVM
- All Implemented Interfaces:
Event
,VMEvent
,VMStateTransition
public class ShutdownVM extends Action implements VMStateTransition
An action to stop a virtual machine running on an online node and put it into the ready state.
- Author:
- Fabien Hermenier
-
Nested Class Summary
-
Constructor Summary
Constructors Constructor Description ShutdownVM(VM v, Node on, int start, int end)
Make a new action. -
Method Summary
Modifier and Type Method Description boolean
applyAction(Model m)
Apply the action by removing the virtual machine from the model.boolean
equals(Object o)
VMState
getCurrentState()
Get the current state of the VM.VMState
getNextState()
Get the next state of the VM.Node
getNode()
Get the node hosting the VM.VM
getVM()
Get the VM to involved in the action.int
hashCode()
String
pretty()
Pretty print of the action.Object
visit(ActionVisitor v)
Notify a visitor to visit the action.Methods inherited from class org.btrplace.plan.event.Action
addEvent, apply, applyEvents, getEnd, getEvents, getStart, toString
-
Constructor Details
-
ShutdownVM
Make a new action.- Parameters:
v
- the virtual machine to stopon
- the hosting nodestart
- the moment the action startsend
- the moment the action finish
-
-
Method Details
-
applyAction
Apply the action by removing the virtual machine from the model.- Specified by:
applyAction
in classAction
- Parameters:
m
- the model to alter- Returns:
true
-
pretty
Description copied from class:Action
Pretty print of the action. -
equals
-
hashCode
public int hashCode() -
getVM
Description copied from interface:VMEvent
Get the VM to involved in the action. -
getNode
Get the node hosting the VM.- Returns:
- the node identifier
-
getCurrentState
Description copied from interface:VMStateTransition
Get the current state of the VM.- Specified by:
getCurrentState
in interfaceVMStateTransition
- Returns:
- a State
-
getNextState
Description copied from interface:VMStateTransition
Get the next state of the VM.- Specified by:
getNextState
in interfaceVMStateTransition
- Returns:
- a State
-
visit
Description copied from interface:Event
Notify a visitor to visit the action.
-