aboutsummaryrefslogtreecommitdiffstats
path: root/appc-inbound
diff options
context:
space:
mode:
authorburdziak <olaf.burdziakowski@nokia.com>2018-01-23 10:23:16 +0100
committerPatrick Brady <pb071s@att.com>2018-01-25 20:18:37 +0000
commitcd6063f90b296870599a67f6a78e2738dd678463 (patch)
treeac5e65d0c19094e90e54b8a156ffd19fb3453986 /appc-inbound
parent08769ccea1313eb8c5b7329671df543681119998 (diff)
Removed unnecesary checks
Issue-ID: APPC-446 Change-Id: I3d93bcff6c3ed8167dd7f273d90528a76cb2b02f Signed-off-by: burdziak <olaf.burdziakowski@nokia.com>
Diffstat (limited to 'appc-inbound')
-rw-r--r--appc-inbound/appc-artifact-handler/provider/src/main/java/org/onap/appc/artifact/handler/node/ArtifactHandlerNode.java24
1 files changed, 12 insertions, 12 deletions
diff --git a/appc-inbound/appc-artifact-handler/provider/src/main/java/org/onap/appc/artifact/handler/node/ArtifactHandlerNode.java b/appc-inbound/appc-artifact-handler/provider/src/main/java/org/onap/appc/artifact/handler/node/ArtifactHandlerNode.java
index 0c0fa46b0..fb197343e 100644
--- a/appc-inbound/appc-artifact-handler/provider/src/main/java/org/onap/appc/artifact/handler/node/ArtifactHandlerNode.java
+++ b/appc-inbound/appc-artifact-handler/provider/src/main/java/org/onap/appc/artifact/handler/node/ArtifactHandlerNode.java
@@ -100,15 +100,17 @@ public class ArtifactHandlerNode implements SvcLogicJavaPlugin {
private static final EELFLogger log = EELFManager.getInstance().getLogger(ArtifactHandlerNode.class);
public void processArtifact(Map<String, String> inParams, SvcLogicContext ctx) throws Exception {
- String responsePrefix = inParams.get("response_prefix");
+ if (inParams == null || inParams.isEmpty())
+ return;
+ String postData = inParams.get("postData");
+ if(postData == null || postData.isEmpty())
+ return;
try {
- if (inParams != null && !inParams.isEmpty() && inParams.get("postData") != null) {
- log.info("Received request for process Artifact with params: " + inParams.toString());
- String postData = inParams.get("postData");
- JSONObject input = new JSONObject(postData).getJSONObject("input");
- responsePrefix = StringUtils.isNotBlank(responsePrefix) ? (responsePrefix + ".") : "";
- storeUpdateSdcArtifacts(input);
- }
+ log.info("Received request for process Artifact with params: " + inParams.toString());
+ JSONObject input = new JSONObject(postData).getJSONObject("input");
+ String responsePrefix = inParams.get("response_prefix");
+ responsePrefix = StringUtils.isNotBlank(responsePrefix) ? (responsePrefix + ".") : "";
+ storeUpdateSdcArtifacts(input);
} catch (Exception e) {
e.printStackTrace();
throw e;
@@ -174,8 +176,7 @@ public class ArtifactHandlerNode implements SvcLogicJavaPlugin {
String toscaContents = null;
ArtifactProcessorImpl toscaGenerator = new ArtifactProcessorImpl();
toscaGenerator.generateArtifact(PDFileContents, toscaStream);
- if (toscaStream != null)
- toscaContents = toscaStream.toString();
+ toscaContents = toscaStream.toString();
log.info("Generated Tosca File : " + toscaContents);
String yangContents = "YANG generation is in Progress";
@@ -199,8 +200,7 @@ public class ArtifactHandlerNode implements SvcLogicJavaPlugin {
OutputStream yangStream = new ByteArrayOutputStream();
YANGGenerator yangGenerator = YANGGeneratorFactory.getYANGGenerator();
yangGenerator.generateYANG(artifactId, toscaContents, yangStream);
- if (yangStream != null)
- yangContents = yangStream.toString();
+ yangContents = yangStream.toString();
if (yangContents != null) {
updateYangContents(artifactId, ahpUtil.escapeSql(yangContents));