Search in sources :

Example 6 with HostRuntimeInfo

use of com.vmware.vim25.HostRuntimeInfo in project coprhd-controller by CoprHD.

the class VMwareUtils method getConnectionState.

/**
 * Gets the connection state of the given host system.
 *
 * @param host
 *            the host system.
 * @return the host system connection state, or null if it cannot be determined.
 */
public static HostSystemConnectionState getConnectionState(HostSystem host) {
    HostRuntimeInfo runtime = host.getRuntime();
    HostSystemConnectionState connectionState = (runtime != null) ? runtime.getConnectionState() : null;
    return connectionState;
}
Also used : HostRuntimeInfo(com.vmware.vim25.HostRuntimeInfo) HostSystemConnectionState(com.vmware.vim25.HostSystemConnectionState)

Example 7 with HostRuntimeInfo

use of com.vmware.vim25.HostRuntimeInfo in project coprhd-controller by CoprHD.

the class VMwareSupport method isHostConnected.

/**
 * Returns true if the host is in a connected state
 *
 * @param host the host to check
 * @return true if host is connected, otherwise returns false
 */
public static boolean isHostConnected(HostSystem host) {
    HostRuntimeInfo runtime = (host != null) ? host.getRuntime() : null;
    HostSystemConnectionState connectionState = (runtime != null) ? runtime.getConnectionState() : null;
    return connectionState == HostSystemConnectionState.connected;
}
Also used : HostRuntimeInfo(com.vmware.vim25.HostRuntimeInfo) HostSystemConnectionState(com.vmware.vim25.HostSystemConnectionState)

Aggregations

HostRuntimeInfo (com.vmware.vim25.HostRuntimeInfo)7 HostSystemPowerState (com.vmware.vim25.HostSystemPowerState)4 HostSystem (com.vmware.vim25.mo.HostSystem)4 RemoteException (java.rmi.RemoteException)4 HostSystemConnectionState (com.vmware.vim25.HostSystemConnectionState)3 MalformedURLException (java.net.MalformedURLException)3 VmwareViJavaAccess (org.opennms.protocols.vmware.VmwareViJavaAccess)3 VirtualMachinePowerState (com.vmware.vim25.VirtualMachinePowerState)2 VirtualMachineRuntimeInfo (com.vmware.vim25.VirtualMachineRuntimeInfo)2 VirtualMachine (com.vmware.vim25.mo.VirtualMachine)2 TimeoutTracker (org.opennms.core.utils.TimeoutTracker)2 PollStatus (org.opennms.netmgt.poller.PollStatus)2 CIMObject (org.sblim.wbem.cim.CIMObject)2 Datastore (com.vmware.vim25.mo.Datastore)1 DistributedVirtualPortgroup (com.vmware.vim25.mo.DistributedVirtualPortgroup)1 ManagedEntity (com.vmware.vim25.mo.ManagedEntity)1 Network (com.vmware.vim25.mo.Network)1 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 InetAddress (java.net.InetAddress)1 UnknownHostException (java.net.UnknownHostException)1