org.redhat.vmtruckloader.vmware
Class VMWareMachineService

java.lang.Object
  extended by org.redhat.vmtruckloader.vmware.VMWareMachineService
All Implemented Interfaces:
MachineService

public class VMWareMachineService
extends Object
implements MachineService

VMWare implementation of the MachineService responsible for Machine related semantics (list, start, stop, etc.).

Author:
Duncan Doyle - duncan.doyle@redhat.com, Romain Pelisse - belaran@redhat.com

Constructor Summary
VMWareMachineService()
           
 
Method Summary
 MachineSpecification cloneMachine(String sourceMachineName, MachineSpecification spec)
          Clones the source machine to the target machine.
 void deleteMachine(String machineName)
          Stops the machine with the given name.
 void deploy(String netName, String vmName)
          Move a VM to the appropriate VLAN
 void editMachine(MachineSpecification machineCreate)
           
 Collection<com.vmware.vim25.mo.Task> getJobs()
          Returns currently running jobs.
 com.vmware.vim25.mo.VirtualMachine getMachine(String machineName)
          Retrieves the Machine information of the given machine.
 Collection<com.vmware.vim25.mo.VirtualMachine> getMachines()
          Retrieves the Machines.
 void setConnectionData(String username, String password, URL vCenterUrl)
          Allow to pass to the instance the credential information for the backend system.
 void startMachine(String machineName)
          Starts the machine with the given name.
 void stopMachine(String machineName)
          Stops the machine with the given name.
 void stopMachine(String machineName, boolean async)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VMWareMachineService

public VMWareMachineService()
Method Detail

setConnectionData

public void setConnectionData(String username,
                              String password,
                              URL vCenterUrl)
Description copied from interface: MachineService

Allow to pass to the instance the credential information for the backend system.

Specified by:
setConnectionData in interface MachineService

getMachines

public Collection<com.vmware.vim25.mo.VirtualMachine> getMachines()
Description copied from interface: MachineService
Retrieves the Machines.

Specified by:
getMachines in interface MachineService
Returns:
a Collection containing machines.

getMachine

public com.vmware.vim25.mo.VirtualMachine getMachine(String machineName)
Description copied from interface: MachineService
Retrieves the Machine information of the given machine.

Specified by:
getMachine in interface MachineService
Parameters:
machineName - the name of the machine.
Returns:
the Machine information.

startMachine

public void startMachine(String machineName)
Description copied from interface: MachineService
Starts the machine with the given name.

Specified by:
startMachine in interface MachineService
Parameters:
machineName - the name of the machine that needs to be started.

stopMachine

public void stopMachine(String machineName)
Description copied from interface: MachineService
Stops the machine with the given name.

Specified by:
stopMachine in interface MachineService
Parameters:
machineName - the name of the machine that needs to be stopped.

stopMachine

public void stopMachine(String machineName,
                        boolean async)

deleteMachine

public void deleteMachine(String machineName)
Description copied from interface: MachineService
Stops the machine with the given name.

Specified by:
deleteMachine in interface MachineService
Parameters:
machineName - the name of the machine that needs to be stopped.

cloneMachine

public MachineSpecification cloneMachine(String sourceMachineName,
                                         MachineSpecification spec)
Description copied from interface: MachineService
Clones the source machine to the target machine.

Specified by:
cloneMachine in interface MachineService

getJobs

public Collection<com.vmware.vim25.mo.Task> getJobs()
Description copied from interface: MachineService
Returns currently running jobs. This operation can be used to check status of long-running jobs like 'clone', etc.

Specified by:
getJobs in interface MachineService
Returns:
a Collection of Jobs.

deploy

public void deploy(String netName,
                   String vmName)
Description copied from interface: MachineService
Move a VM to the appropriate VLAN

Specified by:
deploy in interface MachineService

editMachine

public void editMachine(MachineSpecification machineCreate)
Specified by:
editMachine in interface MachineService


Copyright © 2013. All Rights Reserved.