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 --- .../main/java/org/onap/vid/asdc/beans/tosca/Input.java | 17 +++++++++++++---- .../org/onap/vid/asdc/beans/tosca/InputProperties.java | 3 --- .../org/onap/vid/asdc/beans/tosca/NodeTemplate.java | 4 ++-- .../java/org/onap/vid/asdc/beans/tosca/Property.java | 2 +- .../onap/vid/asdc/beans/tosca/SubstitutionMappings.java | 4 ++-- .../org/onap/vid/asdc/beans/tosca/TopologyTemplate.java | 6 +++--- .../java/org/onap/vid/asdc/beans/tosca/ToscaCsar.java | 2 +- .../java/org/onap/vid/asdc/beans/tosca/ToscaMeta.java | 11 ++++------- 8 files changed, 26 insertions(+), 23 deletions(-) (limited to 'vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca') diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Input.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Input.java index 590284928..d66591c3b 100644 --- a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Input.java +++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Input.java @@ -20,10 +20,11 @@ package org.onap.vid.asdc.beans.tosca; +import com.fasterxml.jackson.annotation.JsonInclude; import org.onap.sdc.toscaparser.api.Property; -import java.util.List; import java.util.ArrayList; +import java.util.List; // TODO: Auto-generated Javadoc /** @@ -36,6 +37,7 @@ public class Input { this.description = input.getDescription(); this._default = input.getDefault(); this.inputProperties = new InputProperties(properties); + this.fromInputName = input.getName(); } /** The type. */ @@ -51,7 +53,9 @@ public class Input { private Input entry_schema; private InputProperties inputProperties; - + + private String fromInputName; + /** The constraints */ private List constraints; @@ -63,12 +67,12 @@ public class Input { private String templateUUID; private String templateInvariantUUID; private String templateCustomizationUUID; - + /** * Instantiates a new input. */ public Input() { - constraints = new ArrayList(); + constraints = new ArrayList<>(); } /** @@ -160,6 +164,11 @@ public class Input { return inputProperties; } + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getFromInputName() { + return fromInputName; + } + public void setInputProperties(InputProperties inputProperties) { this.inputProperties = inputProperties; } diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/InputProperties.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/InputProperties.java index bc2513ea9..c5fe8b90e 100644 --- a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/InputProperties.java +++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/InputProperties.java @@ -17,13 +17,10 @@ public class InputProperties { for(Property property: properties) { if (property.getName().equals("source_type")) { this.sourceType = (String)property.getValue(); - continue; } else if (property.getName().equals("param_name")) { this.paramName = (String)property.getValue(); - continue; } else if (property.getName().equals("vf_module_label")) { this.vfModuleLabel = getPropertyValueAsString(property); - continue; } } } diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/NodeTemplate.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/NodeTemplate.java index 28210b2ec..23c0a1094 100644 --- a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/NodeTemplate.java +++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/NodeTemplate.java @@ -20,8 +20,8 @@ package org.onap.vid.asdc.beans.tosca; -import java.util.Map; import java.util.HashMap; +import java.util.Map; /** * The Class NodeTemplate. @@ -41,7 +41,7 @@ public class NodeTemplate { private Object requirements; public NodeTemplate () { - properties = new HashMap(); + properties = new HashMap<>(); } /** * Gets the type. diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Property.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Property.java index 74b00bdf7..a15c55ff5 100644 --- a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Property.java +++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Property.java @@ -43,7 +43,7 @@ public class Property { /** * Instantiates a new property. */ - Property() {} + private Property() {} /** * Gets the type. diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/SubstitutionMappings.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/SubstitutionMappings.java index 70779c5f2..4ce30239c 100644 --- a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/SubstitutionMappings.java +++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/SubstitutionMappings.java @@ -41,8 +41,8 @@ public class SubstitutionMappings { * Instantiates a new substitution mappings. */ public SubstitutionMappings() { - capabilities = new HashMap (); - requirements = new HashMap (); + capabilities = new HashMap<> (); + requirements = new HashMap<> (); } /** diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/TopologyTemplate.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/TopologyTemplate.java index 70830715e..b24627d1f 100644 --- a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/TopologyTemplate.java +++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/TopologyTemplate.java @@ -45,9 +45,9 @@ public class TopologyTemplate { */ public TopologyTemplate() { substitution_mappings = new SubstitutionMappings(); - inputs = new HashMap (); - node_templates = new HashMap (); - groups = new HashMap (); + inputs = new HashMap<> (); + node_templates = new HashMap<> (); + groups = new HashMap<> (); } /** diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaCsar.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaCsar.java index 678583573..4cf2f7975 100644 --- a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaCsar.java +++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaCsar.java @@ -43,7 +43,7 @@ public class ToscaCsar { private final ToscaModel parent; /** The children. */ - private Collection children = new LinkedList (); + private Collection children = new LinkedList<> (); /** * Instantiates a new builder. diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaMeta.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaMeta.java index a7a6c6296..ad8834015 100644 --- a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaMeta.java +++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaMeta.java @@ -20,6 +20,8 @@ package org.onap.vid.asdc.beans.tosca; +import org.onap.vid.asdc.AsdcCatalogException; + import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; @@ -27,8 +29,6 @@ import java.io.InputStreamReader; import java.util.HashMap; import java.util.Map; -import org.onap.vid.asdc.AsdcCatalogException; - /** * The Class ToscaMeta. */ @@ -45,7 +45,7 @@ public class ToscaMeta { * @throws AsdcCatalogException the asdc catalog exception */ private ToscaMeta(Builder builder) throws IOException, AsdcCatalogException { - metadata = new HashMap (); + metadata = new HashMap<> (); read(builder.inputStream); } @@ -113,10 +113,7 @@ public class ToscaMeta { metadata.put(entry[0], entry[1].substring(1)); } } - } catch (IOException e) { - metadata.clear(); - throw e; - } catch (AsdcCatalogException e) { + } catch (IOException | AsdcCatalogException e) { metadata.clear(); throw e; } -- cgit 1.2.3-korg