use of com.emc.storageos.coordinator.common.Configuration in project coprhd-controller by CoprHD.
the class DrPostFailoverHandler method isCompleted.
/**
* Check if current handler is completed.
*
* @return true for completed. Otherwise false
*/
protected boolean isCompleted() {
Configuration config = coordinator.queryConfiguration(CONFIG_KIND, CONFIG_ID);
String value = config.getConfig(name);
if (value != null && Status.COMPLETED.toString().equals(value)) {
return true;
}
return false;
}
use of com.emc.storageos.coordinator.common.Configuration in project coprhd-controller by CoprHD.
the class DrPostFailoverHandler method isAllHandlersCompleted.
/**
* Check if all handlers are completed.
*
* @return
*/
protected boolean isAllHandlersCompleted() {
Configuration config = coordinator.queryConfiguration(CONFIG_KIND, CONFIG_ID);
Map<String, String> allHandlers = config.getAllConfigs(true);
for (String key : allHandlers.keySet()) {
String status = allHandlers.get(key);
if (!Status.COMPLETED.toString().equals(status)) {
return false;
}
}
return true;
}
use of com.emc.storageos.coordinator.common.Configuration in project coprhd-controller by CoprHD.
the class DrUtil method getVdcSiteMap.
/**
* Get a map of all sites of all vdcs.
* The keys are VDC short ids, the values are lists of sites within each vdc
*
* @return map of vdc -> list of sites
*/
public Map<String, List<Site>> getVdcSiteMap() {
Map<String, List<Site>> vdcSiteMap = new HashMap<>();
for (Configuration vdcConfig : coordinator.queryAllConfiguration(Site.CONFIG_KIND)) {
String siteKind = String.format("%s/%s", Site.CONFIG_KIND, vdcConfig.getId());
List<Site> sites = new ArrayList<>();
for (Configuration siteConfig : coordinator.queryAllConfiguration(siteKind)) {
sites.add(new Site(siteConfig));
}
if (sites.size() > 0) {
vdcSiteMap.put(vdcConfig.getId(), sites);
}
}
return vdcSiteMap;
}
use of com.emc.storageos.coordinator.common.Configuration in project coprhd-controller by CoprHD.
the class DrUtil method getSiteFromLocalVdc.
/**
* Load site information from local vdc
*
* @param siteId
* @return
*/
public Site getSiteFromLocalVdc(String siteId) {
String siteKind = String.format("%s/%s", Site.CONFIG_KIND, getLocalVdcShortId());
Configuration config = coordinator.queryConfiguration(siteKind, siteId);
if (config != null) {
return new Site(config);
}
throw CoordinatorException.retryables.cannotFindSite(siteId);
}
use of com.emc.storageos.coordinator.common.Configuration in project coprhd-controller by CoprHD.
the class CoordinatorClientImpl method verifyPublishedDualInetAddress.
/**
* Returns true is found published DualInetAddress for this node, and it matches with current
* configured
*
* @param nodeId
* @return
*/
private boolean verifyPublishedDualInetAddress(String nodeId) {
DualInetAddress dualAddress = null;
Configuration config = queryConfiguration(Constants.NODE_DUALINETADDR_CONFIG, nodeId);
if (config != null) {
dualAddress = parseInetAddressConfig(config);
}
if ((dualAddress != null) && dualAddress.equals(inetAddressLookupMap.getDualInetAddress())) {
return true;
}
return false;
}
Aggregations