return op;
}
/** Goes through the scores and sets preferred locations. */
protected void setLocations(final String heartbeatId, final Host dcHost, final Application.RunMode runMode) {
final ClusterStatus cs = getBrowser().getClusterStatus();
for (final Host host : getBrowser().getClusterHosts()) {
final HostInfo hi = host.getBrowser().getHostInfo();
final Widget wi = scoreComboBoxHash.get(hi);
String hs = wi.getStringValue();
if ("ALWAYS".equals(hs)) {
hs = CrmXml.INFINITY_VALUE.getValueForConfig();
} else if ("NEVER".equals(hs)) {
hs = CrmXml.MINUS_INFINITY_VALUE.getValueForConfig();
}
final HostLocation hlSaved = savedHostLocations.get(hi);
String opSaved = null;
if (hlSaved != null) {
opSaved = hlSaved.getOperation();
}
final String onHost = hi.getName();
final String op = getOpFromLabel(onHost, wi.getLabel().getText());
final HostLocation hostLoc = new HostLocation(hs, op, null, null);
if (!hostLoc.equals(hlSaved)) {
String locationId = cs.getLocationId(getHeartbeatId(runMode), onHost, runMode);
if ((hs == null || hs.isEmpty() || !Tools.areEqual(op, opSaved))
&& locationId != null) {
CRM.removeLocation(dcHost, locationId, getHeartbeatId(runMode), runMode);
locationId = null;
}
if (hs != null && !hs.isEmpty()) {
CRM.setLocation(dcHost,
getHeartbeatId(runMode),
onHost,
hostLoc,
locationId,
runMode);
}
}
}
/* ping */
final Widget pwi = pingComboBox;
if (pwi != null) {
final Value value = pwi.getValue();
if (!Tools.areEqual(savedPingOperation, value)) {
final String pingLocationId = cs.getPingLocationId(getHeartbeatId(runMode), runMode);
if (pingLocationId != null) {
CRM.removeLocation(dcHost, pingLocationId, getHeartbeatId(runMode), runMode);
}
if (value != null && !value.isNothingSelected()) {
CRM.setPingLocation(dcHost,