summaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-tasks/src/main/java/org/onap
diff options
context:
space:
mode:
authorKalkere Ramesh, Sharan <sk720x@att.com>2020-11-23 08:51:22 -0500
committerKalkere Ramesh, Sharan <sk720x@att.com>2020-11-23 17:25:36 -0500
commit1416bf28ddf51ede1aa4a3adcdf157b75d53b6ac (patch)
tree892ce17922e4e289a0c664c91e837d5c8c8f45bd /bpmn/so-bpmn-tasks/src/main/java/org/onap
parent914b5f591ad46862436896745ed20579788bb074 (diff)
update pojo to have json property and remove constructor
Issue-ID: SO-3399 Change-Id: Ied4baf50f17d5ea6593fb8ac816d799b42ad8565 Signed-off-by: Kalkere Ramesh, Sharan <sk720x@att.com>
Diffstat (limited to 'bpmn/so-bpmn-tasks/src/main/java/org/onap')
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/cnf/CnfAdapterClient.java6
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/AttributeNameValue.java8
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java5
3 files changed, 10 insertions, 9 deletions
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/cnf/CnfAdapterClient.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/cnf/CnfAdapterClient.java
index b74aa9056d..60ad211d7c 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/cnf/CnfAdapterClient.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/cnf/CnfAdapterClient.java
@@ -54,14 +54,14 @@ public class CnfAdapterClient {
@Autowired
private Environment env;
- private static final String INSTANCE_CREATE_PATH = "/api/multicloud-k8s/v1/v1/instance";
+ private static final String INSTANCE_CREATE_PATH = "/api/cnf-adapter/v1/instance";
@Retryable(value = {HttpServerErrorException.class}, maxAttempts = 3, backoff = @Backoff(delay = 3000))
public InstanceResponse createVfModule(InstanceRequest request) throws CnfAdapterClientException {
try {
// String uri = env.getRequiredProperty("mso.cnf.adapter.endpoint"); //TODO: This needs to be added as well
// for configuration
- String uri = "https://localhost:32780"; // TODO: What is the correct uri?
+ String uri = "https://cnf-adapter:8090"; // TODO: What is the correct uri?
String endpoint = UriBuilder.fromUri(uri).path(INSTANCE_CREATE_PATH).build().toString();
HttpEntity<?> entity = getHttpEntity(request);
ResponseEntity<InstanceResponse> result =
@@ -81,7 +81,7 @@ public class CnfAdapterClient {
try {
// String uri = env.getRequiredProperty("mso.cnf.adapter.endpoint"); //TODO: This needs to be added as well
// for configuration
- String uri = "https://localhost:32780"; // TODO: What is the correct uri?
+ String uri = "https://cnf-adapter:8090"; // TODO: What is the correct uri?
String endpoint = UriBuilder.fromUri(uri).path("/api/cnf-adapter/v1/healthcheck").build().toString();
HttpEntity<?> entity = new HttpEntity<>(getHttpHeaders());
ResponseEntity<InstanceResponse> result =
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/AttributeNameValue.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/AttributeNameValue.java
index 6278d48e03..7291b713ca 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/AttributeNameValue.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/AttributeNameValue.java
@@ -21,18 +21,16 @@
package org.onap.so.client.adapter.vnf.mapper;
import java.io.Serializable;
+import com.fasterxml.jackson.annotation.JsonProperty;
public class AttributeNameValue implements Serializable {
private static final long serialVersionUID = -5215028275587848311L;
+ @JsonProperty("attribute_name")
private String attributeName;
+ @JsonProperty("attribute_value")
private transient Object attributeValue;
- public AttributeNameValue(String attributeName, Object attributeValue) {
- this.attributeName = attributeName;
- this.attributeValue = attributeValue;
- }
-
public String getAttributeName() {
return attributeName;
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java
index 59da22f8e1..7c686bd165 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java
@@ -235,7 +235,10 @@ public class VnfAdapterVfModuleObjectMapper {
logger.error("No value tag found for attribute: {}", attributeName);
throw new MissingValueTagException("No value tag found for " + attributeName);
}
- directives.append(new AttributeNameValue(attributeName, attributeValue.toString()));
+ String nameValue = new StringBuilder().append("{\"attribute_name\": \"").append(attributeName)
+ .append("\", \"attribute_value\": \"").append(attributeValue.toString()).append("\"}")
+ .toString();
+ directives.append(nameValue);
if (i < (srcMap.size() - 1 + noOfDirectivesSize))
directives.append(", ");
i++;