diff options
author | root1 <srinivasa.mohan@huawei.com> | 2017-12-13 14:24:43 +0530 |
---|---|---|
committer | SRINIVAS V <srinivasa.mohan@huawei.com> | 2017-12-19 09:57:16 +0000 |
commit | 383d433f5cbb7394a9c335eff7759c9e2126f106 (patch) | |
tree | eee84c852274cad804c3f3a799a9f16797cb1141 /dataChange | |
parent | 416a026a496c933941f4d2ebfebc627a59ac647c (diff) |
Fixed to improve the Maintainability of code
Issue-ID: CCSDK-151
Change-Id: If8bf17dd0e5387855ddbff9198107f334ded59c5
Signed-off-by: SRINIVAS V <srinivasa.mohan@huawei.com>
Diffstat (limited to 'dataChange')
-rw-r--r-- | dataChange/provider/src/main/java/org/onap/ccsdk/sli/northbound/DataChangeClient.java | 15 | ||||
-rw-r--r-- | dataChange/provider/src/main/java/org/onap/ccsdk/sli/northbound/DataChangeProvider.java | 4 |
2 files changed, 9 insertions, 10 deletions
diff --git a/dataChange/provider/src/main/java/org/onap/ccsdk/sli/northbound/DataChangeClient.java b/dataChange/provider/src/main/java/org/onap/ccsdk/sli/northbound/DataChangeClient.java index 4bf857797..959b2b6fb 100644 --- a/dataChange/provider/src/main/java/org/onap/ccsdk/sli/northbound/DataChangeClient.java +++ b/dataChange/provider/src/main/java/org/onap/ccsdk/sli/northbound/DataChangeClient.java @@ -42,7 +42,7 @@ public class DataChangeClient { public boolean hasGraph(String module, String rpc, String version, String mode) throws SvcLogicException { - return(svcLogicService.hasGraph(module, rpc, version, mode)); + return svcLogicService.hasGraph(module, rpc, version, mode); } public Properties execute(String module, String rpc, String version, String mode, DataChangeNotificationOutputBuilder serviceData) @@ -56,22 +56,23 @@ public class DataChangeClient { public Properties execute(String module, String rpc, String version, String mode, DataChangeNotificationOutputBuilder serviceData, Properties parms) throws SvcLogicException { - parms = MdsalHelper.toProperties(parms, serviceData); + Properties localProp; + localProp = MdsalHelper.toProperties(parms, serviceData); if (LOG.isDebugEnabled()) { LOG.debug("Parameters passed to SLI"); - for (Object key : parms.keySet()) { + for (Object key : localProp.keySet()) { String parmName = (String) key; - String parmValue = parms.getProperty(parmName); + String parmValue = localProp.getProperty(parmName); LOG.debug(parmName+" = "+parmValue); } } - Properties respProps = svcLogicService.execute(module, rpc, version, mode, parms); + Properties respProps = svcLogicService.execute(module, rpc, version, mode, localProp); if (LOG.isDebugEnabled()) { @@ -86,12 +87,12 @@ public class DataChangeClient { } } if ("failure".equalsIgnoreCase(respProps.getProperty("SvcLogic.status"))) { - return (respProps); + return respProps; } MdsalHelper.toBuilder(respProps, serviceData); - return (respProps); + return respProps; } } diff --git a/dataChange/provider/src/main/java/org/onap/ccsdk/sli/northbound/DataChangeProvider.java b/dataChange/provider/src/main/java/org/onap/ccsdk/sli/northbound/DataChangeProvider.java index 2b45cc7d7..91482d852 100644 --- a/dataChange/provider/src/main/java/org/onap/ccsdk/sli/northbound/DataChangeProvider.java +++ b/dataChange/provider/src/main/java/org/onap/ccsdk/sli/northbound/DataChangeProvider.java @@ -121,15 +121,13 @@ public class DataChangeProvider implements AutoCloseable, DataChangeService { MdsalHelper.toProperties(parms, inputBuilder.build()); // Call SLI sync method - Properties respProps = null; - try { if (dataChangeClient.hasGraph("DataChange", SVC_OPERATION , null, "sync")) { try { - respProps = dataChangeClient.execute("DataChange", SVC_OPERATION, null, "sync", serviceDataBuilder, parms); + dataChangeClient.execute("DataChange", SVC_OPERATION, null, "sync", serviceDataBuilder, parms); } catch (Exception e) { |