[VID-55] Upgrade Tosca Parser (merge)
[vid.git] / vid-app-common / src / main / java / org / openecomp / vid / model / ServiceModel.java
index 98e6531..8742931 100755 (executable)
@@ -30,11 +30,11 @@ import java.util.Map.Entry;
 import org.openecomp.vid.asdc.beans.tosca.Group;\r
 import org.openecomp.vid.asdc.beans.tosca.ToscaModel;\r
 import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;\r
-import org.openecomp.vid.controller.VidController;\r
 import org.openecomp.vid.properties.VidProperties;\r
 /**\r
  * The Class ServiceModel.\r
  */\r
+@SuppressWarnings("ALL")\r
 public class ServiceModel {\r
 \r
        /** The Constant LOG. */\r
@@ -176,21 +176,22 @@ public class ServiceModel {
 \r
                return service;\r
        }\r
-       public void extractGroups (ToscaModel serviceToscaModel) {\r
+       public static void extractGroups (ToscaModel serviceToscaModel,ServiceModel serviceModel) {\r
                // Get the groups. The groups may duplicate the groups that are in the VNF model and have\r
                // additional data like the VF module customization String>\r
                \r
                final Map<String, VfModule> vfModules = new HashMap<String, VfModule> ();\r
                final Map<String, VolumeGroup> volumeGroups = new HashMap<String, VolumeGroup> ();\r
-       String asdcModelNamespaces[] = VidProperties.getAsdcModelNamespace();\r
-        String[] vfModuleTags = ModelUtil.getTags(asdcModelNamespaces, ModelConstants.VF_MODULE);\r
-    \r
+               \r
+               String asdcModelNamespace = VidProperties.getAsdcModelNamespace();\r
+       String vfModuleTag = asdcModelNamespace + ModelConstants.VF_MODULE;\r
+       \r
                for (Entry<String, Group> component : serviceToscaModel.gettopology_template().getGroups().entrySet()) {\r
                        final Group group = component.getValue();\r
                        final String type = group.getType();\r
                        final String customizationName = component.getKey();\r
                        \r
-                       if ( ModelUtil.isType (type, vfModuleTags) ) {\r
+                       if (type.startsWith(vfModuleTag)) {\r
                                VfModule vfMod = VfModule.extractVfModule(customizationName, group);\r
                                vfModules.put(customizationName, vfMod);\r
                                if ( vfMod.isVolumeGroupAllowed() ) {\r
@@ -200,8 +201,8 @@ public class ServiceModel {
                        }\r
                }\r
                // add this point vfModules and volume groups are disconnected from VNF\r
-               this.setVfModules (vfModules);\r
-               this.setVolumeGroups (volumeGroups);\r
+               serviceModel.setVfModules (vfModules);\r
+               serviceModel.setVolumeGroups (volumeGroups);\r
                \r
        }\r
        /**\r