From 6ad41e3ccd398a2721f41ad61c80b7bb03f7d127 Mon Sep 17 00:00:00 2001 From: Ittay Stern Date: Mon, 31 Dec 2018 17:21:27 +0200 Subject: Merge from ECOMP's repository Main Features -------------- - Async-Instantiation jobs mechanism major update; still WIP (package `org.onap.vid.job`) - New features in View/Edit: Activate fabric configuration; show related networks; soft delete - Support AAI service-tree traversal (`AAIServiceTree`) - In-memory cache for SDC models and certain A&AI queries (`CacheProviderWithLoadingCache`) - Upgrade TOSCA Parser and add parsing options; fix malformed TOSCA models - Resolve Cloud-Owner values for MSO - Pass X-ONAP headers to MSO Infrastructure -------------- - Remove codehaus' jackson mapper; use soley fasterxml 2.9.7 - Surefire invokes both TestNG and JUnit tests - Support Kotlin source files - AaiController2 which handles errors in a "Spring manner" - Inline generated-sources and remove jsonschema2pojo Quality -------- - Cumulative bug fixes (A&AI API, UI timeouts, and many more) - Many Sonar issues cleaned-up - Some unused classes removed - Minor changes in vid-automation project, allowing some API verification to run Hard Merges ------------ - HTTP Clients (MSO, A&AI, WebConfig, OutgoingRequestHeadersTest) - Moved `package org.onap.vid.controllers` to `controller`, without plural -- just to keep semantic sync with ECOMP. Reference commit in ECOMP: 3d1141625 Issue-ID: VID-378 Change-Id: I9c8d1e74caa41815891d441fc0760bb5f29c5788 Signed-off-by: Ittay Stern --- .../java/org/onap/vid/model/NewServiceModel.java | 91 ++++++---------------- 1 file changed, 25 insertions(+), 66 deletions(-) (limited to 'vid-app-common/src/main/java/org/onap/vid/model/NewServiceModel.java') diff --git a/vid-app-common/src/main/java/org/onap/vid/model/NewServiceModel.java b/vid-app-common/src/main/java/org/onap/vid/model/NewServiceModel.java index e55ba4a4e..1cc6a02f1 100644 --- a/vid-app-common/src/main/java/org/onap/vid/model/NewServiceModel.java +++ b/vid-app-common/src/main/java/org/onap/vid/model/NewServiceModel.java @@ -20,27 +20,18 @@ package org.onap.vid.model; -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.HashMap; -import java.util.Map; -import java.util.Map.Entry; - import org.onap.vid.asdc.beans.tosca.Group; import org.onap.vid.asdc.beans.tosca.ToscaModel; -import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.onap.vid.properties.VidProperties; + +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; /** * The Class ServiceModel. */ public class NewServiceModel { - - /** The Constant LOG. */ - private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(NewServiceModel.class); - - /** The Constant dateFormat. */ - final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS"); /** The service. */ private Service service; @@ -63,12 +54,15 @@ public class NewServiceModel { private Map configurations; + private Map fabricConfigurations; + private Map serviceProxies; private Map pnfs; private Map collectionResource; + private Map vnfGroups; /** * Instantiates a new service model. @@ -189,6 +183,14 @@ public class NewServiceModel { this.collectionResource = collectionResource; } + public Map getFabricConfigurations() { + return fabricConfigurations; + } + + public void setFabricConfigurations(Map fabricConfigurations) { + this.fabricConfigurations = fabricConfigurations; + } + /** * Extract service. * @@ -211,15 +213,14 @@ public class NewServiceModel { //THIS IS A TEMPORARY FIX, AT SOME POINT UNCOMMENT ME //service.setVersion(serviceToscaModel.getMetadata().getVersion()); service.setVersion(asdcServiceMetadata.getVersion()); - return service; } public static void extractGroups (ToscaModel serviceToscaModel,NewServiceModel 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 (); + final Map vfModules = new HashMap<> (); + final Map volumeGroups = new HashMap<> (); String asdcModelNamespace = VidProperties.getAsdcModelNamespace(); String vfModuleTag = asdcModelNamespace + ModelConstants.VF_MODULE; @@ -243,57 +244,15 @@ public class NewServiceModel { serviceModel.setVolumeGroups (volumeGroups); } + + public Map getVnfGroups() { + return vnfGroups; + } + + public void setVnfGroups(Map vnfGroups) { + this.vnfGroups = vnfGroups; + } /** * Populate the vf modules and volume groups that we may have under the service level under each VNF. */ -// public void associateGroups() { -// String methodName = "associateGroups()"; -// LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " start"); -// // go through the vnfs, get the vnf normalized name and look for a vf module with a customization name that starts -// // with vnf + ".." -// String vnfCustomizationName = null; -// String normalizedVnfCustomizationName = null; -// String vfModuleCustomizationName = null; -// NewVNF tmpVnf = null; -// -// if ( ( getVnfs() != null ) && (!(getVnfs().isEmpty())) ) { -// for (Entry vnfComponent : getVnfs().entrySet()) { -// vnfCustomizationName = vnfComponent.getValue().getModelCustomizationName(); -// normalizedVnfCustomizationName = VNF.normalizeName(vnfCustomizationName); -// -// LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + -// " VNF customizationName=" + vnfCustomizationName + "normalized customization name=" + normalizedVnfCustomizationName); -// -// // now check to see if there is a vf module with customization name that starts with normalizedVnfCustomizationName -// -// if (( getVfModules() != null ) && (!(getVfModules().isEmpty()))) { -// for (Entry vfModuleComponent : getVfModules().entrySet()) { -// vfModuleCustomizationName = vfModuleComponent.getValue().getModelCustomizationName(); -// -// LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + -// " VF Module customizationName=" + vfModuleCustomizationName ); -// if ( vfModuleCustomizationName.startsWith(normalizedVnfCustomizationName + ".." )) { -// -// // this vf module belongs to the VNF -// tmpVnf = vnfComponent.getValue(); -// (tmpVnf.getVfModules()).put(vfModuleComponent.getKey(), vfModuleComponent.getValue()); -// -// LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + -// " Associated VF Module customizationName=" + vfModuleComponent.getKey() + " with VNF customization name=" + vnfCustomizationName); -// -// // now find if this vf module has volume groups, if so, find the volume group with the same customization name and put it under the VNF -// if ( vfModuleComponent.getValue().isVolumeGroupAllowed() ) { -// if (( getVolumeGroups() != null ) && (!(getVolumeGroups().isEmpty()))) { -// if (getVolumeGroups().containsKey((vfModuleCustomizationName))) { -// (vnfComponent.getValue().getVolumeGroups()).put(vfModuleCustomizationName, (getVolumeGroups()).get(vfModuleCustomizationName)); -// } -// } -// } -// } -// } -// } -// } -// } - -// } } -- cgit 1.2.3-korg