This will ensure that the ODL restconf state and the plugin's will remain in sync. Previously, should a failed gate set be made then deleted, ODL/restconf would no longer display the gate info but it was impossible to create a new one with the same ID as the plugin would say it already existed.
Change-Id: I1b0e1b5540225d7b2afda47aaa7c8bf3f46c9508
Signed-off-by: Steven Pisarski <s.pisarski@cablelabs.com>
if (message.contains("200 OK")) {
ccapMap.put(ccapId, thisCcap);
updateCcapMaps(thisCcap);
if (message.contains("200 OK")) {
ccapMap.put(ccapId, thisCcap);
updateCcapMaps(thisCcap);
- logger.info("onDataChanged(): created CCAP: {}/{} : {}", thisData.gatePath, thisCcap, message);
- logger.info("onDataChanged(): created CCAP: {} : {}", thisData.gatePath, message);
+ logger.info("Created CCAP: {}/{} : {}", thisData.gatePath, thisCcap, message);
+ logger.info("Created CCAP: {} : {}", thisData.gatePath, message);
} else {
// TODO - when a connection cannot be made, need to remove CCAP from ODL cache.
} else {
// TODO - when a connection cannot be made, need to remove CCAP from ODL cache.
- logger.error("onDataChanged(): create CCAP Failed: {} : {}", thisData.gatePath, message);
+ logger.error("Create CCAP Failed: {} : {}", thisData.gatePath, message);
}
// set the response string in the config ccap object using a new thread
executor.execute(new Response(dataBroker, entry.getKey(), thisCcap, message));
}
// set the response string in the config ccap object using a new thread
executor.execute(new Response(dataBroker, entry.getKey(), thisCcap, message));
if (scnDir != null) {
if (pcmmServiceMap.get(thisCcap.getCcapId()) != null) {
message = pcmmServiceMap.get(thisCcap.getCcapId()).sendGateSet(gatePathStr, subId, gate, scnDir);
if (scnDir != null) {
if (pcmmServiceMap.get(thisCcap.getCcapId()) != null) {
message = pcmmServiceMap.get(thisCcap.getCcapId()).sendGateSet(gatePathStr, subId, gate, scnDir);
+ gateMap.put(gatePathStr, gate);
+ gateCcapMap.put(gatePathStr, thisCcap.getCcapId());
+
if (message.contains("200 OK")) {
if (message.contains("200 OK")) {
- gateMap.put(gatePathStr, gate);
- gateCcapMap.put(gatePathStr, thisCcap.getCcapId());
- logger.info("onDataChanged(): created QoS gate {} for {}/{}/{} - {}",
+ logger.info("Created QoS gate {} for {}/{}/{} - {}",
gateId, ccapId, gatePathStr, gate, message);
gateId, ccapId, gatePathStr, gate, message);
- logger.info("onDataChanged(): created QoS gate {} for {}/{} - {}",
+ logger.info("Created QoS gate {} for {}/{} - {}",
gateId, ccapId, gatePathStr, message);
} else {
gateId, ccapId, gatePathStr, message);
} else {
- logger.info("onDataChanged(): Unable to create QoS gate {} for {}/{}/{} - {}",
+ logger.info("Unable to create QoS gate {} for {}/{}/{} - {}",
gateId, ccapId, gatePathStr, gate, message);
gateId, ccapId, gatePathStr, gate, message);
- logger.error("onDataChanged(): Unable to create QoS gate {} for {}/{} - {}",
+ logger.error("Unable to create QoS gate {} for {}/{} - {}",
gateId, ccapId, gatePathStr, message);
}
} else {
gateId, ccapId, gatePathStr, message);
}
} else {
final String subIdStr = thisData.subId;
message = String.format("404 Not Found - no CCAP found for subscriber %s in %s",
subIdStr, gatePathStr);
final String subIdStr = thisData.subId;
message = String.format("404 Not Found - no CCAP found for subscriber %s in %s",
subIdStr, gatePathStr);
- logger.info("onDataChanged(): create QoS gate {} FAILED: no CCAP found for subscriber {}: @ {}/{}",
+ logger.info("Create QoS gate {} FAILED: no CCAP found for subscriber {}: @ {}/{}",
gateId, subIdStr, gatePathStr, gate);
gateId, subIdStr, gatePathStr, gate);
- logger.error("onDataChanged(): create QoS gate {} FAILED: no CCAP found for subscriber {}: @ {}",
+ logger.error("Create QoS gate {} FAILED: no CCAP found for subscriber {}: @ {}",
gateId, subIdStr, gatePathStr);
}
} else {
final String subIdStr = thisData.subId;
message = String.format("400 Bad Request - subId must be a valid IP address for subscriber %s in %s",
subIdStr, gatePathStr);
gateId, subIdStr, gatePathStr);
}
} else {
final String subIdStr = thisData.subId;
message = String.format("400 Bad Request - subId must be a valid IP address for subscriber %s in %s",
subIdStr, gatePathStr);
- logger.info("onDataChanged(): create QoS gate {} FAILED: subId must be a valid IP address for subscriber {}: @ {}/{}",
+ logger.info("Create QoS gate {} FAILED: subId must be a valid IP address for subscriber {}: @ {}/{}",
gateId, subIdStr, gatePathStr, gate);
gateId, subIdStr, gatePathStr, gate);
- logger.error("onDataChanged(): create QoS gate {} FAILED: subId must be a valid IP address for subscriber {}: @ {}",
+ logger.error("Create QoS gate {} FAILED: subId must be a valid IP address for subscriber {}: @ {}",
gateId, subIdStr, gatePathStr);
}
// set the response message in the config gate object using a new thread
gateId, subIdStr, gatePathStr);
}
// set the response message in the config gate object using a new thread