org.ow2.jasmine.jadort.service.action
Class VMMAction

java.lang.Object
  extended by org.ow2.jasmine.jadort.service.action.AbstractAction
      extended by org.ow2.jasmine.jadort.service.action.AbstractJMXAction
          extended by org.ow2.jasmine.jadort.service.action.VMMAction
Direct Known Subclasses:
JasmineVMMAction

public abstract class VMMAction
extends AbstractJMXAction

Action for a VM.

Author:
Malek Chahine, S. Ali Tokmen

Nested Class Summary
static class VMMAction.VMState
          States of virtual machine hosts.
 
Field Summary
 
Fields inherited from class org.ow2.jasmine.jadort.service.action.AbstractJMXAction
connector, JMX_CHECK_TIMEOUT, JMX_CONNECT_TIMEOUT, mbscnx
 
Constructor Summary
VMMAction()
           
 
Method Summary
abstract  void deployImageOnVM(java.lang.String copyVM, java.lang.String newVMName, java.lang.String vmImageUUID)
          Creates the VM with the given name and deploys the given image on it.
abstract  void destroyVM(java.lang.String vmName)
          Destroys a VM host.
protected static java.lang.reflect.Constructor<? extends VMMAction> getConstructor(java.lang.Class<? extends VMMAction> actionType)
           
abstract  java.lang.String getFullVMName(java.lang.String vmName)
          Gets the full VM name of a RUNNING VM.
abstract  java.util.List<org.ow2.jasmine.jadort.api.entities.deployment.VMImageBean> getVMImages()
          Gets the list of VM images on the current host's image repository.
static VMMAction getVMMAction(org.ow2.jasmine.jadort.api.entities.topology.VMBean vm)
           
abstract  org.ow2.jasmine.vmm.api.VirtualMachineMXBean.PowerState getVMState(java.lang.String vmName)
          Gets the state of a VM host.
protected static VMMAction newInstance(org.ow2.jasmine.jadort.api.entities.topology.VMBean vm)
           
abstract  void startVM(java.lang.String vmName)
          Sends the "start" signal to a VM host.
abstract  void stopVM(java.lang.String vmName)
          Sends the "stop" signal to a VM host.
abstract  void waitForVMState(java.lang.String vmName, org.ow2.jasmine.vmm.api.VirtualMachineMXBean.PowerState state, long timeout)
          Wait for the given VM host to reach a given state.
 
Methods inherited from class org.ow2.jasmine.jadort.service.action.AbstractJMXAction
checkJMXConnection, connectViaJMX, disconnectJMX, establishJMXConnection
 
Methods inherited from class org.ow2.jasmine.jadort.service.action.AbstractAction
appendToLog, flushLog
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VMMAction

public VMMAction()
Method Detail

getVMMAction

public static VMMAction getVMMAction(org.ow2.jasmine.jadort.api.entities.topology.VMBean vm)

newInstance

protected static VMMAction newInstance(org.ow2.jasmine.jadort.api.entities.topology.VMBean vm)

getConstructor

protected static java.lang.reflect.Constructor<? extends VMMAction> getConstructor(java.lang.Class<? extends VMMAction> actionType)
                                                                            throws java.lang.Exception
Throws:
java.lang.Exception

getFullVMName

public abstract java.lang.String getFullVMName(java.lang.String vmName)
                                        throws java.lang.Exception
Gets the full VM name of a RUNNING VM.

Parameters:
vmName - Name of the VM host to get the full VM name for.
Returns:
Full VM name. That might be equal to the vmName passed as argument.
Throws:
java.lang.Exception - If any exception occurs.

startVM

public abstract void startVM(java.lang.String vmName)
                      throws java.lang.Exception
Sends the "start" signal to a VM host.

Parameters:
vmName - Name of the VM host to start.
Throws:
java.lang.Exception - If any exception occurs.

deployImageOnVM

public abstract void deployImageOnVM(java.lang.String copyVM,
                                     java.lang.String newVMName,
                                     java.lang.String vmImageUUID)
                              throws java.lang.Exception
Creates the VM with the given name and deploys the given image on it.

Parameters:
copyVM - Name of the VM host to copy properties (disk size, memory, etc.) from.
newVMName - Name of the new VM host to create.
vmImageUUID - UUID of the VM image to deploy.
Throws:
java.lang.Exception - If any exception occurs.

destroyVM

public abstract void destroyVM(java.lang.String vmName)
                        throws java.lang.Exception
Destroys a VM host.

Parameters:
vmName - Name of the VM host to destroy.
Throws:
java.lang.Exception - If any exception occurs.

stopVM

public abstract void stopVM(java.lang.String vmName)
                     throws java.lang.Exception
Sends the "stop" signal to a VM host.

Parameters:
vmName - Name of the VM host to stop.
Throws:
java.lang.Exception - If any exception occurs.

getVMState

public abstract org.ow2.jasmine.vmm.api.VirtualMachineMXBean.PowerState getVMState(java.lang.String vmName)
                                                                            throws java.lang.Exception
Gets the state of a VM host.

Parameters:
vmName - Name of the VM host to get the state of.
Throws:
java.lang.Exception - If any exception occurs.

waitForVMState

public abstract void waitForVMState(java.lang.String vmName,
                                    org.ow2.jasmine.vmm.api.VirtualMachineMXBean.PowerState state,
                                    long timeout)
                             throws java.lang.Exception
Wait for the given VM host to reach a given state.

Parameters:
vmName - Name of the VM host to get the state of.
state - State to wait for.
timeout - Number of seconds after which to throw.
Throws:
java.lang.Exception - If any exception occurs.

getVMImages

public abstract java.util.List<org.ow2.jasmine.jadort.api.entities.deployment.VMImageBean> getVMImages()
                                                                                                throws java.lang.Exception
Gets the list of VM images on the current host's image repository.

Returns:
List of VM images on the current host's image repository.
Throws:
java.lang.Exception - If any exception occurs.


Copyright © 2010 OW2 Consortium. All Rights Reserved.