From 383d433f5cbb7394a9c335eff7759c9e2126f106 Mon Sep 17 00:00:00 2001 From: root1 Date: Wed, 13 Dec 2017 14:24:43 +0530 Subject: Fixed to improve the Maintainability of code Issue-ID: CCSDK-151 Change-Id: If8bf17dd0e5387855ddbff9198107f334ded59c5 Signed-off-by: SRINIVAS V --- .../onap/ccsdk/sli/northbound/asdcapi/AsdcApiProvider.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'asdcApi/provider/src') 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 cebcb9986..ea5740967 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> 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> 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); -- cgit 1.2.3-korg