Implement 'Update Service by importing Tosca Template'-story
[sdc.git] / catalog-be / src / main / java / org / openecomp / sdc / be / tosca / model / ToscaNodeTemplate.java
index c27944e..eb34732 100644 (file)
@@ -7,9 +7,9 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * limitations under the License.
  * ============LICENSE_END=========================================================
  */
-
 package org.openecomp.sdc.be.tosca.model;
 
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections.MapUtils;
+
+@Getter
+@Setter
+@NoArgsConstructor
 public class ToscaNodeTemplate {
+
     private String type;
-    private ToscaMetadata metadata;
+    private List<Object> occurrences;
+    private Map<String, String> instance_count;
+    private List<String> directives;
+    private Map<String, Object> metadata;
     private String description;
     private Map<String, Object> properties;
+    private Map<String, Object> attributes;
     private List<Map<String, ToscaTemplateRequirement>> requirements;
     private Map<String, ToscaTemplateCapability> capabilities;
+    private Map<String, ToscaTemplateArtifact> artifacts;
+    private NodeFilter node_filter;
+    private Map<String, Object> interfaces;
 
-    public String getType() {
-        return type;
-    }
-
-    public void setType(String type) {
-        this.type = type;
-    }
-
-    public Map<String, Object> getProperties() {
-        return properties;
-    }
-
-    public void setProperties(Map<String, Object> properties) {
-        this.properties = properties;
-    }
-
-    public List<Map<String, ToscaTemplateRequirement>> getRequirements() {
-        return requirements;
+    public void setDirectives(List<String> directives) {
+        this.directives = CollectionUtils.isEmpty(directives) ? null : directives;
     }
 
-    public void setRequirements(List<Map<String, ToscaTemplateRequirement>> requirements) {
-        this.requirements = requirements;
+    public void addInterface(String interfaceName, Object interfaceDataDefinition) {
+        if (MapUtils.isEmpty(this.interfaces)) {
+            this.interfaces = new HashMap<>();
+        }
+        this.interfaces.put(interfaceName, interfaceDataDefinition);
     }
-
-    public Map<String, ToscaTemplateCapability> getCapabilities() {
-        return capabilities;
-    }
-
-    public void setCapabilities(Map<String, ToscaTemplateCapability> capabilities) {
-        this.capabilities = capabilities;
-    }
-
-    public ToscaMetadata getMetadata() {
-        return metadata;
-    }
-
-    public void setMetadata(ToscaMetadata metadata) {
-        this.metadata = metadata;
-    }
-
-  public String getDescription() {
-    return description;
-  }
-
-  public void setDescription(String description) {
-    this.description = description;
-  }
 }