From c8a540b3c234449163f6fb1899807bba951113b4 Mon Sep 17 00:00:00 2001 From: shrek2000 Date: Mon, 11 Sep 2017 15:45:37 +0300 Subject: Create new VSP, onboard from TOSCA file - UI Change-Id: I018c6d07a4b9ec7e6b1507ab37e2550865423cfe Issue-ID: SDC-230 Signed-off-by: shrek2000 --- .../sdc/tosca/datatypes/ToscaServiceModel.java | 18 ++++++++++++++++++ .../tosca/services/impl/ToscaAnalyzerServiceImpl.java | 3 ++- 2 files changed, 20 insertions(+), 1 deletion(-) (limited to 'openecomp-be/lib/openecomp-tosca-lib/src/main/java/org') diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaServiceModel.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaServiceModel.java index 0fcaafa1c2..722c286f50 100644 --- a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaServiceModel.java +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaServiceModel.java @@ -33,6 +33,7 @@ import java.util.Map; */ public class ToscaServiceModel implements AsdcModel { private FileContentHandler artifactFiles; + private FileContentHandler externalFiles; private Map serviceTemplates; private String entryDefinitionServiceTemplate; @@ -54,6 +55,15 @@ public class ToscaServiceModel implements AsdcModel { this.entryDefinitionServiceTemplate = entryDefinitionServiceTemplate; } + public ToscaServiceModel(FileContentHandler artifactFiles, + FileContentHandler externalFiles, + Map serviceTemplates, + String entryDefinitionServiceTemplate) { + this.artifactFiles = artifactFiles; + this.externalFiles = externalFiles; + this.serviceTemplates = serviceTemplates; + this.entryDefinitionServiceTemplate = entryDefinitionServiceTemplate; + } /** * Gets artifact files. @@ -113,4 +123,12 @@ public class ToscaServiceModel implements AsdcModel { public static ToscaServiceModel getClonedServiceModel(ToscaServiceModel toscaServiceModel) { return ToscaServiceModel.class.cast(DataModelUtil.getClonedObject(toscaServiceModel)); } + + public FileContentHandler getExternalFiles() { + return externalFiles; + } + + public void setExternalFiles(FileContentHandler externalFiles) { + this.externalFiles = externalFiles; + } } diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaAnalyzerServiceImpl.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaAnalyzerServiceImpl.java index dc2ed6c76b..45e6c3deef 100644 --- a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaAnalyzerServiceImpl.java +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaAnalyzerServiceImpl.java @@ -492,7 +492,8 @@ public class ToscaAnalyzerServiceImpl implements ToscaAnalyzerService { toscaServiceModel.getServiceTemplates().get(fetchFileNameForImport(importFile, serviceTemplate.getMetadata() == null ? null : serviceTemplate.getMetadata().get("filename"))); - if (filesScanned.contains(ToscaUtil.getServiceTemplateFileName(template))) { + if (Objects.isNull(template) || + filesScanned.contains(ToscaUtil.getServiceTemplateFileName(template))) { continue; } else { filesScanned.add(ToscaUtil.getServiceTemplateFileName(template)); -- cgit 1.2.3-korg