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 | |
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>
3 files changed, 16 insertions, 16 deletions
diff --git a/asdcApi/provider/src/main/java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiProvider.java b/asdcApi/provider/src/main/java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiProvider.java index cebcb998..ea574096 100644 --- a/asdcApi/provider/src/main/java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiProvider.java +++ b/asdcApi/provider/src/main/java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiProvider.java @@ -301,19 +301,20 @@ public Future<RpcResult<VfLicenseModelUpdateOutput>> vfLicenseModelUpdate(VfLice } VfLicenseModelUpdateInputBuilder inputBuilder = new VfLicenseModelUpdateInputBuilder(input); - input = inputBuilder.build(); + + VfLicenseModelUpdateInput inputVfLic = inputBuilder.build(); String errorMessage = "Success"; String errorCode = "200"; // If this artifact already exists, reject this update - if (artifactVersionExists(input.getArtifactName(), input.getArtifactVersion())) { + if (artifactVersionExists(inputVfLic.getArtifactName(), inputVfLic.getArtifactVersion())) { errorCode = "409"; errorMessage = "Artifact version already exists"; } else { // Translate input object into SLI-consumable properties - LOG.info("Adding INPUT data for "+SVC_OPERATION+" input: " + input); - AsdcApiUtil.toProperties(parms, input); + LOG.info("Adding INPUT data for "+SVC_OPERATION+" input: " + inputVfLic); + AsdcApiUtil.toProperties(parms, inputVfLic); // Call directed graph @@ -356,8 +357,8 @@ public Future<RpcResult<VfLicenseModelUpdateOutput>> vfLicenseModelUpdate(VfLice LOG.info("ASDC update succeeded"); // Update config tree - applyVfLicenseModelUpdate(input); - addArtifactVersion(input.getArtifactName(), input.getArtifactVersion()); + applyVfLicenseModelUpdate(inputVfLic); + addArtifactVersion(inputVfLic.getArtifactName(), inputVfLic.getArtifactVersion()); } else { LOG.info("ASDC update failed ("+errorCode+" : "+errorMessage); 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 4bf85779..959b2b6f 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 2b45cc7d..91482d85 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) { |