summaryrefslogtreecommitdiffstats
path: root/appc-inbound/appc-artifact-handler/provider/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'appc-inbound/appc-artifact-handler/provider/src/main')
-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));