summaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-tosca-lib/src
diff options
context:
space:
mode:
Diffstat (limited to 'openecomp-be/lib/openecomp-tosca-lib/src')
-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)){