X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=vid-app-common%2Fsrc%2Fmain%2Fjava%2Forg%2Fopenecomp%2Fvid%2Fmodel%2FServiceModel.java;h=8742931c69313ff039690f8d3daf47d46d7ff78a;hb=b35670742c728d7d85da2f9c856c51a5889449d6;hp=98e65316b24493967475fb81677a2b7d732eaaa9;hpb=49a483a9b40cb429717ccec69fa99e4908aadbb6;p=vid.git diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/ServiceModel.java b/vid-app-common/src/main/java/org/openecomp/vid/model/ServiceModel.java index 98e65316b..8742931c6 100755 --- a/vid-app-common/src/main/java/org/openecomp/vid/model/ServiceModel.java +++ b/vid-app-common/src/main/java/org/openecomp/vid/model/ServiceModel.java @@ -30,11 +30,11 @@ import java.util.Map.Entry; import org.openecomp.vid.asdc.beans.tosca.Group; import org.openecomp.vid.asdc.beans.tosca.ToscaModel; import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; -import org.openecomp.vid.controller.VidController; import org.openecomp.vid.properties.VidProperties; /** * The Class ServiceModel. */ +@SuppressWarnings("ALL") public class ServiceModel { /** The Constant LOG. */ @@ -176,21 +176,22 @@ public class ServiceModel { return service; } - public void extractGroups (ToscaModel serviceToscaModel) { + public static void extractGroups (ToscaModel serviceToscaModel,ServiceModel serviceModel) { // Get the groups. The groups may duplicate the groups that are in the VNF model and have // additional data like the VF module customization String> final Map vfModules = new HashMap (); final Map volumeGroups = new HashMap (); - String asdcModelNamespaces[] = VidProperties.getAsdcModelNamespace(); - String[] vfModuleTags = ModelUtil.getTags(asdcModelNamespaces, ModelConstants.VF_MODULE); - + + String asdcModelNamespace = VidProperties.getAsdcModelNamespace(); + String vfModuleTag = asdcModelNamespace + ModelConstants.VF_MODULE; + for (Entry component : serviceToscaModel.gettopology_template().getGroups().entrySet()) { final Group group = component.getValue(); final String type = group.getType(); final String customizationName = component.getKey(); - if ( ModelUtil.isType (type, vfModuleTags) ) { + if (type.startsWith(vfModuleTag)) { VfModule vfMod = VfModule.extractVfModule(customizationName, group); vfModules.put(customizationName, vfMod); if ( vfMod.isVolumeGroupAllowed() ) { @@ -200,8 +201,8 @@ public class ServiceModel { } } // add this point vfModules and volume groups are disconnected from VNF - this.setVfModules (vfModules); - this.setVolumeGroups (volumeGroups); + serviceModel.setVfModules (vfModules); + serviceModel.setVolumeGroups (volumeGroups); } /**