Merge "typeCasting issue and useless assignment fix"
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 cebcb99..ea57409 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 @@
}
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 @@
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/asdcApi/provider/src/main/java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiSliClient.java b/asdcApi/provider/src/main/java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiSliClient.java
index 51fdd70..02dc786 100644
--- a/asdcApi/provider/src/main/java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiSliClient.java
+++ b/asdcApi/provider/src/main/java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiSliClient.java
@@ -40,7 +40,7 @@
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);
}
@@ -88,7 +88,7 @@
}
- return (respProps);
+ return respProps;
}
}
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 4bf8577..959b2b6 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 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 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 @@
}
}
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 2b45cc7..91482d8 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 @@
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)
{
diff --git a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncDmaapConsumer.java b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncDmaapConsumer.java
index a51ea7c..2b416e7 100644
--- a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncDmaapConsumer.java
+++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncDmaapConsumer.java
@@ -35,7 +35,6 @@
private static final Logger LOG = LoggerFactory
.getLogger(SdncDmaapConsumer.class);
- private String propertiesPath = "";
private Properties properties = null;
private MRConsumer consumer = null;
private MRConsumerResponse consumerResponse = null;
@@ -44,15 +43,6 @@
private int fetchPause = 5000; // Default pause between fetch - 5 seconds
private int timeout = 15000; // Default timeout - 15 seconds
- public boolean isReady() {
- return ready;
- }
-
-
- public boolean isRunning() {
- return running;
- }
-
public SdncDmaapConsumer() {
}
@@ -61,14 +51,20 @@
init(properties, propertiesPath);
}
+ public boolean isReady() {
+ return ready;
+ }
+
+ public boolean isRunning() {
+ return running;
+ }
+
public String getProperty(String name) {
- return (properties.getProperty(name, ""));
+ return properties.getProperty(name, "");
}
public void init(Properties properties, String propertiesPath) {
- this.propertiesPath = propertiesPath;
-
try (FileInputStream in = new FileInputStream(new File(propertiesPath))) {
LOG.debug("propertiesPath: " + propertiesPath);
diff --git a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncFlatJsonDmaapConsumer.java b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncFlatJsonDmaapConsumer.java
index 1d499a1..06e8ebe 100644
--- a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncFlatJsonDmaapConsumer.java
+++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncFlatJsonDmaapConsumer.java
@@ -124,6 +124,8 @@
private Map<String, String> loadMap(String msgType, String mapDirName) {
Map<String, String> results = new HashMap<>();
+ String dirName = mapDirName;
+
if (mapDirName == null) {
String rootdir = System.getenv(DMAAPLISTENERROOT);
@@ -131,16 +133,16 @@
rootdir = "/opt/app/dmaap-listener";
}
- mapDirName = rootdir + "/lib";
+ dirName = rootdir + "/lib";
}
- String mapFilename = mapDirName + "/" + msgType + ".map";
+ String mapFilename = dirName + "/" + msgType + ".map";
File mapFile = new File(mapFilename);
if (!mapFile.canRead()) {
LOG.error(String.format("Cannot read map file (%s)", mapFilename));
- return (null);
+ return null;
}
try (BufferedReader mapReader = new BufferedReader(new FileReader(mapFile))) {
@@ -160,9 +162,9 @@
mapReader.close();
} catch (Exception e) {
LOG.error("Caught exception reading map " + mapFilename, e);
- return (null);
+ return null;
}
- return (results);
+ return results;
}
}
diff --git a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncOdlConnection.java b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncOdlConnection.java
index a2556b4..78d9c5b 100644
--- a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncOdlConnection.java
+++ b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncOdlConnection.java
@@ -137,7 +137,7 @@
respRdr = new BufferedReader(new InputStreamReader(httpConn.getErrorStream()));
}
- StringBuffer respBuff = new StringBuffer();
+ StringBuilder respBuff = new StringBuilder();
String respLn;
@@ -150,7 +150,7 @@
LOG.info("Response body :\n" + respString);
- return (respString);
+ return respString;
}