summaryrefslogtreecommitdiffstats
path: root/common/src/main/java/org/onap
diff options
context:
space:
mode:
authorBenjamin, Max (mb388a) <mb388a@us.att.com>2018-10-26 15:05:42 -0400
committerBenjamin, Max (mb388a) <mb388a@us.att.com>2018-10-26 15:50:37 -0400
commit959493d3274d2f2749586248cf31ee12b730e2af (patch)
tree77904da6efa6105149f289be3d285a3499d92c80 /common/src/main/java/org/onap
parent373c057bfa82583f615ea46814ad3cdf9ea8d669 (diff)
Bug fixes October 26th
Set non-custom health diagnostic check code to a default value. created custom java serialization for SimpleUri changed property value for cloud-owner in unit test converted aai call to use the AAI Client Correct a JUnit data file to include userParams values that are expected to be set. Set userParams on requestContext to parameters that need to be passed to downstream systems. Change-Id: I3974691875ef967f90a15f076ae27bc0cd76ee8e Issue-ID: SO-1169 Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'common/src/main/java/org/onap')
-rw-r--r--common/src/main/java/org/onap/so/client/aai/entities/uri/AAISimpleUri.java2
-rw-r--r--common/src/main/java/org/onap/so/client/aai/entities/uri/AllottedResourceLookupUri.java1
-rw-r--r--common/src/main/java/org/onap/so/client/aai/entities/uri/NodesUri.java2
-rw-r--r--common/src/main/java/org/onap/so/client/aai/entities/uri/ServiceInstanceUri.java1
-rw-r--r--common/src/main/java/org/onap/so/client/graphinventory/entities/uri/SimpleUri.java30
-rw-r--r--common/src/main/java/org/onap/so/client/sdno/SDNOValidatorImpl.java2
6 files changed, 32 insertions, 6 deletions
diff --git a/common/src/main/java/org/onap/so/client/aai/entities/uri/AAISimpleUri.java b/common/src/main/java/org/onap/so/client/aai/entities/uri/AAISimpleUri.java
index 9b5acc5bee..76413c2594 100644
--- a/common/src/main/java/org/onap/so/client/aai/entities/uri/AAISimpleUri.java
+++ b/common/src/main/java/org/onap/so/client/aai/entities/uri/AAISimpleUri.java
@@ -34,6 +34,8 @@ import org.onap.so.client.graphinventory.entities.uri.SimpleUri;
public class AAISimpleUri extends SimpleUri implements AAIResourceUri {
+ private static final long serialVersionUID = -6397024057188453229L;
+
protected AAISimpleUri(AAIObjectType type, Object... values) {
super(type, values);
diff --git a/common/src/main/java/org/onap/so/client/aai/entities/uri/AllottedResourceLookupUri.java b/common/src/main/java/org/onap/so/client/aai/entities/uri/AllottedResourceLookupUri.java
index 091d0c9e97..329471243b 100644
--- a/common/src/main/java/org/onap/so/client/aai/entities/uri/AllottedResourceLookupUri.java
+++ b/common/src/main/java/org/onap/so/client/aai/entities/uri/AllottedResourceLookupUri.java
@@ -30,6 +30,7 @@ import org.onap.so.client.aai.AAIResourcesClient;
public class AllottedResourceLookupUri extends HttpLookupUri {
+ private static final long serialVersionUID = -9212594383876793188L;
protected AllottedResourceLookupUri(Object... values) {
super(AAIObjectType.ALLOTTED_RESOURCE, values);
}
diff --git a/common/src/main/java/org/onap/so/client/aai/entities/uri/NodesUri.java b/common/src/main/java/org/onap/so/client/aai/entities/uri/NodesUri.java
index 3c9ca0ed7f..6ffc6ecd9b 100644
--- a/common/src/main/java/org/onap/so/client/aai/entities/uri/NodesUri.java
+++ b/common/src/main/java/org/onap/so/client/aai/entities/uri/NodesUri.java
@@ -29,6 +29,8 @@ import org.onap.so.client.graphinventory.GraphInventoryObjectType;
public class NodesUri extends AAISimpleUri {
+ private static final long serialVersionUID = 8818689895730182042L;
+
protected NodesUri(AAIObjectType type, Object... values) {
super(type, values);
}
diff --git a/common/src/main/java/org/onap/so/client/aai/entities/uri/ServiceInstanceUri.java b/common/src/main/java/org/onap/so/client/aai/entities/uri/ServiceInstanceUri.java
index 00a213b264..324193dc84 100644
--- a/common/src/main/java/org/onap/so/client/aai/entities/uri/ServiceInstanceUri.java
+++ b/common/src/main/java/org/onap/so/client/aai/entities/uri/ServiceInstanceUri.java
@@ -30,6 +30,7 @@ import org.onap.so.client.aai.AAIResourcesClient;
public class ServiceInstanceUri extends HttpLookupUri {
+ private static final long serialVersionUID = 2248914170527514548L;
protected ServiceInstanceUri(Object... values) {
super(AAIObjectType.SERVICE_INSTANCE, values);
}
diff --git a/common/src/main/java/org/onap/so/client/graphinventory/entities/uri/SimpleUri.java b/common/src/main/java/org/onap/so/client/graphinventory/entities/uri/SimpleUri.java
index 026f1c3929..874b06e192 100644
--- a/common/src/main/java/org/onap/so/client/graphinventory/entities/uri/SimpleUri.java
+++ b/common/src/main/java/org/onap/so/client/graphinventory/entities/uri/SimpleUri.java
@@ -20,6 +20,10 @@
package org.onap.so.client.graphinventory.entities.uri;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.nio.charset.StandardCharsets;
@@ -29,18 +33,19 @@ import java.util.Map;
import javax.ws.rs.core.UriBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
-import org.onap.so.client.graphinventory.Format;
import org.onap.so.client.aai.entities.uri.AAIUri;
-import org.onap.so.client.graphinventory.entities.uri.Depth;
-import org.onap.so.client.graphinventory.entities.uri.parsers.UriParser;
-import org.onap.so.client.graphinventory.entities.uri.parsers.UriParserSpringImpl;
+import org.onap.so.client.graphinventory.Format;
import org.onap.so.client.graphinventory.GraphInventoryObjectPlurals;
import org.onap.so.client.graphinventory.GraphInventoryObjectType;
+import org.onap.so.client.graphinventory.entities.uri.parsers.UriParser;
+import org.onap.so.client.graphinventory.entities.uri.parsers.UriParserSpringImpl;
import org.springframework.web.util.UriUtils;
-public class SimpleUri implements GraphInventoryResourceUri {
+public class SimpleUri implements GraphInventoryResourceUri, Serializable {
- protected UriBuilder internalURI;
+ private static final long serialVersionUID = -337701171277616439L;
+
+ protected transient UriBuilder internalURI;
protected final static String relationshipAPI = "/relationship-list/relationship";
protected final static String relatedTo = "/related-to";
protected final Object[] values;
@@ -89,6 +94,9 @@ public class SimpleUri implements GraphInventoryResourceUri {
this.values = childValues;
}
+ protected void setInternalURI(UriBuilder builder) {
+ this.internalURI = builder;
+ }
@Override
public SimpleUri relationshipAPI() {
this.internalURI = internalURI.path(relationshipAPI);
@@ -236,4 +244,14 @@ public class SimpleUri implements GraphInventoryResourceUri {
return type.uriTemplate();
}
+ private void writeObject(ObjectOutputStream oos) throws IOException {
+ oos.defaultWriteObject();
+ oos.writeUTF(this.internalURI.toTemplate());
+ }
+
+ private void readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException {
+ ois.defaultReadObject();
+ String uri = ois.readUTF();
+ this.setInternalURI(UriBuilder.fromUri(uri));
+ }
}
diff --git a/common/src/main/java/org/onap/so/client/sdno/SDNOValidatorImpl.java b/common/src/main/java/org/onap/so/client/sdno/SDNOValidatorImpl.java
index be79c8b927..b11003ed1e 100644
--- a/common/src/main/java/org/onap/so/client/sdno/SDNOValidatorImpl.java
+++ b/common/src/main/java/org/onap/so/client/sdno/SDNOValidatorImpl.java
@@ -47,6 +47,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
public class SDNOValidatorImpl implements SDNOValidator {
private final static String clientName = "MSO";
+ private final static String HEALTH_DIAGNOSTIC_CODE_DEFAULT = "default";
@Override
public boolean healthDiagnostic(String vnfId, UUID uuid, String requestingUserId) throws IOException, Exception {
@@ -99,6 +100,7 @@ public class SDNOValidatorImpl implements SDNOValidator {
request.setRequestNodeIp(vnf.getIpv4OamAddress()); //generic-vnf oam ip
request.setRequestUserId(requestingUserId); //mech id?
request.setRequestId(uuid.toString()); //something to identify this request by for polling
+ request.setHealthDiagnosticCode(HEALTH_DIAGNOSTIC_CODE_DEFAULT);
input.setRequestHealthDiagnostic(request);