for (Entry<String, NodeData> entry : nodeDataMapInProgress.entrySet()) {
String fqdn = entry.getKey();
NodeData nodeDataInProgress = entry.getValue();
if (nodeDataInProgress == null) {
models.utils.LogUtils.printLogError
("nodeData ==null in updateDataValidFromInProgress");
} else {
// deep copy
NodeData nodeDataInProgressClone = new NodeData(
nodeDataInProgress);
NodeReqResponse nrr = nodeDataInProgressClone.getDataMap().get(
agentCommandType);
// replace with the new data
if (nodeDataMapValid != null && fqdn != null && nrr != null) {
// check if the valid has nodeData too?
if (nodeDataMapValid.containsKey(fqdn)) {
NodeData nodeDataValid = nodeDataMapValid.get(fqdn);
if (!copyRequestContentOnly) {
// this will replace the nodeDataValid
nodeDataValid.getDataMap().put(agentCommandType,
nrr);
// only copy the request content.
} else {
// check if valid nodeData have this
// agentCommandType in dataMap?
if (nodeDataValid.getDataMap().containsKey(
agentCommandType)) {
// just copy the requestParameters
nodeDataValid.getDataMap()
.get(agentCommandType)
.getRequestParameters().clear();
nodeDataValid.getDataMap()
.get(agentCommandType)
.getRequestParameters();
for (Entry<String, String> entryLocal : nrr
.getRequestParameters().entrySet()) {
// replacement from inProgress Clone to
// valid
nodeDataValid
.getDataMap()
.get(agentCommandType)
.getRequestParameters()
.put(entryLocal.getKey(),
entryLocal.getValue());
}
} else {
// copy the whole nrr from inProgress.
nodeDataValid.getDataMap().put(
agentCommandType, nrr);
}
}