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;
}
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;
}
Aggregations