aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/MSOCoreBPMN
diff options
context:
space:
mode:
authorMarcus G K Williams <marcus.williams@intel.com>2018-03-28 16:26:11 -0700
committerMarcus Williams <marcus.williams@intel.com>2018-04-09 16:20:39 +0000
commit22a25ae0b0690c5b26f949cd0d5bc7079cf05d2a (patch)
tree91b69438d2cfd386105021ed6413105489ae7aef /bpmn/MSOCoreBPMN
parent955768f7bf4520fb8b9120121251f9537b260db6 (diff)
Bug Fix - OOF api updates processing flavor-label
Additional API interactions were added to OOF response post API freeze that enable core HPA functionality. This patch updates the processsing of the API reponse to process additional flavor parameters. Issue-ID: SO-408 Change-Id: I1656a7ba955ab41c57b7a3e07a3d0cc38b16e2fa Signed-off-by: Marcus G K Williams <marcus.williams@intel.com>
Diffstat (limited to 'bpmn/MSOCoreBPMN')
-rw-r--r--bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/domain/CloudFlavor.java55
-rw-r--r--bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/domain/HomingSolution.java12
-rw-r--r--bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/json/JsonUtils.java2
3 files changed, 68 insertions, 1 deletions
diff --git a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/domain/CloudFlavor.java b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/domain/CloudFlavor.java
new file mode 100644
index 0000000000..100d70e1b2
--- /dev/null
+++ b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/domain/CloudFlavor.java
@@ -0,0 +1,55 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2018 Intel Corp. Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.bpmn.core.domain;
+
+import java.io.Serializable;
+
+/**
+ * Stores Cloud Flavor information and is an attribute
+ * of a <class>HomingSolution</class>
+ *
+ */
+public class CloudFlavor extends JsonWrapper implements Serializable {
+ private String flavorLabel;
+ private String flavor;
+
+ public CloudFlavor (String flavorLabel, String flavor){
+ this.flavorLabel = flavorLabel;
+ this.flavor = flavor;
+ }
+
+ public String getFlavorLabel() {
+ return flavorLabel;
+ }
+
+ public void setFlavorLabel(String flavorLabel) {
+ this.flavorLabel = flavorLabel;
+ }
+
+ public String getFlavor() {
+ return flavor;
+ }
+
+ public void setFlavor(String flavor) {
+ this.flavor = flavor;
+ }
+
+}
diff --git a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/domain/HomingSolution.java b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/domain/HomingSolution.java
index 611c8dfff9..f0193bc1c3 100644
--- a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/domain/HomingSolution.java
+++ b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/domain/HomingSolution.java
@@ -45,6 +45,7 @@ public class HomingSolution extends JsonWrapper implements Serializable {
private String aicVersion;
private String tenant;
private VnfResource vnf;
+ private List<CloudFlavor> flavors;
private License license = new License();
@@ -126,6 +127,17 @@ public class HomingSolution extends JsonWrapper implements Serializable {
this.vnf = vnf;
}
+ /**
+ * @return a map<string, string> key is label name, value is any flavor
+ */
+ public List<CloudFlavor> getFlavors() {
+ return flavors;
+ }
+
+ public void setFlavors(List<CloudFlavor> flavors) {
+ this.flavors = flavors;
+ }
+
public License getLicense() {
return license;
}
diff --git a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/json/JsonUtils.java b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/json/JsonUtils.java
index 79b9239015..1869b930f0 100644
--- a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/json/JsonUtils.java
+++ b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/json/JsonUtils.java
@@ -931,7 +931,7 @@ public class JsonUtils {
for (int i = 0; i < arr.length(); i++){
JSONObject jo = arr.getJSONObject(i);
String key = jo.getString(keyNode);
- String value =jo.getString(valueNode);
+ String value = jo.getString(valueNode);
map.put(key, value);
}
msoLogger.debug("Outgoing Map is: " + map);