vLAN Tagging - Support Tosca Groups
authorSheshukov, Natalia (ns019t) <ns019t@intl.att.com>
Sun, 8 Apr 2018 14:59:18 +0000 (17:59 +0300)
committerSheshukov, Natalia (ns019t) <ns019t@intl.att.com>
Sun, 8 Apr 2018 14:59:18 +0000 (17:59 +0300)
Change-Id: I51838dc8d3f003cdd5e7b5161cdc3e4b04f29442
Issue-ID: SDC-1196
Signed-off-by: Sheshukov, Natalia (ns019t) <ns019t@intl.att.com>
pom.xml
src/main/java/org/onap/sdc/toscaparser/api/Group.java
src/main/java/org/onap/sdc/toscaparser/api/ToscaTemplate.java

diff --git a/pom.xml b/pom.xml
index 680917a..990a7c9 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
 
        <groupId>org.onap.sdc.jtosca</groupId>
        <artifactId>jtosca</artifactId>
-       <version>1.3.3-SNAPSHOT</version>
+       <version>1.3.4-SNAPSHOT</version>
         <name>sdc-jtosca</name>
        <properties>
 
index f678083..d96b4a9 100644 (file)
@@ -87,6 +87,12 @@ public class Group extends EntityTemplate {
                                ", metaData=" + metaData +
                                '}';
        }
+       
+       public int compareTo(Group other){
+               if(this.equals(other))
+                       return 0;
+               return this.getName().compareTo(other.getName()) == 0 ? this.getType().compareTo(other.getType()) : this.getName().compareTo(other.getName());
+       }
 }
 
 /*python
index b06c045..bdf962b 100644 (file)
@@ -89,6 +89,7 @@ public class ToscaTemplate extends Object {
     private ArrayList<NodeTemplate> nodeTemplates;
     private ArrayList<Output> outputs;
        private ArrayList<Policy> policies;
+       private ArrayList<Group> groups;
     private ConcurrentHashMap<String,Object> nestedToscaTplsWithTopology;
     private ArrayList<TopologyTemplate> nestedToscaTemplatesWithTopology;
     private ToscaGraph graph;
@@ -213,6 +214,7 @@ public class ToscaTemplate extends Object {
                 this.nodeTemplates = _nodeTemplates();
                 this.outputs = _outputs();
                 this.policies = _policies();
+                this.groups = _groups();
 //                _handleNestedToscaTemplatesWithTopology();
                                _handleNestedToscaTemplatesWithTopology(topologyTemplate);
                 graph = new ToscaGraph(nodeTemplates);
@@ -313,6 +315,10 @@ public class ToscaTemplate extends Object {
        private ArrayList<Policy> _policies() {
                return topologyTemplate.getPolicies();
        }
+       
+       private ArrayList<Group> _groups() {
+               return topologyTemplate.getGroups();
+       }
 
        /**
         * This method is used to get consolidated custom definitions from all imports
@@ -765,6 +771,10 @@ public class ToscaTemplate extends Object {
                return policies;
        }
        
+       public ArrayList<Group> getGroups() {
+               return groups;
+       }
+       
        public ArrayList<NodeTemplate> getNodeTemplates() {
                return nodeTemplates;
        }