diff options
Diffstat (limited to 'ueb-listener/src/main')
-rw-r--r-- | ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncBaseModel.java | 28 | ||||
-rw-r--r-- | ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModel.java | 14 |
2 files changed, 16 insertions, 26 deletions
diff --git a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncBaseModel.java b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncBaseModel.java index fd5a2963..7f0e9398 100644 --- a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncBaseModel.java +++ b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncBaseModel.java @@ -887,13 +887,15 @@ public class SdncBaseModel { try { int rowCount = 0; CachedRowSet data = jdbcDataSource.getData("SELECT * from " + tableName + " where " + keyName + " = " + keyValue + ";", null, ""); - while(data.next()) { + if (data != null) { + while(data.next()) { rowCount ++; - } - if (rowCount != 0) { - LOG.debug("cleanUpExistingToscaData from: " + tableName + " for " + keyValue); - jdbcDataSource.writeData("DELETE from " + tableName + " where " + keyName + " = " + keyValue + ";", null, null); - } + } + if (rowCount != 0) { + LOG.debug("cleanUpExistingToscaData from: " + tableName + " for " + keyValue); + jdbcDataSource.writeData("DELETE from " + tableName + " where " + keyName + " = " + keyValue + ";", null, null); + } + } } catch (SQLException e) { LOG.error("Could not clean up existing " + tableName + " for " + keyValue, e); @@ -907,13 +909,15 @@ public class SdncBaseModel { try { int rowCount = 0; CachedRowSet data = jdbcDataSource.getData("SELECT * from " + tableName + " where " + key1Name + " = " + key1Value + " AND " + key2Name + " = " + key2Value + ";", null, ""); - while(data.next()) { + if (data != null) { + while(data.next()) { rowCount ++; - } - if (rowCount != 0) { - LOG.debug("cleanUpExistingToscaData from : " + tableName + " for " + key1Value + " and " + key2Value); - jdbcDataSource.writeData("DELETE from " + tableName + " where " + key1Name + " = " + key1Value + " AND " + key2Name + " = " + key2Value + ";", null, null); - } + } + if (rowCount != 0) { + LOG.debug("cleanUpExistingToscaData from : " + tableName + " for " + key1Value + " and " + key2Value); + jdbcDataSource.writeData("DELETE from " + tableName + " where " + key1Name + " = " + key1Value + " AND " + key2Name + " = " + key2Value + ";", null, null); + } + } } catch (SQLException e) { LOG.error("Could not clean up existing " + tableName + " for " + key1Value + " and " + key2Value, e); diff --git a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModel.java b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModel.java index 35639b36..5977e288 100644 --- a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModel.java +++ b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModel.java @@ -260,20 +260,6 @@ public class SdncVFCModel extends SdncBaseModel { return subnetRoleFound; } - private Map<String, String> getIpPropMapWithMatchingSubnetRole (ArrayList<Map<String, String>> ipPropParamsList, String subnetRole) { - - Map<String, String> ipPropMapMatch = new HashMap<String, String>(); - - if (subnetRole != null) { - for (Map<String, String> ipPropMap : ipPropParamsList) { - if (nullCheck(ipPropMap.get("subnet_role")) == subnetRole) { - return ipPropMap; - } - } - } - return ipPropMapMatch; - } - private void addRequiredParameters (Map<String, String> mappingParams) { // Add parameters which can not be null if they have not already been added - network_role, ipv4_count, ipv6_count |