diff options
Diffstat (limited to 'src/main/java/org/onap/clamp/clds')
-rw-r--r-- | src/main/java/org/onap/clamp/clds/client/CdsServices.java | 9 | ||||
-rw-r--r-- | src/main/java/org/onap/clamp/clds/tosca/update/execution/cds/ToscaMetadataCdsProcess.java | 12 |
2 files changed, 10 insertions, 11 deletions
diff --git a/src/main/java/org/onap/clamp/clds/client/CdsServices.java b/src/main/java/org/onap/clamp/clds/client/CdsServices.java index b8eb4194..fa15e277 100644 --- a/src/main/java/org/onap/clamp/clds/client/CdsServices.java +++ b/src/main/java/org/onap/clamp/clds/client/CdsServices.java @@ -84,8 +84,11 @@ public class CdsServices { Date startTime = new Date();
LoggingUtils.setTimeContext(startTime, new Date());
return JsonUtils.GSON_JPA_MODEL.fromJson(cdsResponse, CdsBpWorkFlowListResponse.class);
+ } else {
+ logger.error("CDS getBlueprintWorkflowList FAILED");
+ return null;
}
- return null;
+
}
/**
@@ -114,8 +117,10 @@ public class CdsServices { Date startTime = new Date();
LoggingUtils.setTimeContext(startTime, new Date());
return parseCdsResponse(cdsResponse);
+ } else {
+ logger.error("CDS getWorkflowInputProperties FAILED");
+ return null;
}
- return null;
}
protected JsonObject parseCdsResponse(String response) {
diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/execution/cds/ToscaMetadataCdsProcess.java b/src/main/java/org/onap/clamp/clds/tosca/update/execution/cds/ToscaMetadataCdsProcess.java index c92cad1f..94a477fe 100644 --- a/src/main/java/org/onap/clamp/clds/tosca/update/execution/cds/ToscaMetadataCdsProcess.java +++ b/src/main/java/org/onap/clamp/clds/tosca/update/execution/cds/ToscaMetadataCdsProcess.java @@ -28,23 +28,16 @@ import static org.onap.clamp.clds.tosca.ToscaSchemaConstants.TYPE; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; - import java.util.Map; import java.util.Set; - import org.onap.clamp.clds.tosca.update.execution.ToscaMetadataProcess; import org.onap.clamp.loop.service.Service; -import org.onap.clamp.tosca.DictionaryService; -import org.springframework.beans.factory.annotation.Autowired; /** * This class is there to add the JsonObject for CDS in the json Schema according to what is found in the Tosca model. */ public class ToscaMetadataCdsProcess extends ToscaMetadataProcess { - @Autowired - private DictionaryService dictionaryService; - @Override public void executeProcess(String parameters, JsonObject childObject, Service serviceModel) { switch (parameters) { @@ -59,6 +52,7 @@ public class ToscaMetadataCdsProcess extends ToscaMetadataProcess { case "operation": generateOperation(childObject, serviceModel); break; + default: } } @@ -83,7 +77,7 @@ public class ToscaMetadataCdsProcess extends ToscaMetadataProcess { .entrySet()) { JsonObject controllerProperties = entry.getValue().getAsJsonObject() .getAsJsonObject("controllerProperties"); - if (controllerProperties != null) { + if (controllerProperties != null && controllerProperties.getAsJsonObject("workflows") != null) { for (String workflowsEntry : controllerProperties.getAsJsonObject("workflows").keySet()) { schemaEnum.add(workflowsEntry); schemaTitle.add(workflowsEntry + " (CDS operation)"); @@ -107,7 +101,7 @@ public class ToscaMetadataCdsProcess extends ToscaMetadataProcess { .entrySet()) { JsonObject controllerProperties = entry.getValue().getAsJsonObject() .getAsJsonObject("controllerProperties"); - if (controllerProperties != null) { + if (controllerProperties != null && controllerProperties.getAsJsonObject("workflows") != null) { for (Map.Entry<String, JsonElement> workflowsEntry : controllerProperties.getAsJsonObject("workflows") .entrySet()) { JsonObject obj = new JsonObject(); |