}
if (Application.isLive(runMode) && !getService().isNew() && !parent.getService().isNew()) {
parent.setUpdated(true);
setUpdated(true);
}
final ClusterStatus clStatus = getBrowser().getClusterStatus();
if (isConstraintPlaceholder() || parent.isConstraintPlaceholder()) {
final ConstraintPHInfo cphi;
if (isConstraintPlaceholder()) {
cphi = (ConstraintPHInfo) this;
} else {
cphi = (ConstraintPHInfo) parent;
}
final Map<CrmXml.RscSet, Map<String, String>> rscSetsOrdAttrs =
new LinkedHashMap<CrmXml.RscSet, Map<String, String>>();
final CrmXml.RscSetConnectionData rdata = cphi.getRscSetConnectionDataOrder();
/** resource set */
final String ordId = rdata.getConstraintId();
String idToRemove;
if (isConstraintPlaceholder()) {
idToRemove = parent.getService().getCrmId();
} else {
idToRemove = getService().getCrmId();
}
CrmXml.RscSet modifiedRscSet = null;
final List<CrmXml.RscSet> ordRscSets = clStatus.getRscSetsOrd(ordId);
if (ordRscSets != null) {
for (final CrmXml.RscSet rscSet : ordRscSets) {
if (rscSet.equals(rdata.getRscSet1()) || rscSet.equals(rdata.getRscSet2())) {
final List<String> newRscIds = new ArrayList<String>();
newRscIds.addAll(rscSet.getRscIds());
if (newRscIds.remove(idToRemove)
&& Application.isLive(runMode)) {
modifiedRscSet = rscSet;
}
if (!newRscIds.isEmpty()) {
final CrmXml.RscSet newRscSet = new CrmXml.RscSet(rscSet.getId(),
newRscIds,
rscSet.getSequential(),
rscSet.getRequireAll(),
rscSet.getOrderAction(),
rscSet.getColocationRole());
rscSetsOrdAttrs.put(newRscSet, null);
}
} else {
rscSetsOrdAttrs.put(rscSet, null);
}
}
}
if (Application.isLive(runMode) && rscSetsOrdAttrs.isEmpty()) {
cphi.getRscSetConnectionDataOrder().setConstraintId(null);
}
final Map<String, String> attrs =
new LinkedHashMap<String, String>();
final CrmXml.OrderData od = clStatus.getOrderData(ordId);
if (od != null) {
final String score = od.getScore();
attrs.put(CrmXml.SCORE_CONSTRAINT_PARAM, score);
}
if (Application.isLive(runMode)) {
///* so that it will not be removed */
cphi.setUpdated(false);
}
CRM.setRscSet(dcHost,
null,
false,
ordId,
false,
null,
rscSetsOrdAttrs,
attrs,
runMode);
} else {
final String rscFirstId = parent.getHeartbeatId(runMode);
final List<CrmXml.OrderData> allData = clStatus.getOrderDatas(rscFirstId);
if (allData != null) {
for (final CrmXml.OrderData orderData : allData) {
final String orderId = orderData.getId();
final String rscThenId = orderData.getRscThen();
if (rscThenId.equals(getHeartbeatId(runMode))) {