aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-tosca-lib/src/main
diff options
context:
space:
mode:
authorshrek2000 <orenkle@amdocs.com>2017-09-11 15:45:37 +0300
committershrek2000 <orenkle@amdocs.com>2017-09-12 10:38:35 +0300
commitc8a540b3c234449163f6fb1899807bba951113b4 (patch)
treea8aae0dd0f6a0feb27369914e9e3fa321740e7ed /openecomp-be/lib/openecomp-tosca-lib/src/main
parent82d454fd3e8c9fdf66517d01a99019a379dbfdb6 (diff)
Create new VSP, onboard from TOSCA file - UI
Change-Id: I018c6d07a4b9ec7e6b1507ab37e2550865423cfe Issue-ID: SDC-230 Signed-off-by: shrek2000 <orenkle@amdocs.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-tosca-lib/src/main')
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaServiceModel.java18
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaAnalyzerServiceImpl.java3
2 files changed, 20 insertions, 1 deletions
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<String, ServiceTemplate> serviceTemplates;
private String entryDefinitionServiceTemplate;
@@ -54,6 +55,15 @@ public class ToscaServiceModel implements AsdcModel {
this.entryDefinitionServiceTemplate = entryDefinitionServiceTemplate;
}
+ public ToscaServiceModel(FileContentHandler artifactFiles,
+ FileContentHandler externalFiles,
+ Map<String, ServiceTemplate> 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));