From 63bee11f255fcd2cc39a3d87c208aa6e517a8f85 Mon Sep 17 00:00:00 2001 From: "Benjamin, Max (mb388a)" Date: Sun, 20 Jan 2019 16:10:18 -0500 Subject: Bug fixes from AT&T January 20th sorted vfmodules by base last for negative action reqs store Response in execution as String on network delete added functionality to skip rollback based on flag # Conflicts: # bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflo w/tasks/WorkflowAction.java require XML in the header for delete network request Update APP-C LCM Client library version to 1.7.0. replaced wiremock style test with mockito test Handle AAIClient Exps in CreateCustomerV1 getServiceInstance() changed default status code to be configurable Replace vnfType by nfRole in the healthcheck request to SDNO. updated error messages in sdnc handler and flow status updated flow status message on completion of flow Send GenericVnf object for AAI VNF update for vnf-api updates Add a JUnit test file for SDNOValidatorImpl.java Set nodeType on the inner SDNO request as per update from SDNO. updated rollbackToAssigned logic to remove unassign flows updated sdnc handler error message for client error added exception handling for httpclienterror in sdnc out map workflow exception so error is reported throws sdnc error message on bad response from sdnc add catalog entries for TRANSPORT service delete flows change script number that was duplicate add find method to NorthBoundRequestRepository include serviceType in hash code use asterisk for all non-TRANSPORT flow db entries alacart true, rm not needed transport srvc model steps correct insert query syntax for orchestration_flow support serviceType (TRANSPORT) process flow fix SDNCAdapterException causing no callback to bpmn use JsonAlias for alternate case when deserializing GRM client will accept both "serviceEndPointList" and "ServiceEndPointList" root node in the JSON response. AAIRestClient now uses getSystemName in headers finishtime should not be returned in requeststatus Change-Id: I81a185252b057020f7f36f125c85c3357756da88 Issue-ID: SO-1403 Signed-off-by: Benjamin, Max (mb388a) --- .../java/org/onap/so/client/aai/AAIRestClient.java | 10 +--------- .../onap/so/client/grm/beans/ServiceEndPointList.java | 12 +++--------- .../org/onap/so/client/sdno/SDNOValidatorImpl.java | 11 ++++++----- .../org/onap/so/serviceinstancebeans/Request.java | 19 +++++++++++++------ .../onap/so/serviceinstancebeans/RequestStatus.java | 9 +-------- 5 files changed, 24 insertions(+), 37 deletions(-) (limited to 'common/src/main/java') diff --git a/common/src/main/java/org/onap/so/client/aai/AAIRestClient.java b/common/src/main/java/org/onap/so/client/aai/AAIRestClient.java index ac6e939e9e..4f235c35f1 100644 --- a/common/src/main/java/org/onap/so/client/aai/AAIRestClient.java +++ b/common/src/main/java/org/onap/so/client/aai/AAIRestClient.java @@ -20,25 +20,17 @@ package org.onap.so.client.aai; -import static org.mockito.Mockito.RETURNS_DEEP_STUBS; - import java.net.URI; -import java.util.List; import java.util.Map; import java.util.Optional; -import java.util.regex.Pattern; import javax.ws.rs.core.Response; import org.onap.so.client.ResponseExceptionMapper; import org.onap.so.client.RestClientSSL; -import org.onap.so.client.graphinventory.exceptions.GraphInventoryPatchDepthExceededException; import org.onap.so.client.policy.CommonObjectMapperProvider; -import org.onap.so.jsonpath.JsonPathUtil; import org.onap.so.utils.TargetEntity; -import com.fasterxml.jackson.core.JsonProcessingException; - public class AAIRestClient extends RestClientSSL { private final AAIProperties aaiProperties; @@ -58,7 +50,7 @@ public class AAIRestClient extends RestClientSSL { @Override protected void initializeHeaderMap(Map headerMap) { - headerMap.put("X-FromAppId", "MSO"); + headerMap.put("X-FromAppId", aaiProperties.getSystemName()); headerMap.put("X-TransactionId", requestId); String auth = aaiProperties.getAuth(); String key = aaiProperties.getKey(); diff --git a/common/src/main/java/org/onap/so/client/grm/beans/ServiceEndPointList.java b/common/src/main/java/org/onap/so/client/grm/beans/ServiceEndPointList.java index 19bbe69cf2..2b7a81d590 100644 --- a/common/src/main/java/org/onap/so/client/grm/beans/ServiceEndPointList.java +++ b/common/src/main/java/org/onap/so/client/grm/beans/ServiceEndPointList.java @@ -22,27 +22,21 @@ package org.onap.so.client.grm.beans; import java.util.List; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonAlias; import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; @JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonPropertyOrder({ "serviceEndPointList" }) +//@JsonIgnoreProperties(ignoreUnknown = true) public class ServiceEndPointList { - @JsonProperty("serviceEndPointList") + @JsonAlias("ServiceEndPointList") private List serviceEndPointList = null; - @JsonProperty("serviceEndPointList") public List getServiceEndPointList() { return serviceEndPointList; } - @JsonProperty("serviceEndPointList") public void setServiceEndPointList(List serviceEndPointList) { this.serviceEndPointList = serviceEndPointList; } - } 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 5951928bf4..882a390c7b 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 @@ -77,17 +77,17 @@ public class SDNOValidatorImpl implements SDNOValidator { protected SDNO buildRequestDiagnostic(GenericVnf vnf, UUID uuid, String requestingUserId) { - Optional vnfType; - if (vnf.getVnfType() == null) { - vnfType = Optional.empty(); + Optional nfRole; + if (vnf.getNfRole() == null) { + nfRole = Optional.empty(); } else { - vnfType = Optional.of(vnf.getVnfType()); + nfRole = Optional.of(vnf.getNfRole()); } Input input = new Input(); SDNO parentRequest = new SDNO(); Body body = new Body(); parentRequest.setBody(body); - parentRequest.setNodeType(vnfType.orElse("NONE").toUpperCase()); + parentRequest.setNodeType(nfRole.orElse("NONE").toUpperCase()); parentRequest.setOperation("health-diagnostic"); body.setInput(input); @@ -97,6 +97,7 @@ public class SDNOValidatorImpl implements SDNOValidator { request.setRequestClientName(clientName); request.setRequestNodeName(vnf.getVnfName()); request.setRequestNodeUuid(vnf.getVnfId()); + request.setRequestNodeType(nfRole.orElse("NONE").toUpperCase()); 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 diff --git a/common/src/main/java/org/onap/so/serviceinstancebeans/Request.java b/common/src/main/java/org/onap/so/serviceinstancebeans/Request.java index 8e7e5e945e..d39efddf43 100644 --- a/common/src/main/java/org/onap/so/serviceinstancebeans/Request.java +++ b/common/src/main/java/org/onap/so/serviceinstancebeans/Request.java @@ -22,6 +22,8 @@ package org.onap.so.serviceinstancebeans; import java.util.List; +import org.apache.commons.lang3.builder.ToStringBuilder; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; @@ -31,6 +33,7 @@ public class Request { protected String requestId; protected String startTime; + protected String finishTime; protected String requestScope; protected String requestType; protected RequestDetails requestDetails; @@ -51,6 +54,12 @@ public class Request { public void setStartTime(String startTime) { this.startTime = startTime; } + public String getFinishTime() { + return finishTime; + } + public void setFinishTime(String finishTime) { + this.finishTime = finishTime; + } public String getRequestScope() { return requestScope; } @@ -89,11 +98,9 @@ public class Request { } @Override public String toString() { - return "Request [requestId=" + requestId + ", startTime=" + startTime - + ", requestScope=" + requestScope + ", requestType=" + requestType - + ", requestDetails=" + requestDetails + ", instanceReferences=" + instanceReferences - + ", requestStatus=" + requestStatus + ", requestProcessingData=" + requestProcessingData + "]"; + return new ToStringBuilder(this).append("requestId", requestId).append("startTime", startTime) + .append("finishTime", finishTime).append("requestScope", requestScope).append("requestType", requestType) + .append("requestDetails", requestDetails).append("instanceReferences", instanceReferences) + .append("requestStatus", requestStatus).append("requestProcessingData", requestProcessingData).toString(); } - - } diff --git a/common/src/main/java/org/onap/so/serviceinstancebeans/RequestStatus.java b/common/src/main/java/org/onap/so/serviceinstancebeans/RequestStatus.java index 8adce38ada..4c3597b2c1 100644 --- a/common/src/main/java/org/onap/so/serviceinstancebeans/RequestStatus.java +++ b/common/src/main/java/org/onap/so/serviceinstancebeans/RequestStatus.java @@ -30,7 +30,6 @@ public class RequestStatus { protected String requestState; protected String statusMessage; protected Integer percentProgress; - protected String finishTime; protected String timeStamp; @@ -52,12 +51,6 @@ public class RequestStatus { public void setPercentProgress(Integer percentProgress) { this.percentProgress = percentProgress; } - public String getFinishTime() { - return finishTime; - } - public void setFinishTime(String finishTime) { - this.finishTime = finishTime; - } public String getTimeStamp() { return timeStamp; } @@ -67,6 +60,6 @@ public class RequestStatus { @Override public String toString() { return new ToStringBuilder(this).append("requestState", requestState).append("statusMessage", statusMessage) - .append("percentProgress", percentProgress).append("finishTime", finishTime).append("timeStamp", timeStamp).toString(); + .append("percentProgress", percentProgress).append("timeStamp", timeStamp).toString(); } } -- cgit 1.2.3-korg