Agaetis
VMWare API

1.0.0.8

com.agaetis.vmware
Class VixHost

java.lang.Object
  extended by com.agaetis.vmware.VixHost

public class VixHost
extends Object

VixHost is mainly used to connect at first and recover VixVM you want. You must use it to be able to have an access to a vm.

Author:
Franck MARCHAND

Field Summary
private  int handle
           
private  String host
           
private  String password
           
private  int port
           
private  int ServiceProvider
           
private  String username
           
private  VixLibrary vl
           
 
Constructor Summary
VixHost()
          Empty constructeur
VixHost(String host, int port, String username, String password, int ServiceProvider)
           
 
Method Summary
 void connect()
          Connect to the server.
 void disconnect()
          Disconnect from the vmware server or workstation.
 int getHandle()
           
 String getHost()
           
 String getPassword()
           
 int getPort()
           
 int getServiceProvider()
           
 String getUsername()
           
 VixVM open(String vmxFilePathName)
          This method is used to obtain a VM from an host machine.
 void reconnect()
          Reconnect to the vmware server or workstation.
 void setHandle(int handle)
           
 void setHost(String host)
           
 void setPassword(String password)
           
 void setPort(int port)
           
 void setServiceProvider(int ServiceProvider)
           
 void setUsername(String username)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

port

private int port

host

private String host

username

private String username

password

private String password

ServiceProvider

private int ServiceProvider

handle

private int handle

vl

private VixLibrary vl
Constructor Detail

VixHost

public VixHost(String host,
               int port,
               String username,
               String password,
               int ServiceProvider)
Parameters:
host - host address where there is the vm hosted
port - the port to communicate with. By default it's 902
username - local username on the host machine
password - local password on the host machine
ServiceProvider - specify the type of Service provider

VixHost

public VixHost()
Empty constructeur

Method Detail

getHandle

public int getHandle()

setHandle

public void setHandle(int handle)

getServiceProvider

public int getServiceProvider()

setServiceProvider

public void setServiceProvider(int ServiceProvider)

getHost

public String getHost()

setHost

public void setHost(String host)

getPassword

public String getPassword()

setPassword

public void setPassword(String password)

getPort

public int getPort()

setPort

public void setPort(int port)

getUsername

public String getUsername()

setUsername

public void setUsername(String username)

open

public VixVM open(String vmxFilePathName)
           throws VMWareRuntimeException
This method is used to obtain a VM from an host machine. So the name of the vmware configuration file is very important. The path to this file must be a local path on the host machine you're connected to. Before using this method, you must use connect() before.

Parameters:
vmxFilePathName - path to vm configuration file (vmx file)
Returns:
the VixVM object which allows to run basic operations on a vm
Throws:
VMWareRuntimeException

connect

public void connect()
             throws VMWareRuntimeException
Connect to the server. Before having and using a VM. you must connect to a vmware server. This method uses the members of the class which should be initialized with accessors or within the constructor VixHost(String, int, String, String, int)

Throws:
VMWareRuntimeException

disconnect

public void disconnect()
Disconnect from the vmware server or workstation.


reconnect

public void reconnect()
Reconnect to the vmware server or workstation. Sometimes it's usefull to reconnect to have new host handler. For example after using VixVM.revertToSnapshot(int) it seems necessary to reconnect


Agaetis
VMWare API

1.0.0.8

2010 Agaetis