use of com.emc.storageos.systemservices.impl.client.SysClientFactory.SysClient in project coprhd-controller by CoprHD.
the class CoordinatorClientExt method isActiveSiteStable.
public boolean isActiveSiteStable(Site activeSite) {
// check if cluster state is stable
String vip = activeSite.getVipEndPoint();
int port = _svc.getEndpoint().getPort();
String baseNodeURL = String.format(SysClientFactory.BASE_URL_FORMAT, vip, port);
try {
SysClient client = SysClientFactory.getSysClient(URI.create(baseNodeURL), CHECK_ACTIVE_SITE_STABLE_READ_TIMEOUT_MS, CHECK_ACTIVE_SITE_STABLE_CONNECT_TIMEOUT_MS);
ClusterInfo clusterInfo = client.get(URI.create(URI_INTERNAL_GET_CLUSTER_INFO), ClusterInfo.class, null);
_log.info("Get cluster info from active site {}", clusterInfo.getCurrentState());
if (ClusterState.STABLE.equals(ClusterState.valueOf(clusterInfo.getCurrentState()))) {
return true;
}
} catch (Exception ex) {
_log.warn("Encounter error when call Sys API on active site{} ", ex.toString());
}
return false;
}
Aggregations