2 * Copyright © 2016-2018 European Support Limited
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package org.onap.sdc.tosca.datatypes.model;
19 import org.apache.commons.collections4.MapUtils;
20 import org.onap.sdc.tosca.datatypes.model.heatextend.AnnotationType;
22 import java.util.HashMap;
23 import java.util.List;
27 public class ServiceTemplate implements Template {
29 private String tosca_definitions_version;
30 private Map<String, String> metadata;
31 private Object dsl_definitions;
32 private Map<String, Repository> repositories;
33 private String description;
34 private List<Map<String, Import>> imports;
35 private Map<String, ArtifactType> artifact_types;
36 private Map<String, DataType> data_types;
37 private Map<String, CapabilityType> capability_types;
38 private Map<String, Object> interface_types;
39 private Map<String, RelationshipType> relationship_types;
40 private Map<String, NodeType> node_types;
41 private Map<String, GroupType> group_types;
42 private Map<String, PolicyType> policy_types;
43 private Map<String, AnnotationType> annotation_types;
44 private TopologyTemplate topology_template;
46 public String getTosca_definitions_version() {
47 return tosca_definitions_version;
50 public void setTosca_definitions_version(String tosca_definitions_version) {
51 this.tosca_definitions_version = tosca_definitions_version;
54 public Map<String, String> getMetadata() {
58 public void setMetadata(Map<String, String> metadata) {
59 this.metadata = metadata;
62 public Object getDsl_definitions() {
63 return dsl_definitions;
66 public void setDsl_definitions(Object dsl_definitions) {
67 this.dsl_definitions = dsl_definitions;
70 public Map<String, Repository> getRepositories() {
74 public void setRepositories(
75 Map<String, Repository> repositories) {
76 this.repositories = repositories;
79 public String getDescription() {
83 public void setDescription(String description) {
84 this.description = description;
87 public List<Map<String, Import>> getImports() {
91 public void setImports(
92 List<Map<String, Import>> imports) {
93 this.imports = imports;
96 public Map<String, ArtifactType> getArtifact_types() {
97 return artifact_types;
100 public void setArtifact_types(Map<String, ArtifactType> artifact_types) {
101 this.artifact_types = artifact_types;
104 public Map<String, DataType> getData_types() {
108 public void setData_types(Map<String, DataType> data_types) {
109 this.data_types = data_types;
112 public Map<String, CapabilityType> getCapability_types() {
113 return capability_types;
116 public void setCapability_types(Map<String, CapabilityType> capability_types) {
117 this.capability_types = capability_types;
120 public Map<String, RelationshipType> getRelationship_types() {
121 return relationship_types;
124 public void setRelationship_types(Map<String, RelationshipType> relationship_types) {
125 this.relationship_types = relationship_types;
128 public Map<String, NodeType> getNode_types() {
132 public void setNode_types(Map<String, NodeType> node_types) {
133 this.node_types = node_types;
136 public Map<String, GroupType> getGroup_types() {
140 public void setGroup_types(Map<String, GroupType> group_types) {
141 this.group_types = group_types;
144 public Map<String, Object> getInterface_types() {
145 return interface_types;
148 public void setInterface_types(Map<String, Object> interface_types) {
149 this.interface_types = interface_types;
152 public void addInterfaceType(String interfaceKey, InterfaceType interfaceType) {
153 if (MapUtils.isEmpty(this.interface_types)) {
154 this.interface_types = new HashMap<>();
157 this.interface_types.put(interfaceKey, interfaceType);
160 public Map<String, PolicyType> getPolicy_types() {
164 public void setPolicy_types(Map<String, PolicyType> policy_types) {
165 this.policy_types = policy_types;
168 public TopologyTemplate getTopology_template() {
169 return topology_template;
172 public void setTopology_template(TopologyTemplate topology_template) {
173 this.topology_template = topology_template;
176 public Map<String, AnnotationType> getAnnotation_types() {
177 return annotation_types;
180 public void setAnnotation_types(Map<String, AnnotationType> annotation_types) {
181 this.annotation_types = annotation_types;