aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-tosca-lib
diff options
context:
space:
mode:
authortalio <tali.orenbach@amdocs.com>2018-01-29 11:23:39 +0200
committerVitaly Emporopulo <Vitaliy.Emporopulo@amdocs.com>2018-02-15 14:23:32 +0000
commit924ba9adf027dd4969896cd905a8a41ba4c30655 (patch)
tree035e2ba4ef7100bca4f097d6ca10dbf40cf11aa9 /openecomp-be/lib/openecomp-tosca-lib
parentb4c4dbc6bbcd9995387c0716ee57f620c7a701df (diff)
Add Tosca model healer
create a Tosca model healer for future changes in Tosca structure Change-Id: I3843e4727b6bbb383576ae6a4fb055c5b6fa001f Issue-ID: SDC-973 Signed-off-by: talio <tali.orenbach@amdocs.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-tosca-lib')
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaServiceModel.java17
1 files changed, 6 insertions, 11 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 4512fce159..b1a0976b36 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
@@ -29,13 +29,13 @@ import org.openecomp.sdc.tosca.services.DataModelUtil;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
+import java.util.Optional;
/**
* Tosca service model.
*/
public class ToscaServiceModel implements AsdcModel {
private FileContentHandler artifactFiles;
- private FileContentHandler externalFiles;
private Map<String, ServiceTemplate> serviceTemplates;
private String entryDefinitionServiceTemplate;
@@ -57,16 +57,6 @@ 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.
*
@@ -89,6 +79,11 @@ public class ToscaServiceModel implements AsdcModel {
return Collections.unmodifiableMap(serviceTemplates);
}
+ public Optional<ServiceTemplate> getServiceTemplate(String serviceTemplateName) {
+ return MapUtils.isEmpty(this.serviceTemplates) ? Optional.empty()
+ : Optional.of(this.serviceTemplates.get(serviceTemplateName));
+ }
+
public void addServiceTemplate(String serviceTemplateName,
ServiceTemplate serviceTemplate) {
if(MapUtils.isEmpty(serviceTemplates)){