com.vmware.apputils.vim
Class ServiceConnection

java.lang.Object
  extended by com.vmware.apputils.vim.ServiceConnection

public class ServiceConnection
extends java.lang.Object

Connection Handler for WebService


Field Summary
protected  com.vmware.vim.VimServiceLocator _locator
           
protected  com.vmware.vim.VimPortType _service
           
protected  com.vmware.vim.ServiceContent _sic
           
protected  com.vmware.vim.ManagedObjectReference _svcRef
           
protected  int _svcState
           
static int ConnectionState_Connected
           
static int ConnectionState_Disconnected
           
 
Constructor Summary
ServiceConnection(java.lang.String svcRefVal)
           
 
Method Summary
 void connect(java.lang.String urlStr, java.lang.String username, java.lang.String password, boolean ignoreCerts)
          Creates an instance of the VMA proxy and establishes a connection
static ServiceConnection CreateServiceConnection(java.lang.String inst)
           
 void disconnect()
          Disconnects from the WebService
 com.vmware.vim.ManagedObjectReference getPropCol()
           
 com.vmware.vim.ManagedObjectReference getRootFolder()
           
 com.vmware.vim.VimPortType getService()
           
 com.vmware.vim.ServiceContent getServiceContent()
           
 com.vmware.vim.ManagedObjectReference getServiceInstanceRef()
           
 void ignoreCert()
           
 boolean isConnected()
          Check if Connection is established or not.
 void loadSession(java.lang.String url, java.lang.String fileName, boolean ignoreCerts)
           
 void saveSession(java.lang.String fileName)
           
 int ServiceState()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ConnectionState_Connected

public static int ConnectionState_Connected

ConnectionState_Disconnected

public static int ConnectionState_Disconnected

_locator

protected com.vmware.vim.VimServiceLocator _locator

_service

protected com.vmware.vim.VimPortType _service

_svcState

protected int _svcState

_sic

protected com.vmware.vim.ServiceContent _sic

_svcRef

protected com.vmware.vim.ManagedObjectReference _svcRef
Constructor Detail

ServiceConnection

public ServiceConnection(java.lang.String svcRefVal)
Method Detail

CreateServiceConnection

public static ServiceConnection CreateServiceConnection(java.lang.String inst)

connect

public void connect(java.lang.String urlStr,
                    java.lang.String username,
                    java.lang.String password,
                    boolean ignoreCerts)
             throws java.lang.Exception
Creates an instance of the VMA proxy and establishes a connection

Parameters:
urlStr - web service url
username - authorized user
password - authorized password for user
Throws:
java.lang.Exception

ignoreCert

public void ignoreCert()

saveSession

public void saveSession(java.lang.String fileName)
                 throws java.lang.Exception
Throws:
java.lang.Exception

loadSession

public void loadSession(java.lang.String url,
                        java.lang.String fileName,
                        boolean ignoreCerts)
                 throws java.lang.Exception
Throws:
java.lang.Exception

isConnected

public boolean isConnected()
Check if Connection is established or not.

Returns:
true if connected, false otherwise

getService

public com.vmware.vim.VimPortType getService()
Returns:
Service instance

getServiceInstanceRef

public com.vmware.vim.ManagedObjectReference getServiceInstanceRef()
Returns:
Service MO Reference

getServiceContent

public com.vmware.vim.ServiceContent getServiceContent()
Returns:
Service instance content

getPropCol

public com.vmware.vim.ManagedObjectReference getPropCol()
Returns:
Service property collector

getRootFolder

public com.vmware.vim.ManagedObjectReference getRootFolder()
Returns:
Root folder

ServiceState

public int ServiceState()
Returns:
Service instance

disconnect

public void disconnect()
                throws java.lang.Exception
Disconnects from the WebService

Throws:
java.lang.Exception