diff options
Diffstat (limited to 'common/src/main/java/org')
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); |