diff options
author | 2017-09-04 14:52:07 +0300 | |
---|---|---|
committer | 2017-09-04 14:52:07 +0300 | |
commit | b35670742c728d7d85da2f9c856c51a5889449d6 (patch) | |
tree | 92e544b121b8a47230667f0e0078c188a47dd8eb /vid-app-common/src/main/java/org/openecomp/vid/model/ServiceModel.java | |
parent | 49a483a9b40cb429717ccec69fa99e4908aadbb6 (diff) |
[VID-55] Upgrade Tosca Parser (merge)
Change-Id: I5389f1641ef22df3ed569a154b3c367117c04d04
Signed-off-by: Ofir Sonsino <os0695@att.com>
Diffstat (limited to 'vid-app-common/src/main/java/org/openecomp/vid/model/ServiceModel.java')
-rwxr-xr-x | vid-app-common/src/main/java/org/openecomp/vid/model/ServiceModel.java | 17 |
1 files changed, 9 insertions, 8 deletions
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 98e65316..8742931c 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<String, VfModule> vfModules = new HashMap<String, VfModule> ();
final Map<String, VolumeGroup> volumeGroups = new HashMap<String, VolumeGroup> ();
- String asdcModelNamespaces[] = VidProperties.getAsdcModelNamespace();
- String[] vfModuleTags = ModelUtil.getTags(asdcModelNamespaces, ModelConstants.VF_MODULE);
-
+
+ String asdcModelNamespace = VidProperties.getAsdcModelNamespace();
+ String vfModuleTag = asdcModelNamespace + ModelConstants.VF_MODULE;
+
for (Entry<String, Group> 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);
}
/**
|