summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/adapter/vnf/MsoRequest.java229
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/AbstractCallbackService.java6
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowAsyncCommonResource.java2
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowResource.java2
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateGenericALaCarteServiceInstance.groovy8
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateServiceInstance.groovy6
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteVfModuleInfraTest.java4
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVfModuleRollbackTest.java2
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVfModuleTest.java2
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteGenericVNFV1/sdncAdapterResponse.xml4
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/SDNCTopologyQueryBRGCallback.xml4
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/SDNCTopologyQueryTXCCallback.xml4
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRG/SDNCTopologyQueryCallback.xml4
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXC/SDNCTopologyQueryCallback.xml4
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyCreateCallback.xml4
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyDeactivateCallback.xml4
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyDeactivateCallbackNotFound.xml2
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyDeleteCallback.xml4
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyUnassignCallback.xml4
-rw-r--r--common/src/main/java/org/openecomp/mso/logger/MsoLogger.java121
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java584
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstancesTest.java22
22 files changed, 556 insertions, 470 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/adapter/vnf/MsoRequest.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/adapter/vnf/MsoRequest.java
index 72f8810655..c3912b48bc 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/adapter/vnf/MsoRequest.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/adapter/vnf/MsoRequest.java
@@ -1,114 +1,115 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T 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.common.adapter.vnf;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlType;
-
-
-/**
- * <p>Java class for msoRequest complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * &lt;complexType name="msoRequest">
- * &lt;complexContent>
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * &lt;sequence>
- * &lt;element name="requestId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- * &lt;element name="serviceInstanceId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- * &lt;/sequence>
- * &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- *
- *
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "msoRequest", propOrder = {
- "requestId",
- "serviceInstanceId"
-})
-public class MsoRequest {
-
- protected String requestId;
- protected String serviceInstanceId;
-
- /**
- * Gets the value of the requestId property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getRequestId() {
- return requestId;
- }
-
- /**
- * Sets the value of the requestId property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setRequestId(String value) {
- this.requestId = value;
- }
-
- /**
- * Gets the value of the serviceInstanceId property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getServiceInstanceId() {
- return serviceInstanceId;
- }
-
- /**
- * Sets the value of the serviceInstanceId property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setServiceInstanceId(String value) {
- this.serviceInstanceId = value;
- }
-
- public String toString() {
- String request = "";
- request =
- "<requestId>"+requestId+"</requestId>" + '\n' +
- "<serviceInstanceId>"+serviceInstanceId+"</serviceInstanceId>";
- return request;
- }
-
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T 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.common.adapter.vnf;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for msoRequest complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="msoRequest">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element name="requestId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ * &lt;element name="serviceInstanceId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ * &lt;/sequence>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "msoRequest", propOrder = {
+ "requestId",
+ "serviceInstanceId"
+})
+public class MsoRequest {
+
+ protected String requestId;
+ protected String serviceInstanceId;
+
+ /**
+ * Gets the value of the requestId property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getRequestId() {
+ return requestId;
+ }
+
+ /**
+ * Sets the value of the requestId property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setRequestId(String value) {
+ this.requestId = value;
+ }
+
+ /**
+ * Gets the value of the serviceInstanceId property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getServiceInstanceId() {
+ return serviceInstanceId;
+ }
+
+ /**
+ * Sets the value of the serviceInstanceId property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setServiceInstanceId(String value) {
+ this.serviceInstanceId = value;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder request = new StringBuilder();
+ request.append("<requestId>"+requestId+"</requestId>");
+ request.append('\n');
+ request.append("<serviceInstanceId>"+serviceInstanceId+"</serviceInstanceId>");
+ return request.toString();
+ }
+
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/AbstractCallbackService.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/AbstractCallbackService.java
index b1d1085b43..c0be8992ef 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/AbstractCallbackService.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/AbstractCallbackService.java
@@ -25,9 +25,9 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import org.camunda.bpm.BpmPlatform;
import org.camunda.bpm.engine.MismatchingMessageCorrelationException;
import org.camunda.bpm.engine.ProcessEngineServices;
+import org.camunda.bpm.engine.ProcessEngines;
import org.camunda.bpm.engine.RuntimeService;
import org.camunda.bpm.engine.runtime.Execution;
import org.camunda.bpm.engine.runtime.MessageCorrelationResult;
@@ -371,7 +371,7 @@ public abstract class AbstractCallbackService {
protected ProcessEngineServices getProcessEngineServices() {
if (pes4junit == null) {
- return BpmPlatform.getDefaultProcessEngine();
+ return ProcessEngines.getProcessEngine("infrastructure");
} else {
return pes4junit;
}
@@ -380,4 +380,4 @@ public abstract class AbstractCallbackService {
public void setProcessEngineServices4junit(ProcessEngineServices pes) {
pes4junit = pes;
}
-} \ No newline at end of file
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowAsyncCommonResource.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowAsyncCommonResource.java
index 249283923a..4534b56efc 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowAsyncCommonResource.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowAsyncCommonResource.java
@@ -27,6 +27,6 @@ import org.camunda.bpm.engine.ProcessEngines;
public class WorkflowAsyncCommonResource extends WorkflowAsyncResource {
protected ProcessEngineServices getProcessEngineServices() {
- return pes4junit.orElse(ProcessEngines.getProcessEngine("common"));
+ return pes4junit.orElse(ProcessEngines.getProcessEngine("infrastructure"));
}
}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowResource.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowResource.java
index 7a537218b3..0521fb4df3 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowResource.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowResource.java
@@ -618,7 +618,7 @@ public class WorkflowResource {
private ProcessEngineServices getProcessEngineServices() {
if (pes4junit == null) {
- return ProcessEngines.getDefaultProcessEngine();
+ return ProcessEngines.getProcessEngine("infrastructure");
} else {
return pes4junit;
}
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateGenericALaCarteServiceInstance.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateGenericALaCarteServiceInstance.groovy
index 9416e6851a..80d714893d 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateGenericALaCarteServiceInstance.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateGenericALaCarteServiceInstance.groovy
@@ -37,6 +37,7 @@ import org.camunda.bpm.engine.runtime.Execution
import org.apache.commons.lang3.*
import org.apache.commons.codec.binary.Base64;
import org.springframework.web.util.UriUtils
+import org.json.JSONException;
/**
* This groovy class supports the <class>CreateGenericALaCarteServiceInstance.bpmn</class> process.
@@ -85,7 +86,12 @@ public class CreateGenericALaCarteServiceInstance extends AbstractServiceTaskPro
execution.setVariable("source", jsonUtil.getJsonValue(siRequest, "requestDetails.requestInfo.source"))
execution.setVariable("serviceInstanceName", jsonUtil.getJsonValue(siRequest, "requestDetails.requestInfo.instanceName"))
execution.setVariable("disableRollback", jsonUtil.getJsonValue(siRequest, "requestDetails.requestInfo.suppressRollback"))
- String productFamilyId = jsonUtil.getJsonValue(siRequest, "requestDetails.requestInfo.productFamilyId")
+ String productFamilyId = null;
+ try {
+ productFamilyId = jsonUtil.getJsonValue(siRequest, "requestDetails.requestInfo.productFamilyId")
+ } catch (JSONException e) {
+ productFamilyId = null;
+ }
if (isBlank(productFamilyId))
{
msg = "Input productFamilyId is null"
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateServiceInstance.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateServiceInstance.groovy
index 0eb16a2d9e..18925d399e 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateServiceInstance.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateServiceInstance.groovy
@@ -257,6 +257,8 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
}
String statusLine = isBlank(oStatus) ? "" : "<orchestration-status>${oStatus}</orchestration-status>"
+ String serviceTypeLine = isBlank(serviceType) ? "" : "<service-type>${serviceType}</service-type>"
+ String serviceRoleLine = isBlank(serviceRole) ? "" : "<service-role>${serviceRole}</service-role>"
AaiUtil aaiUriUtil = new AaiUtil(this)
String aai_uri = aaiUriUtil.getBusinessCustomerUri(execution)
@@ -264,8 +266,8 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
String serviceInstanceData =
"""<service-instance xmlns=\"${namespace}\">
<service-instance-name>${serviceInstanceName}</service-instance-name>
- <service-type>${serviceType}</service-type>
- <service-role>${serviceRole}</service-role>
+ ${serviceTypeLine}
+ ${serviceRoleLine}
${statusLine}
<model-invariant-id>${modelInvariantUuid}</model-invariant-id>
<model-version-id>${modelUuid}</model-version-id>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteVfModuleInfraTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteVfModuleInfraTest.java
index 80ec724630..e89c64e6df 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteVfModuleInfraTest.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteVfModuleInfraTest.java
@@ -89,7 +89,7 @@ public class DeleteVfModuleInfraTest extends WorkflowTest {
"</vfModuleException>" + EOL;
private final String sdncAdapterDeleteCallback =
- "<output xmlns=\"org:openecomp:sdnctl:l3api\">" + EOL +
+ "<output xmlns=\"org:onap:sdnctl:l3api\">" + EOL +
" <svc-request-id>{{REQUEST-ID}}</svc-request-id>" + EOL +
" <ack-final-indicator>Y</ack-final-indicator>" + EOL +
"</output>" + EOL;
@@ -576,4 +576,4 @@ public class DeleteVfModuleInfraTest extends WorkflowTest {
}
-} \ No newline at end of file
+}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVfModuleRollbackTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVfModuleRollbackTest.java
index 18a5e079c8..1d0cb0cd10 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVfModuleRollbackTest.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVfModuleRollbackTest.java
@@ -67,7 +67,7 @@ public class DoCreateVfModuleRollbackTest extends WorkflowTest {
"</vfModuleException>" + EOL;
private final String sdncAdapterDeleteCallback =
- "<output xmlns=\"org:openecomp:sdnctl:l3api\">" + EOL +
+ "<output xmlns=\"org:onap:sdnctl:l3api\">" + EOL +
" <svc-request-id>{{REQUEST-ID}}</svc-request-id>" + EOL +
" <ack-final-indicator>Y</ack-final-indicator>" + EOL +
"</output>" + EOL;
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVfModuleTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVfModuleTest.java
index 488c5329b8..c741dfd2ed 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVfModuleTest.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVfModuleTest.java
@@ -70,7 +70,7 @@ public class DoDeleteVfModuleTest extends WorkflowTest {
"</vfModuleException>" + EOL;
private final String sdncAdapterDeleteCallback =
- "<output xmlns=\"org:openecomp:sdnctl:l3api\">" + EOL +
+ "<output xmlns=\"org:onap:sdnctl:l3api\">" + EOL +
" <svc-request-id>{{REQUEST-ID}}</svc-request-id>" + EOL +
" <ack-final-indicator>Y</ack-final-indicator>" + EOL +
"</output>" + EOL;
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteGenericVNFV1/sdncAdapterResponse.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteGenericVNFV1/sdncAdapterResponse.xml
index 4b3ac855df..5e0b8c6c54 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteGenericVNFV1/sdncAdapterResponse.xml
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteGenericVNFV1/sdncAdapterResponse.xml
@@ -1,7 +1,7 @@
<sdncadapterworkflow:SDNCAdapterWorkflowResponse xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1">
<sdncadapterworkflow:response-data>
<tag0:RequestData xmlns:tag0="http://org.openecomp/workflow/sdnc/adapter/schema/v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">
- &lt;output xmlns="org:openecomp:sdnctl:vnf"&gt;&lt;svc-request-id&gt;1660b8da-0a94-442d-8ed5-ea079e3c67c8&lt;/svc-request-id&gt;&lt;response-code&gt;200&lt;/response-code&gt;&lt;ack-final-indicator&gt;Y&lt;/ack-final-indicator&gt;&lt;vnf-information&gt;&lt;vnf-id&gt;8925b50d-de67-44c1-b984-e7ce7b0f4dae&lt;/vnf-id&gt;&lt;/vnf-information&gt;&lt;service-information&gt;&lt;service-type&gt;a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb&lt;/service-type&gt;&lt;service-instance-id&gt;8925b50d-de67-44c1-b984-e7ce7b0f4dae&lt;/service-instance-id&gt;&lt;subscriber-name&gt;notsurewecare&lt;/subscriber-name&gt;&lt;/service-information&gt;&lt;/output&gt;
+ &lt;output xmlns="org:onap:sdnctl:vnf"&gt;&lt;svc-request-id&gt;1660b8da-0a94-442d-8ed5-ea079e3c67c8&lt;/svc-request-id&gt;&lt;response-code&gt;200&lt;/response-code&gt;&lt;ack-final-indicator&gt;Y&lt;/ack-final-indicator&gt;&lt;vnf-information&gt;&lt;vnf-id&gt;8925b50d-de67-44c1-b984-e7ce7b0f4dae&lt;/vnf-id&gt;&lt;/vnf-information&gt;&lt;service-information&gt;&lt;service-type&gt;a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb&lt;/service-type&gt;&lt;service-instance-id&gt;8925b50d-de67-44c1-b984-e7ce7b0f4dae&lt;/service-instance-id&gt;&lt;subscriber-name&gt;notsurewecare&lt;/subscriber-name&gt;&lt;/service-information&gt;&lt;/output&gt;
</tag0:RequestData>
</sdncadapterworkflow:response-data>
-</sdncadapterworkflow:SDNCAdapterWorkflowResponse> \ No newline at end of file
+</sdncadapterworkflow:SDNCAdapterWorkflowResponse>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/SDNCTopologyQueryBRGCallback.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/SDNCTopologyQueryBRGCallback.xml
index 410ba05e5f..d81b7e8f50 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/SDNCTopologyQueryBRGCallback.xml
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/SDNCTopologyQueryBRGCallback.xml
@@ -1,5 +1,5 @@
-<output xmlns="org:openecomp:sdnctl:vnf">
-<brg-topology xmlns="org:openecomp:sdnctl:vnf">
+<output xmlns="org:onap:sdnctl:vnf">
+<brg-topology xmlns="org:onap:sdnctl:vnf">
<ecomp-model-information>
<model-invariant-uuid>36e20198-c67a-464b-96d0-aaa99eb2639e</model-invariant-uuid>
<model-uuid>5b9b15d0-5dd7-47dc-95b9-0440c340a3ba</model-uuid>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/SDNCTopologyQueryTXCCallback.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/SDNCTopologyQueryTXCCallback.xml
index ac85be4e97..f770ec6aff 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/SDNCTopologyQueryTXCCallback.xml
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/SDNCTopologyQueryTXCCallback.xml
@@ -1,5 +1,5 @@
-<output xmlns="org:openecomp:sdnctl:vnf">
-<tunnelxconn-topology xmlns="org:openecomp:sdnctl:vnf">
+<output xmlns="org:onap:sdnctl:vnf">
+<tunnelxconn-topology xmlns="org:onap:sdnctl:vnf">
<ecomp-model-information>
<model-invariant-uuid>36e20198-c67a-464b-96d0-aaa99eb2639e</model-invariant-uuid>
<model-uuid>5b9b15d0-5dd7-47dc-95b9-0440c340a3ba</model-uuid>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRG/SDNCTopologyQueryCallback.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRG/SDNCTopologyQueryCallback.xml
index 410ba05e5f..d81b7e8f50 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRG/SDNCTopologyQueryCallback.xml
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRG/SDNCTopologyQueryCallback.xml
@@ -1,5 +1,5 @@
-<output xmlns="org:openecomp:sdnctl:vnf">
-<brg-topology xmlns="org:openecomp:sdnctl:vnf">
+<output xmlns="org:onap:sdnctl:vnf">
+<brg-topology xmlns="org:onap:sdnctl:vnf">
<ecomp-model-information>
<model-invariant-uuid>36e20198-c67a-464b-96d0-aaa99eb2639e</model-invariant-uuid>
<model-uuid>5b9b15d0-5dd7-47dc-95b9-0440c340a3ba</model-uuid>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXC/SDNCTopologyQueryCallback.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXC/SDNCTopologyQueryCallback.xml
index ac85be4e97..f770ec6aff 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXC/SDNCTopologyQueryCallback.xml
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXC/SDNCTopologyQueryCallback.xml
@@ -1,5 +1,5 @@
-<output xmlns="org:openecomp:sdnctl:vnf">
-<tunnelxconn-topology xmlns="org:openecomp:sdnctl:vnf">
+<output xmlns="org:onap:sdnctl:vnf">
+<tunnelxconn-topology xmlns="org:onap:sdnctl:vnf">
<ecomp-model-information>
<model-invariant-uuid>36e20198-c67a-464b-96d0-aaa99eb2639e</model-invariant-uuid>
<model-uuid>5b9b15d0-5dd7-47dc-95b9-0440c340a3ba</model-uuid>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyCreateCallback.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyCreateCallback.xml
index 11022f6aec..b579f232b1 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyCreateCallback.xml
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyCreateCallback.xml
@@ -1,4 +1,4 @@
- <output xmlns="org:openecomp:sdnctl:vnf">
+ <output xmlns="org:onap:sdnctl:vnf">
<vnf-information>
<vnf-id>skask</vnf-id>
</vnf-information>
@@ -13,4 +13,4 @@
<instance-reference>
<object-path>restconf/SDNCObjectPath</object-path>
</instance-reference>
- </output> \ No newline at end of file
+ </output>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyDeactivateCallback.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyDeactivateCallback.xml
index acea1459bc..3cf0c81c72 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyDeactivateCallback.xml
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyDeactivateCallback.xml
@@ -1,4 +1,4 @@
-<output xmlns="org:openecomp:sdnctl:vnf">
+<output xmlns="org:onap:sdnctl:vnf">
<vnf-information>
<vnf-id>skask</vnf-id>
</vnf-information>
@@ -10,4 +10,4 @@
<service-instance-id>0</service-instance-id>
<service-type>SDN-MOBILITY</service-type>
</service-information>
-</output> \ No newline at end of file
+</output>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyDeactivateCallbackNotFound.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyDeactivateCallbackNotFound.xml
index bf2b3c0882..df5004edf5 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyDeactivateCallbackNotFound.xml
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyDeactivateCallbackNotFound.xml
@@ -1,4 +1,4 @@
-<output xmlns="org:openecomp:sdnctl:vnf">
+<output xmlns="org:onap:sdnctl:vnf">
<vnf-information>
<vnf-id>skask</vnf-id>
</vnf-information>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyDeleteCallback.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyDeleteCallback.xml
index 11022f6aec..b579f232b1 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyDeleteCallback.xml
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyDeleteCallback.xml
@@ -1,4 +1,4 @@
- <output xmlns="org:openecomp:sdnctl:vnf">
+ <output xmlns="org:onap:sdnctl:vnf">
<vnf-information>
<vnf-id>skask</vnf-id>
</vnf-information>
@@ -13,4 +13,4 @@
<instance-reference>
<object-path>restconf/SDNCObjectPath</object-path>
</instance-reference>
- </output> \ No newline at end of file
+ </output>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyUnassignCallback.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyUnassignCallback.xml
index 11022f6aec..b579f232b1 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyUnassignCallback.xml
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyUnassignCallback.xml
@@ -1,4 +1,4 @@
- <output xmlns="org:openecomp:sdnctl:vnf">
+ <output xmlns="org:onap:sdnctl:vnf">
<vnf-information>
<vnf-id>skask</vnf-id>
</vnf-information>
@@ -13,4 +13,4 @@
<instance-reference>
<object-path>restconf/SDNCObjectPath</object-path>
</instance-reference>
- </output> \ No newline at end of file
+ </output>
diff --git a/common/src/main/java/org/openecomp/mso/logger/MsoLogger.java b/common/src/main/java/org/openecomp/mso/logger/MsoLogger.java
index 19115ce55b..86aedc1a43 100644
--- a/common/src/main/java/org/openecomp/mso/logger/MsoLogger.java
+++ b/common/src/main/java/org/openecomp/mso/logger/MsoLogger.java
@@ -135,7 +135,7 @@ public class MsoLogger {
}
};
- private EELFLogger debugLogger, errorLogger, auditLogger, metricsLogger;
+ private EELFLogger logger, auditLogger, metricsLogger;
private static final String CONFIG_FILE = System.getProperty("jboss.home.dir") + "/mso-config/uuid/uuid_"
+ System.getProperty("jboss.server.name");
private static String instanceUUID, serverIP, serverName;
@@ -145,8 +145,7 @@ public class MsoLogger {
private static final Logger LOGGER = Logger.getLogger(MsoLogger.class.getName());
private MsoLogger(MsoLogger.Catalog cat) {
- this.debugLogger = EELFManager.getInstance().getDebugLogger();
- this.errorLogger = EELFManager.getInstance().getErrorLogger();
+ this.logger = EELFManager.getInstance().getErrorLogger();
this.auditLogger = EELFManager.getInstance().getAuditLogger();
this.metricsLogger = EELFManager.getInstance().getMetricsLogger();
MsoLogger.initialization();
@@ -238,7 +237,7 @@ public class MsoLogger {
*/
public void debug(String msg) {
prepareMsg(DEBUG_LEVEL);
- debugLogger.debug(msg);
+ logger.debug(msg);
}
/**
@@ -251,7 +250,7 @@ public class MsoLogger {
*/
public void debug(String msg, Throwable t) {
prepareMsg(DEBUG_LEVEL);
- debugLogger.debug(msg, t);
+ logger.debug(msg, t);
}
// Info methods
@@ -264,7 +263,7 @@ public class MsoLogger {
public void info(EELFResolvableErrorEnum msg, String targetEntity, String targetServiceName) {
prepareErrorMsg(INFO_LEVEL, targetEntity, targetServiceName, null, "");
- debugLogger.info(msg);
+ logger.info(msg);
MDC.remove(TARGETENTITY);
MDC.remove(TARGETSERVICENAME);
}
@@ -280,7 +279,7 @@ public class MsoLogger {
public void info(EELFResolvableErrorEnum msg, String arg0, String targetEntity, String targetServiceName) {
prepareErrorMsg(INFO_LEVEL, targetEntity, targetServiceName, null, "");
- debugLogger.info(msg, normalize(arg0));
+ logger.info(msg, normalize(arg0));
MDC.remove(TARGETENTITY);
MDC.remove(TARGETSERVICENAME);
}
@@ -297,7 +296,7 @@ public class MsoLogger {
String targetServiceName) {
prepareErrorMsg(INFO_LEVEL, targetEntity, targetServiceName, null, "");
- debugLogger.info(msg, normalize(arg0), normalize(arg1));
+ logger.info(msg, normalize(arg0), normalize(arg1));
MDC.remove(TARGETENTITY);
MDC.remove(TARGETSERVICENAME);
}
@@ -314,7 +313,7 @@ public class MsoLogger {
String targetServiceName) {
prepareErrorMsg(INFO_LEVEL, targetEntity, targetServiceName, null, "");
- debugLogger.info(msg, normalize(arg0), normalize(arg1), normalize(arg2));
+ logger.info(msg, normalize(arg0), normalize(arg1), normalize(arg2));
MDC.remove(TARGETENTITY);
MDC.remove(TARGETSERVICENAME);
}
@@ -331,7 +330,7 @@ public class MsoLogger {
String targetEntity, String targetServiceName) {
prepareErrorMsg(INFO_LEVEL, targetEntity, targetServiceName, null, "");
- debugLogger.info(msg, normalize(arg0), normalize(arg1), normalize(arg2), normalize(arg3));
+ logger.info(msg, normalize(arg0), normalize(arg1), normalize(arg2), normalize(arg3));
MDC.remove(TARGETENTITY);
MDC.remove(TARGETSERVICENAME);
}
@@ -348,7 +347,7 @@ public class MsoLogger {
String targetEntity, String targetServiceName) {
prepareErrorMsg(INFO_LEVEL, targetEntity, targetServiceName, null, "");
- debugLogger.info(msg, normalize(arg0), normalize(arg1), normalize(arg2), normalize(arg3), normalize(arg4));
+ logger.info(msg, normalize(arg0), normalize(arg1), normalize(arg2), normalize(arg3), normalize(arg4));
MDC.remove(TARGETENTITY);
MDC.remove(TARGETSERVICENAME);
}
@@ -365,7 +364,7 @@ public class MsoLogger {
String arg5, String targetEntity, String targetServiceName) {
prepareErrorMsg(INFO_LEVEL, targetEntity, targetServiceName, null, "");
- debugLogger.info(msg, normalize(arg0), normalize(arg1), normalize(arg2), normalize(arg3), normalize(arg4),
+ logger.info(msg, normalize(arg0), normalize(arg1), normalize(arg2), normalize(arg3), normalize(arg4),
normalize(arg5));
MDC.remove(TARGETENTITY);
MDC.remove(TARGETSERVICENAME);
@@ -382,7 +381,7 @@ public class MsoLogger {
String errorDesc) {
prepareErrorMsg(WARN_LEVEL, targetEntity, targetServiceName, errorCode, errorDesc);
- errorLogger.warn(msg);
+ logger.warn(msg);
MDC.remove(TARGETENTITY);
MDC.remove(TARGETSERVICENAME);
}
@@ -398,9 +397,9 @@ public class MsoLogger {
public void warn(EELFResolvableErrorEnum msg, String targetEntity, String targetServiceName, ErrorCode errorCode,
String errorDesc, Throwable t) {
prepareErrorMsg(WARN_LEVEL, targetEntity, targetServiceName, errorCode, errorDesc);
- errorLogger.warn(msg);
- errorLogger.warn("Exception raised: " + getNormalizedStackTrace(t));
- debugLogger.debug("Exception raised", t);
+ logger.warn(msg);
+ logger.warn("Exception raised: " + getNormalizedStackTrace(t));
+ logger.debug("Exception raised", t);
MDC.remove(TARGETENTITY);
MDC.remove(TARGETSERVICENAME);
}
@@ -416,7 +415,7 @@ public class MsoLogger {
public void warn(EELFResolvableErrorEnum msg, String arg, String targetEntity, String targetServiceName,
ErrorCode errorCode, String errorDesc) {
prepareErrorMsg(WARN_LEVEL, targetEntity, targetServiceName, errorCode, errorDesc);
- errorLogger.warn(msg, arg);
+ logger.warn(msg, arg);
MDC.remove(TARGETENTITY);
MDC.remove(TARGETSERVICENAME);
}
@@ -434,9 +433,9 @@ public class MsoLogger {
public void warn(EELFResolvableErrorEnum msg, String arg, String targetEntity, String targetServiceName,
ErrorCode errorCode, String errorDesc, Throwable t) {
prepareErrorMsg(WARN_LEVEL, targetEntity, targetServiceName, errorCode, errorDesc);
- errorLogger.warn(msg, arg);
- errorLogger.warn("Exception raised: " + getNormalizedStackTrace(t));
- debugLogger.debug("Exception raised", t);
+ logger.warn(msg, arg);
+ logger.warn("Exception raised: " + getNormalizedStackTrace(t));
+ logger.debug("Exception raised", t);
MDC.remove(TARGETENTITY);
MDC.remove(TARGETSERVICENAME);
}
@@ -452,7 +451,7 @@ public class MsoLogger {
public void warn(EELFResolvableErrorEnum msg, String arg0, String arg1, String targetEntity,
String targetServiceName, ErrorCode errorCode, String errorDesc) {
prepareErrorMsg(WARN_LEVEL, targetEntity, targetServiceName, errorCode, errorDesc);
- errorLogger.warn(msg, normalize(arg0), normalize(arg1));
+ logger.warn(msg, normalize(arg0), normalize(arg1));
MDC.remove(TARGETENTITY);
MDC.remove(TARGETSERVICENAME);
}
@@ -470,9 +469,9 @@ public class MsoLogger {
public void warn(EELFResolvableErrorEnum msg, String arg0, String arg1, String targetEntity,
String targetServiceName, ErrorCode errorCode, String errorDesc, Throwable t) {
prepareErrorMsg(WARN_LEVEL, targetEntity, targetServiceName, errorCode, errorDesc);
- errorLogger.warn(msg, normalize(arg0), normalize(arg1));
- errorLogger.warn("Exception raised: " + getNormalizedStackTrace(t));
- debugLogger.debug("Exception raised", t);
+ logger.warn(msg, normalize(arg0), normalize(arg1));
+ logger.warn("Exception raised: " + getNormalizedStackTrace(t));
+ logger.debug("Exception raised", t);
MDC.remove(TARGETENTITY);
MDC.remove(TARGETSERVICENAME);
}
@@ -488,7 +487,7 @@ public class MsoLogger {
public void warn(EELFResolvableErrorEnum msg, String arg0, String arg1, String arg2, String targetEntity,
String targetServiceName, ErrorCode errorCode, String errorDesc) {
prepareErrorMsg(WARN_LEVEL, targetEntity, targetServiceName, errorCode, errorDesc);
- errorLogger.warn(msg, normalize(arg0), normalize(arg1), normalize(arg2));
+ logger.warn(msg, normalize(arg0), normalize(arg1), normalize(arg2));
MDC.remove(TARGETENTITY);
MDC.remove(TARGETSERVICENAME);
}
@@ -506,9 +505,9 @@ public class MsoLogger {
public void warn(EELFResolvableErrorEnum msg, String arg0, String arg1, String arg2, String targetEntity,
String targetServiceName, ErrorCode errorCode, String errorDesc, Throwable t) {
prepareErrorMsg(WARN_LEVEL, targetEntity, targetServiceName, errorCode, errorDesc);
- errorLogger.warn(msg, normalize(arg0), normalize(arg1), normalize(arg2));
- errorLogger.warn("Exception raised: " + getNormalizedStackTrace(t));
- debugLogger.debug("Exception raised", t);
+ logger.warn(msg, normalize(arg0), normalize(arg1), normalize(arg2));
+ logger.warn("Exception raised: " + getNormalizedStackTrace(t));
+ logger.debug("Exception raised", t);
MDC.remove(TARGETENTITY);
MDC.remove(TARGETSERVICENAME);
}
@@ -524,7 +523,7 @@ public class MsoLogger {
public void warn(EELFResolvableErrorEnum msg, String arg0, String arg1, String arg2, String arg3,
String targetEntity, String targetServiceName, ErrorCode errorCode, String errorDesc) {
prepareErrorMsg(WARN_LEVEL, targetEntity, targetServiceName, errorCode, errorDesc);
- errorLogger.warn(msg, normalize(arg0), normalize(arg1), normalize(arg2), normalize(arg3));
+ logger.warn(msg, normalize(arg0), normalize(arg1), normalize(arg2), normalize(arg3));
MDC.remove(TARGETENTITY);
MDC.remove(TARGETSERVICENAME);
}
@@ -542,9 +541,9 @@ public class MsoLogger {
public void warn(EELFResolvableErrorEnum msg, String arg0, String arg1, String arg2, String arg3,
String targetEntity, String targetServiceName, ErrorCode errorCode, String errorDesc, Throwable t) {
prepareErrorMsg(WARN_LEVEL, targetEntity, targetServiceName, errorCode, errorDesc);
- errorLogger.warn(msg, normalize(arg0), normalize(arg1), normalize(arg2), normalize(arg3));
- errorLogger.warn("Exception raised: " + getNormalizedStackTrace(t));
- debugLogger.debug("Exception raised", t);
+ logger.warn(msg, normalize(arg0), normalize(arg1), normalize(arg2), normalize(arg3));
+ logger.warn("Exception raised: " + getNormalizedStackTrace(t));
+ logger.debug("Exception raised", t);
MDC.remove(TARGETENTITY);
MDC.remove(TARGETSERVICENAME);
}
@@ -560,7 +559,7 @@ public class MsoLogger {
public void warn(EELFResolvableErrorEnum msg, String arg0, String arg1, String arg2, String arg3, String arg4,
String targetEntity, String targetServiceName, ErrorCode errorCode, String errorDesc) {
prepareErrorMsg(WARN_LEVEL, targetEntity, targetServiceName, errorCode, errorDesc);
- errorLogger.warn(msg, normalize(arg0), normalize(arg1), normalize(arg2), normalize(arg3), normalize(arg4));
+ logger.warn(msg, normalize(arg0), normalize(arg1), normalize(arg2), normalize(arg3), normalize(arg4));
MDC.remove(TARGETENTITY);
MDC.remove(TARGETSERVICENAME);
}
@@ -578,9 +577,9 @@ public class MsoLogger {
public void warn(EELFResolvableErrorEnum msg, String arg0, String arg1, String arg2, String arg3, String arg4,
String targetEntity, String targetServiceName, ErrorCode errorCode, String errorDesc, Throwable t) {
prepareErrorMsg(WARN_LEVEL, targetEntity, targetServiceName, errorCode, errorDesc);
- errorLogger.warn(msg, normalize(arg0), normalize(arg1), normalize(arg2), normalize(arg3), normalize(arg4));
- errorLogger.warn("Exception raised: " + getNormalizedStackTrace(t));
- debugLogger.debug("Exception raised", t);
+ logger.warn(msg, normalize(arg0), normalize(arg1), normalize(arg2), normalize(arg3), normalize(arg4));
+ logger.warn("Exception raised: " + getNormalizedStackTrace(t));
+ logger.debug("Exception raised", t);
MDC.remove(TARGETENTITY);
MDC.remove(TARGETSERVICENAME);
}
@@ -595,7 +594,7 @@ public class MsoLogger {
public void error(EELFResolvableErrorEnum msg, String targetEntity, String targetServiceName, ErrorCode errorCode,
String errorDesc) {
prepareErrorMsg(ERROR_LEVEL, targetEntity, targetServiceName, errorCode, errorDesc);
- errorLogger.error(msg);
+ logger.error(msg);
MDC.remove(TARGETENTITY);
MDC.remove(TARGETSERVICENAME);
}
@@ -611,9 +610,9 @@ public class MsoLogger {
public void error(EELFResolvableErrorEnum msg, String targetEntity, String targetServiceName, ErrorCode errorCode,
String errorDesc, Throwable t) {
prepareErrorMsg(ERROR_LEVEL, targetEntity, targetServiceName, errorCode, errorDesc);
- errorLogger.error(msg);
- errorLogger.error(exceptionArg, getNormalizedStackTrace(t));
- debugLogger.debug("Exception raised", t);
+ logger.error(msg);
+ logger.error(exceptionArg, getNormalizedStackTrace(t));
+ logger.debug("Exception raised", t);
MDC.remove(TARGETENTITY);
MDC.remove(TARGETSERVICENAME);
}
@@ -629,7 +628,7 @@ public class MsoLogger {
public void error(EELFResolvableErrorEnum msg, String arg0, String targetEntity, String targetServiceName,
ErrorCode errorCode, String errorDesc) {
prepareErrorMsg(ERROR_LEVEL, targetEntity, targetServiceName, errorCode, errorDesc);
- errorLogger.error(msg, normalize(arg0));
+ logger.error(msg, normalize(arg0));
MDC.remove(TARGETENTITY);
MDC.remove(TARGETSERVICENAME);
}
@@ -647,9 +646,9 @@ public class MsoLogger {
public void error(EELFResolvableErrorEnum msg, String arg0, String targetEntity, String targetServiceName,
ErrorCode errorCode, String errorDesc, Throwable t) {
prepareErrorMsg(ERROR_LEVEL, targetEntity, targetServiceName, errorCode, errorDesc);
- errorLogger.error(msg, normalize(arg0));
- errorLogger.error(exceptionArg, getNormalizedStackTrace(t));
- debugLogger.debug("Exception raised", t);
+ logger.error(msg, normalize(arg0));
+ logger.error(exceptionArg, getNormalizedStackTrace(t));
+ logger.debug("Exception raised", t);
MDC.remove(TARGETENTITY);
MDC.remove(TARGETSERVICENAME);
}
@@ -665,7 +664,7 @@ public class MsoLogger {
public void error(EELFResolvableErrorEnum msg, String arg0, String arg1, String targetEntity,
String targetServiceName, ErrorCode errorCode, String errorDesc) {
prepareErrorMsg(ERROR_LEVEL, targetEntity, targetServiceName, errorCode, errorDesc);
- errorLogger.error(msg, normalize(arg0), normalize(arg1));
+ logger.error(msg, normalize(arg0), normalize(arg1));
MDC.remove(TARGETENTITY);
MDC.remove(TARGETSERVICENAME);
}
@@ -683,9 +682,9 @@ public class MsoLogger {
public void error(EELFResolvableErrorEnum msg, String arg0, String arg1, String targetEntity,
String targetServiceName, ErrorCode errorCode, String errorDesc, Throwable t) {
prepareErrorMsg(ERROR_LEVEL, targetEntity, targetServiceName, errorCode, errorDesc);
- errorLogger.error(msg, normalize(arg0), normalize(arg1));
- errorLogger.error(exceptionArg, getNormalizedStackTrace(t));
- debugLogger.debug("Exception raised", t);
+ logger.error(msg, normalize(arg0), normalize(arg1));
+ logger.error(exceptionArg, getNormalizedStackTrace(t));
+ logger.debug("Exception raised", t);
MDC.remove(TARGETENTITY);
MDC.remove(TARGETSERVICENAME);
}
@@ -701,7 +700,7 @@ public class MsoLogger {
public void error(EELFResolvableErrorEnum msg, String arg0, String arg1, String arg2, String targetEntity,
String targetServiceName, ErrorCode errorCode, String errorDesc) {
prepareErrorMsg(ERROR_LEVEL, targetEntity, targetServiceName, errorCode, errorDesc);
- errorLogger.error(msg, normalize(arg0), normalize(arg1), normalize(arg2));
+ logger.error(msg, normalize(arg0), normalize(arg1), normalize(arg2));
MDC.remove(TARGETENTITY);
MDC.remove(TARGETSERVICENAME);
}
@@ -719,9 +718,9 @@ public class MsoLogger {
public void error(EELFResolvableErrorEnum msg, String arg0, String arg1, String arg2, String targetEntity,
String targetServiceName, ErrorCode errorCode, String errorDesc, Throwable t) {
prepareErrorMsg(ERROR_LEVEL, targetEntity, targetServiceName, errorCode, errorDesc);
- errorLogger.error(msg, normalize(arg0), normalize(arg1), normalize(arg2));
- errorLogger.error(exceptionArg, getNormalizedStackTrace(t));
- debugLogger.debug("Exception raised", t);
+ logger.error(msg, normalize(arg0), normalize(arg1), normalize(arg2));
+ logger.error(exceptionArg, getNormalizedStackTrace(t));
+ logger.debug("Exception raised", t);
MDC.remove(TARGETENTITY);
MDC.remove(TARGETSERVICENAME);
}
@@ -737,7 +736,7 @@ public class MsoLogger {
public void error(EELFResolvableErrorEnum msg, String arg0, String arg1, String arg2, String arg3,
String targetEntity, String targetServiceName, ErrorCode errorCode, String errorDesc) {
prepareErrorMsg(ERROR_LEVEL, targetEntity, targetServiceName, errorCode, errorDesc);
- errorLogger.error(msg, normalize(arg0), normalize(arg1), normalize(arg2), normalize(arg3));
+ logger.error(msg, normalize(arg0), normalize(arg1), normalize(arg2), normalize(arg3));
MDC.remove(TARGETENTITY);
MDC.remove(TARGETSERVICENAME);
}
@@ -755,9 +754,9 @@ public class MsoLogger {
public void error(EELFResolvableErrorEnum msg, String arg0, String arg1, String arg2, String arg3,
String targetEntity, String targetServiceName, ErrorCode errorCode, String errorDesc, Throwable t) {
prepareErrorMsg(ERROR_LEVEL, targetEntity, targetServiceName, errorCode, errorDesc);
- errorLogger.error(msg, normalize(arg0), normalize(arg1), normalize(arg2), normalize(arg3));
- errorLogger.error(exceptionArg, getNormalizedStackTrace(t));
- debugLogger.debug("Exception raised", t);
+ logger.error(msg, normalize(arg0), normalize(arg1), normalize(arg2), normalize(arg3));
+ logger.error(exceptionArg, getNormalizedStackTrace(t));
+ logger.debug("Exception raised", t);
MDC.remove(TARGETENTITY);
MDC.remove(TARGETSERVICENAME);
}
@@ -773,7 +772,7 @@ public class MsoLogger {
public void error(EELFResolvableErrorEnum msg, String arg0, String arg1, String arg2, String arg3, String arg4,
String targetEntity, String targetServiceName, ErrorCode errorCode, String errorDesc) {
prepareErrorMsg(ERROR_LEVEL, targetEntity, targetServiceName, errorCode, errorDesc);
- errorLogger.error(msg, normalize(arg0), normalize(arg1), normalize(arg2), normalize(arg3), normalize(arg4));
+ logger.error(msg, normalize(arg0), normalize(arg1), normalize(arg2), normalize(arg3), normalize(arg4));
MDC.remove(TARGETENTITY);
MDC.remove(TARGETSERVICENAME);
}
@@ -791,15 +790,15 @@ public class MsoLogger {
public void error(EELFResolvableErrorEnum msg, String arg0, String arg1, String arg2, String arg3, String arg4,
String targetEntity, String targetServiceName, ErrorCode errorCode, String errorDesc, Throwable t) {
prepareErrorMsg(ERROR_LEVEL, targetEntity, targetServiceName, errorCode, errorDesc);
- errorLogger.error(msg, normalize(arg0), normalize(arg1), normalize(arg2), normalize(arg3), normalize(arg4));
- errorLogger.error(exceptionArg, getNormalizedStackTrace(t));
- debugLogger.debug("Exception raised", t);
+ logger.error(msg, normalize(arg0), normalize(arg1), normalize(arg2), normalize(arg3), normalize(arg4));
+ logger.error(exceptionArg, getNormalizedStackTrace(t));
+ logger.debug("Exception raised", t);
MDC.remove(TARGETENTITY);
MDC.remove(TARGETSERVICENAME);
}
public boolean isDebugEnabled() {
- return debugLogger.isDebugEnabled();
+ return logger.isDebugEnabled();
}
private void prepareMsg(String loggingLevel) {
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java
index 2386848ad5..f33774faef 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java
@@ -21,6 +21,7 @@
package org.openecomp.mso.apihandlerinfra;
import java.io.IOException;
+import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -28,7 +29,6 @@ import java.util.Map;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
@@ -39,6 +39,8 @@ import javax.ws.rs.core.Response;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.codehaus.jackson.map.ObjectMapper;
+import org.hibernate.Session;
+
import org.openecomp.mso.apihandler.common.ErrorNumbers;
import org.openecomp.mso.apihandler.common.RequestClient;
import org.openecomp.mso.apihandler.common.RequestClientFactory;
@@ -51,6 +53,7 @@ import org.openecomp.mso.apihandlerinfra.serviceinstancebeans.RequestInfo;
import org.openecomp.mso.apihandlerinfra.serviceinstancebeans.RequestParameters;
import org.openecomp.mso.apihandlerinfra.serviceinstancebeans.ServiceInstancesRequest;
import org.openecomp.mso.apihandlerinfra.serviceinstancebeans.SubscriberInfo;
+import org.openecomp.mso.db.AbstractSessionFactoryManager;
import org.openecomp.mso.db.catalog.CatalogDatabase;
import org.openecomp.mso.db.catalog.beans.Service;
import org.openecomp.mso.db.catalog.beans.ServiceRecipe;
@@ -58,446 +61,483 @@ import org.openecomp.mso.logger.MessageEnum;
import org.openecomp.mso.logger.MsoAlarmLogger;
import org.openecomp.mso.logger.MsoLogger;
import org.openecomp.mso.requestsdb.InfraActiveRequests;
+import org.openecomp.mso.requestsdb.OperationStatus;
import org.openecomp.mso.requestsdb.RequestsDatabase;
+import org.openecomp.mso.requestsdb.RequestsDbSessionFactoryManager;
import org.openecomp.mso.utils.UUIDChecker;
import com.wordnik.swagger.annotations.Api;
import com.wordnik.swagger.annotations.ApiOperation;
@Path("/e2eServiceInstances")
-@Api(value="/e2eServiceInstances",description="API Requests for E2E Service Instances")
+@Api(value = "/e2eServiceInstances", description = "API Requests for E2E Service Instances")
public class E2EServiceInstances {
- private HashMap<String, String> instanceIdMap = new HashMap<String,String>();
- private static MsoLogger msoLogger = MsoLogger.getMsoLogger (MsoLogger.Catalog.APIH);
- private static MsoAlarmLogger alarmLogger = new MsoAlarmLogger ();
- public final static String MSO_PROP_APIHANDLER_INFRA = "MSO_PROP_APIHANDLER_INFRA";
-
- public E2EServiceInstances() {
- }
+ private HashMap<String, String> instanceIdMap = new HashMap<>();
+ private static MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.APIH);
+ private static MsoAlarmLogger alarmLogger = new MsoAlarmLogger();
+ public static final String MSO_PROP_APIHANDLER_INFRA = "MSO_PROP_APIHANDLER_INFRA";
+ private ServiceInstancesRequest sir = null;
+ public static final String END_OF_THE_TRANSACTION = "End of the transaction, the final response is: ";
+ public static final String EXCEPTION_CREATING_DB_RECORD = "Exception while creating record in DB";
+ public static final String EXCEPTION_COMMUNICATE_BPMN_ENGINE = "Exception while communicate with BPMN engine";
+
/**
- *POST Requests for E2E Service create Instance on a version provided
- */
+ * POST Requests for E2E Service create Instance on a version provided
+ */
@POST
@Path("/{version:[vV][3-5]}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value="Create a E2E Service Instance on a version provided",response=Response.class)
+ @ApiOperation(value = "Create a E2E Service Instance on a version provided", response = Response.class)
public Response createE2EServiceInstance(String request, @PathParam("version") String version) {
- return E2EserviceInstances(request, Action.createInstance, null, version);
+ return processE2EserviceInstances(request, Action.createInstance, null, version);
}
/**
- *DELETE Requests for E2E Service delete Instance on a specified version and serviceId
- */
-
+ * DELETE Requests for E2E Service delete Instance on a specified version
+ * and serviceId
+ */
+
@DELETE
@Path("/{version:[vV][3-5]}/{serviceId}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value="Delete E2E Service Instance on a specified version and serviceId",response=Response.class)
- public Response deleteE2EServiceInstance(String request, @PathParam("version") String version, @PathParam("serviceId") String serviceId) {
+ @ApiOperation(value = "Delete E2E Service Instance on a specified version and serviceId", response = Response.class)
+ public Response deleteE2EServiceInstance(String request, @PathParam("version") String version,
+ @PathParam("serviceId") String serviceId) {
- instanceIdMap.put("serviceId", serviceId);
+ instanceIdMap.put("serviceId", serviceId);
- return E2EserviceInstances(request, Action.deleteInstance, null, version);
+ return processE2EserviceInstances(request, Action.deleteInstance, null, version);
}
-
- private Response E2EserviceInstances(String requestJSON, Action action,
- HashMap<String, String> instanceIdMap, String version) {
+
+ private Response processE2EserviceInstances(String requestJSON, Action action,
+ HashMap<String, String> instanceIdMap, String version) {
String requestId = UUIDChecker.generateUUID(msoLogger);
long startTime = System.currentTimeMillis();
msoLogger.debug("requestId is: " + requestId);
- E2EServiceInstanceRequest sir = null;
+ E2EServiceInstanceRequest e2eSir = null;
MsoRequest msoRequest = new MsoRequest(requestId);
ObjectMapper mapper = new ObjectMapper();
try {
- sir = mapper
- .readValue(requestJSON, E2EServiceInstanceRequest.class);
+ e2eSir = mapper.readValue(requestJSON, E2EServiceInstanceRequest.class);
} catch (Exception e) {
msoLogger.debug("Mapping of request to JSON object failed : ", e);
- Response response = msoRequest.buildServiceErrorResponse(
- HttpStatus.SC_BAD_REQUEST,
- MsoException.ServiceException,
- "Mapping of request to JSON object failed. "
- + e.getMessage(), ErrorNumbers.SVC_BAD_PARAMETER,
- null);
- msoLogger.error(MessageEnum.APIH_REQUEST_VALIDATION_ERROR,
- MSO_PROP_APIHANDLER_INFRA, "", "",
+ Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_REQUEST,
+ MsoException.ServiceException, "Mapping of request to JSON object failed. " + e.getMessage(),
+ ErrorNumbers.SVC_BAD_PARAMETER, null);
+ msoLogger.error(MessageEnum.APIH_REQUEST_VALIDATION_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",
MsoLogger.ErrorCode.SchemaError, requestJSON, e);
- msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
- MsoLogger.ResponseCode.SchemaError,
+ msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.SchemaError,
"Mapping of request to JSON object failed");
- msoLogger.debug("End of the transaction, the final response is: "
- + (String) response.getEntity());
+ msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());
return response;
}
- InfraActiveRequests dup = null;
- String instanceName = sir.getService().getName();
- String requestScope = sir.getService().getParameters().getNodeType();
+ mapReqJsonToSvcInstReq(e2eSir, requestJSON);
+ sir.getRequestDetails().getRequestParameters().setaLaCarte(true);
+ try {
+ msoRequest.parse(sir, instanceIdMap, action, version);
+ } catch (Exception e) {
+ msoLogger.debug("Validation failed: ", e);
+ Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_REQUEST,
+ MsoException.ServiceException, "Error parsing request. " + e.getMessage(),
+ ErrorNumbers.SVC_BAD_PARAMETER, null);
+ if (msoRequest.getRequestId() != null) {
+ msoLogger.debug("Logging failed message to the database");
+ msoRequest.createRequestRecord(Status.FAILED, action);
+ }
+ msoLogger.error(MessageEnum.APIH_REQUEST_VALIDATION_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",
+ MsoLogger.ErrorCode.SchemaError, requestJSON, e);
+ msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.SchemaError,
+ "Validation of the input request failed");
+ msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());
+ return response;
+ }
+ InfraActiveRequests dup = null;
+// String instanceName = sir.getService().getName();
+// String requestScope = sir.getService().getParameters().getNodeType();
+ String instanceName = sir.getRequestDetails().getRequestInfo().getInstanceName();
+ String requestScope = sir.getRequestDetails().getModelInfo().getModelType().name();
try {
- if(!(instanceName==null && "service".equals(requestScope) && (action == Action.createInstance || action
- == Action.activateInstance))){
- dup = (RequestsDatabase.getInstance()).checkInstanceNameDuplicate (instanceIdMap, instanceName, requestScope);
+ if (!(instanceName == null && "service".equals(requestScope)
+ && (action == Action.createInstance || action == Action.activateInstance))) {
+ dup = (RequestsDatabase.getInstance()).checkInstanceNameDuplicate(instanceIdMap, instanceName,
+ requestScope);
}
} catch (Exception e) {
- msoLogger.error (MessageEnum.APIH_DUPLICATE_CHECK_EXC, MSO_PROP_APIHANDLER_INFRA, "", "", MsoLogger.ErrorCode.DataError, "Error during duplicate check ", e);
-
- Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_INTERNAL_SERVER_ERROR, MsoException.ServiceException,
- e.getMessage(),
- ErrorNumbers.SVC_DETAILED_SERVICE_ERROR,
- null) ;
+ msoLogger.error(MessageEnum.APIH_DUPLICATE_CHECK_EXC, MSO_PROP_APIHANDLER_INFRA, "", "",
+ MsoLogger.ErrorCode.DataError, "Error during duplicate check ", e);
+ Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_INTERNAL_SERVER_ERROR,
+ MsoException.ServiceException, e.getMessage(), ErrorNumbers.SVC_DETAILED_SERVICE_ERROR, null);
- msoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError, "Error during duplicate check");
- msoLogger.debug ("End of the transaction, the final response is: " + (String) response.getEntity ());
+ msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError,
+ "Error during duplicate check");
+ msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());
return response;
}
if (dup != null) {
// Found the duplicate record. Return the appropriate error.
String instance = null;
- if(instanceName != null){
+ if (instanceName != null) {
instance = instanceName;
- }else{
+ } else {
instance = instanceIdMap.get(requestScope + "InstanceId");
}
- String dupMessage = "Error: Locked instance - This " + requestScope + " (" + instance + ") " + "already has a request being worked with a status of " + dup.getRequestStatus() + " (RequestId - " + dup.getRequestId() + "). The existing request must finish or be cleaned up before proceeding.";
-
- Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_CONFLICT, MsoException.ServiceException,
- dupMessage,
- ErrorNumbers.SVC_DETAILED_SERVICE_ERROR,
- null) ;
-
-
- msoLogger.warn (MessageEnum.APIH_DUPLICATE_FOUND, dupMessage, "", "", MsoLogger.ErrorCode.SchemaError, "Duplicate request - Subscriber already has a request for this service");
- msoRequest.createRequestRecord (Status.FAILED, action);
- msoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Conflict, dupMessage);
- msoLogger.debug ("End of the transaction, the final response is: " + (String) response.getEntity ());
+ String dupMessage = "Error: Locked instance - This " + requestScope + " (" + instance + ") "
+ + "already has a request being worked with a status of " + dup.getRequestStatus() + " (RequestId - "
+ + dup.getRequestId() + "). The existing request must finish or be cleaned up before proceeding.";
+
+ Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_CONFLICT,
+ MsoException.ServiceException, dupMessage, ErrorNumbers.SVC_DETAILED_SERVICE_ERROR, null);
+
+ msoLogger.warn(MessageEnum.APIH_DUPLICATE_FOUND, dupMessage, "", "", MsoLogger.ErrorCode.SchemaError,
+ "Duplicate request - Subscriber already has a request for this service");
+ msoRequest.createRequestRecord(Status.FAILED, action);
+ msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Conflict,
+ dupMessage);
+ msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());
return response;
}
-
+
CatalogDatabase db = null;
RecipeLookupResult recipeLookupResult = null;
try {
db = CatalogDatabase.getInstance();
- recipeLookupResult = getServiceInstanceOrchestrationURI(db, sir, action);
+ recipeLookupResult = getServiceInstanceOrchestrationURI(db, action);
} catch (Exception e) {
- msoLogger.error (MessageEnum.APIH_DB_ACCESS_EXC, MSO_PROP_APIHANDLER_INFRA, "", "", MsoLogger.ErrorCode.AvailabilityError, "Exception while communciate with Catalog DB", e);
- msoRequest.setStatus (org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);
- Response response = msoRequest.buildServiceErrorResponse (HttpStatus.SC_NOT_FOUND,
- MsoException.ServiceException,
- "No communication to catalog DB " + e.getMessage (),
- ErrorNumbers.SVC_NO_SERVER_RESOURCES,
- null);
- alarmLogger.sendAlarm ("MsoDatabaseAccessError",
- MsoAlarmLogger.CRITICAL,
- Messages.errors.get (ErrorNumbers.NO_COMMUNICATION_TO_CATALOG_DB));
- msoRequest.createRequestRecord (Status.FAILED,action);
- msoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError, "Exception while communciate with DB");
- msoLogger.debug ("End of the transaction, the final response is: " + (String) response.getEntity ());
+ msoLogger.error(MessageEnum.APIH_DB_ACCESS_EXC, MSO_PROP_APIHANDLER_INFRA, "", "",
+ MsoLogger.ErrorCode.AvailabilityError, "Exception while communciate with Catalog DB", e);
+ msoRequest.setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);
+ Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_NOT_FOUND,
+ MsoException.ServiceException, "No communication to catalog DB " + e.getMessage(),
+ ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);
+ alarmLogger.sendAlarm("MsoDatabaseAccessError", MsoAlarmLogger.CRITICAL,
+ Messages.errors.get(ErrorNumbers.NO_COMMUNICATION_TO_CATALOG_DB));
+ msoRequest.createRequestRecord(Status.FAILED, action);
+ msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError,
+ "Exception while communciate with DB");
+ msoLogger.debug(END_OF_THE_TRANSACTION + (String) response.getEntity());
return response;
} finally {
- if(db != null) {
- db.close();
- }
+ closeCatalogDB(db);
}
if (recipeLookupResult == null) {
- msoLogger.error (MessageEnum.APIH_DB_ATTRIBUTE_NOT_FOUND, MSO_PROP_APIHANDLER_INFRA, "", "", MsoLogger.ErrorCode.DataError, "No recipe found in DB");
- msoRequest.setStatus (org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);
- Response response = msoRequest.buildServiceErrorResponse (HttpStatus.SC_NOT_FOUND,
- MsoException.ServiceException,
- "Recipe does not exist in catalog DB",
- ErrorNumbers.SVC_GENERAL_SERVICE_ERROR,
- null);
- msoRequest.createRequestRecord (Status.FAILED, action);
- msoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, "No recipe found in DB");
- msoLogger.debug ("End of the transaction, the final response is: " + (String) response.getEntity ());
+ msoLogger.error(MessageEnum.APIH_DB_ATTRIBUTE_NOT_FOUND, MSO_PROP_APIHANDLER_INFRA, "", "",
+ MsoLogger.ErrorCode.DataError, "No recipe found in DB");
+ msoRequest.setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);
+ Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_NOT_FOUND,
+ MsoException.ServiceException, "Recipe does not exist in catalog DB",
+ ErrorNumbers.SVC_GENERAL_SERVICE_ERROR, null);
+ msoRequest.createRequestRecord(Status.FAILED, action);
+ msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound,
+ "No recipe found in DB");
+ msoLogger.debug(END_OF_THE_TRANSACTION + (String) response.getEntity());
return response;
}
try {
- msoRequest.createRequestRecord (Status.PENDING, action);
+ msoRequest.createRequestRecord(Status.PENDING, action);
+ createOperationStatusRecord(action, requestId);
} catch (Exception e) {
- msoLogger.error (MessageEnum.APIH_DB_ACCESS_EXC_REASON, "Exception while creating record in DB", "", "", MsoLogger.ErrorCode.SchemaError, "Exception while creating record in DB", e);
- msoRequest.setStatus (org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);
- Response response = msoRequest.buildServiceErrorResponse (HttpStatus.SC_INTERNAL_SERVER_ERROR,
- MsoException.ServiceException,
- "Exception while creating record in DB " + e.getMessage(),
- ErrorNumbers.SVC_BAD_PARAMETER,
- null);
- msoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError, "Exception while creating record in DB");
- msoLogger.debug ("End of the transaction, the final response is: " + (String) response.getEntity ());
+ msoLogger.error(MessageEnum.APIH_DB_ACCESS_EXC_REASON, "Exception while creating record in DB", "", "",
+ MsoLogger.ErrorCode.SchemaError, "Exception while creating record in DB", e);
+ msoRequest.setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);
+ Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_INTERNAL_SERVER_ERROR,
+ MsoException.ServiceException, "Exception while creating record in DB " + e.getMessage(),
+ ErrorNumbers.SVC_BAD_PARAMETER, null);
+ msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError,
+ "Exception while creating record in DB");
+ msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());
return response;
}
- String modelInfo = sir.getService().getParameters().getNodeTemplateName();
+ String modelInfo = e2eSir.getService().getParameters().getNodeTemplateName();
String[] arrayOfInfo = modelInfo.split(":");
String serviceInstanceType = arrayOfInfo[0];
-
-
String serviceId = "";
RequestClient requestClient = null;
HttpResponse response = null;
long subStartTime = System.currentTimeMillis();
- String sirRequestJson = mappingObtainedRequestJSONToServiceInstanceRequest(sir);
+ String sirRequestJson = mapReqJsonToSvcInstReq(e2eSir, requestJSON);
try {
- requestClient = RequestClientFactory.getRequestClient (recipeLookupResult.getOrchestrationURI (), MsoPropertiesUtils.loadMsoProperties ());
+ requestClient = RequestClientFactory.getRequestClient(recipeLookupResult.getOrchestrationURI(),
+ MsoPropertiesUtils.loadMsoProperties());
// Capture audit event
- msoLogger.debug ("MSO API Handler Posting call to BPEL engine for url: " + requestClient.getUrl ());
+ msoLogger.debug("MSO API Handler Posting call to BPEL engine for url: " + requestClient.getUrl());
- response = requestClient.post(requestId, false,
- recipeLookupResult.getRecipeTimeout(),
- action.name(), serviceId, null, null, null, null, serviceInstanceType,
- null, null, null, sirRequestJson);
+ response = requestClient.post(requestId, false, recipeLookupResult.getRecipeTimeout(), action.name(),
+ serviceId, null, null, null, null, serviceInstanceType, null, null, null, sirRequestJson);
- msoLogger.recordMetricEvent(subStartTime,
- MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
- "Successfully received response from BPMN engine", "BPMN",
- recipeLookupResult.getOrchestrationURI(), null);
+ msoLogger.recordMetricEvent(subStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
+ "Successfully received response from BPMN engine", "BPMN", recipeLookupResult.getOrchestrationURI(),
+ null);
} catch (Exception e) {
- msoLogger.recordMetricEvent(subStartTime,
- MsoLogger.StatusCode.ERROR,
- MsoLogger.ResponseCode.CommunicationError,
- "Exception while communicate with BPMN engine", "BPMN",
+ msoLogger.recordMetricEvent(subStartTime, MsoLogger.StatusCode.ERROR,
+ MsoLogger.ResponseCode.CommunicationError, "Exception while communicate with BPMN engine", "BPMN",
recipeLookupResult.getOrchestrationURI(), null);
- Response resp = msoRequest.buildServiceErrorResponse(
- HttpStatus.SC_BAD_GATEWAY, MsoException.ServiceException,
- "Failed calling bpmn " + e.getMessage(),
+ Response resp = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_GATEWAY,
+ MsoException.ServiceException, "Failed calling bpmn " + e.getMessage(),
ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);
- alarmLogger.sendAlarm("MsoConfigurationError",
- MsoAlarmLogger.CRITICAL,
+ alarmLogger.sendAlarm("MsoConfigurationError", MsoAlarmLogger.CRITICAL,
Messages.errors.get(ErrorNumbers.NO_COMMUNICATION_TO_BPEL));
- msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR,
- MSO_PROP_APIHANDLER_INFRA, "", "",
- MsoLogger.ErrorCode.AvailabilityError,
+ msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",
+ MsoLogger.ErrorCode.AvailabilityError, "Exception while communicate with BPMN engine");
+ msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError,
"Exception while communicate with BPMN engine");
- msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
- MsoLogger.ResponseCode.CommunicationError,
- "Exception while communicate with BPMN engine");
- msoLogger.debug("End of the transaction, the final response is: "
- + (String) resp.getEntity());
+ msoLogger.debug("End of the transaction, the final response is: " + (String) resp.getEntity());
return resp;
}
if (response == null) {
- Response resp = msoRequest.buildServiceErrorResponse(
- HttpStatus.SC_BAD_GATEWAY, MsoException.ServiceException,
- "bpelResponse is null",
- ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);
- msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR,
- MSO_PROP_APIHANDLER_INFRA, "", "",
- MsoLogger.ErrorCode.BusinessProcesssError,
- "Null response from BPEL");
- msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
- MsoLogger.ResponseCode.InternalError,
+ Response resp = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_GATEWAY,
+ MsoException.ServiceException, "bpelResponse is null", ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);
+ msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",
+ MsoLogger.ErrorCode.BusinessProcesssError, "Null response from BPEL");
+ msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.InternalError,
"Null response from BPMN");
- msoLogger.debug("End of the transaction, the final response is: "
- + (String) resp.getEntity());
+ msoLogger.debug(END_OF_THE_TRANSACTION + (String) resp.getEntity());
return resp;
}
- ResponseHandler respHandler = new ResponseHandler(response,
- requestClient.getType());
+ ResponseHandler respHandler = new ResponseHandler(response, requestClient.getType());
int bpelStatus = respHandler.getStatus();
+ return beplStatusUpdate(requestId, startTime, msoRequest, requestClient, respHandler, bpelStatus);
+ }
+
+ private void closeCatalogDB(CatalogDatabase db) {
+ if (db != null) {
+ db.close();
+ }
+ }
+
+ private InfraActiveRequests checkForDuplicateRecord(Action action, HashMap<String, String> instanceIdMap,
+ String instanceName, String requestScope) {
+ InfraActiveRequests dupValue = null;
+ if (!(instanceName == null && "service".equals(requestScope)
+ && (action == Action.createInstance || action == Action.activateInstance))) {
+ dupValue = (RequestsDatabase.getInstance()).checkInstanceNameDuplicate(instanceIdMap, instanceName,
+ requestScope);
+ }
+ return dupValue;
+ }
+
+ private Response duplicateRecordFound(Action action, HashMap<String, String> instanceIdMap, long startTime,
+ MsoRequest msoRequest, InfraActiveRequests dup, String instanceName, String requestScope) {
+ String instance = null;
+ if (instanceName != null) {
+ instance = instanceName;
+ } else {
+ instance = instanceIdMap.get(requestScope + "InstanceId");
+ }
+ String dupMessage = "Error: Locked instance - This " + requestScope + " (" + instance + ") "
+ + "already has a request being worked with a status of " + dup.getRequestStatus() + " (RequestId - "
+ + dup.getRequestId() + "). The existing request must finish or be cleaned up before proceeding.";
+
+ Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_CONFLICT, MsoException.ServiceException,
+ dupMessage, ErrorNumbers.SVC_DETAILED_SERVICE_ERROR, null);
+
+ msoLogger.warn(MessageEnum.APIH_DUPLICATE_FOUND, dupMessage, "", "", MsoLogger.ErrorCode.SchemaError,
+ "Duplicate request - Subscriber already has a request for this service");
+ msoRequest.createRequestRecord(Status.FAILED, action);
+ msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Conflict, dupMessage);
+ msoLogger.debug(END_OF_THE_TRANSACTION + (String) response.getEntity());
+ return response;
+ }
+
+ private Response beplStatusUpdate(String requestId, long startTime, MsoRequest msoRequest,
+ RequestClient requestClient, ResponseHandler respHandler, int bpelStatus) {
// BPEL accepted the request, the request is in progress
if (bpelStatus == HttpStatus.SC_ACCEPTED) {
String camundaJSONResponseBody = respHandler.getResponseBody();
- msoLogger
- .debug("Received from Camunda: " + camundaJSONResponseBody);
- (RequestsDatabase.getInstance()).updateInfraStatus(requestId,
- Status.IN_PROGRESS.toString(),
- Constants.PROGRESS_REQUEST_IN_PROGRESS,
- Constants.MODIFIED_BY_APIHANDLER);
-
- msoLogger.recordAuditEvent(startTime,
- MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
+ msoLogger.debug("Received from Camunda: " + camundaJSONResponseBody);
+ (RequestsDatabase.getInstance()).updateInfraStatus(requestId, Status.IN_PROGRESS.toString(),
+ Constants.PROGRESS_REQUEST_IN_PROGRESS, Constants.MODIFIED_BY_APIHANDLER);
+
+ msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
"BPMN accepted the request, the request is in progress");
- msoLogger.debug("End of the transaction, the final response is: "
- + (String) camundaJSONResponseBody);
- return Response.status(HttpStatus.SC_ACCEPTED)
- .entity(camundaJSONResponseBody).build();
+ msoLogger.debug(END_OF_THE_TRANSACTION + camundaJSONResponseBody);
+ return Response.status(HttpStatus.SC_ACCEPTED).entity(camundaJSONResponseBody).build();
} else {
- List<String> variables = new ArrayList<String>();
+ List<String> variables = new ArrayList<>();
variables.add(bpelStatus + "");
String camundaJSONResponseBody = respHandler.getResponseBody();
- if (camundaJSONResponseBody != null
- && !camundaJSONResponseBody.isEmpty()) {
- Response resp = msoRequest.buildServiceErrorResponse(
- bpelStatus, MsoException.ServiceException,
- "Request Failed due to BPEL error with HTTP Status= %1 "
- + '\n' + camundaJSONResponseBody,
- ErrorNumbers.SVC_DETAILED_SERVICE_ERROR, variables);
- msoLogger.error(MessageEnum.APIH_BPEL_RESPONSE_ERROR,
- requestClient.getUrl(), "", "",
+ if (camundaJSONResponseBody != null && !camundaJSONResponseBody.isEmpty()) {
+ Response resp = msoRequest.buildServiceErrorResponse(bpelStatus, MsoException.ServiceException,
+ "Request Failed due to BPEL error with HTTP Status= %1 " + '\n' + camundaJSONResponseBody,
+ ErrorNumbers.SVC_DETAILED_SERVICE_ERROR, variables);
+ msoLogger.error(MessageEnum.APIH_BPEL_RESPONSE_ERROR, requestClient.getUrl(), "", "",
MsoLogger.ErrorCode.BusinessProcesssError,
- "Response from BPEL engine is failed with HTTP Status="
- + bpelStatus);
- msoLogger.recordAuditEvent(startTime,
- MsoLogger.StatusCode.ERROR,
- MsoLogger.ResponseCode.InternalError,
+ "Response from BPEL engine is failed with HTTP Status=" + bpelStatus);
+ msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.InternalError,
"Response from BPMN engine is failed");
- msoLogger
- .debug("End of the transaction, the final response is: "
- + (String) resp.getEntity());
+ msoLogger.debug(END_OF_THE_TRANSACTION + (String) resp.getEntity());
return resp;
} else {
- Response resp = msoRequest
- .buildServiceErrorResponse(
- bpelStatus,
- MsoException.ServiceException,
- "Request Failed due to BPEL error with HTTP Status= %1",
- ErrorNumbers.SVC_DETAILED_SERVICE_ERROR,
- variables);
- msoLogger.error(MessageEnum.APIH_BPEL_RESPONSE_ERROR,
- requestClient.getUrl(), "", "",
- MsoLogger.ErrorCode.BusinessProcesssError,
- "Response from BPEL engine is empty");
- msoLogger.recordAuditEvent(startTime,
- MsoLogger.StatusCode.ERROR,
- MsoLogger.ResponseCode.InternalError,
+ Response resp = msoRequest.buildServiceErrorResponse(bpelStatus, MsoException.ServiceException,
+ "Request Failed due to BPEL error with HTTP Status= %1",
+ ErrorNumbers.SVC_DETAILED_SERVICE_ERROR, variables);
+ msoLogger.error(MessageEnum.APIH_BPEL_RESPONSE_ERROR, requestClient.getUrl(), "", "",
+ MsoLogger.ErrorCode.BusinessProcesssError, "Response from BPEL engine is empty");
+ msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.InternalError,
"Response from BPEL engine is empty");
- msoLogger
- .debug("End of the transaction, the final response is: "
- + (String) resp.getEntity());
+ msoLogger.debug(END_OF_THE_TRANSACTION + (String) resp.getEntity());
return resp;
}
}
}
- private RecipeLookupResult getServiceInstanceOrchestrationURI(
- CatalogDatabase db, E2EServiceInstanceRequest sir, Action action) {
-
- RecipeLookupResult recipeLookupResult = null;
+ /**
+ * Getting recipes from catalogDb
+ *
+ * @param db
+ * @param action
+ * @return
+ */
+ private RecipeLookupResult getServiceInstanceOrchestrationURI(CatalogDatabase db, Action action) {
- recipeLookupResult = getServiceURI(db, sir, action);
+ RecipeLookupResult recipeLookupResult = getServiceURI(db, action);
if (recipeLookupResult != null) {
- msoLogger.debug ("Orchestration URI is: " + recipeLookupResult.getOrchestrationURI() + ", recipe Timeout is: " + Integer.toString(recipeLookupResult.getRecipeTimeout ()));
- }
- else {
+ msoLogger.debug("Orchestration URI is: " + recipeLookupResult.getOrchestrationURI()
+ + ", recipe Timeout is: " + Integer.toString(recipeLookupResult.getRecipeTimeout()));
+ } else {
msoLogger.debug("No matching recipe record found");
}
return recipeLookupResult;
}
- private RecipeLookupResult getServiceURI(CatalogDatabase db,
- E2EServiceInstanceRequest sir, Action action) {
+ /**
+ * Getting recipes from catalogDb
+ *
+ * @param db
+ * @param action
+ * @return
+ */
+ private RecipeLookupResult getServiceURI(CatalogDatabase db, Action action) {
String defaultServiceModelName = "UUI_DEFAULT";
- Service serviceRecord = null;
- ServiceRecipe recipe = null;
-
- serviceRecord = db.getServiceByModelName(defaultServiceModelName);
- recipe = db.getServiceRecipeByModelUUID(serviceRecord.getModelUUID(), action.name());
+ Service serviceRecord = db.getServiceByModelName(defaultServiceModelName);
+ ServiceRecipe recipe = db.getServiceRecipeByModelUUID(serviceRecord.getModelUUID(), action.name());
if (recipe == null) {
return null;
}
- return new RecipeLookupResult(recipe.getOrchestrationUri(),
- recipe.getRecipeTimeout());
+ return new RecipeLookupResult(recipe.getOrchestrationUri(), recipe.getRecipeTimeout());
}
- private String mappingObtainedRequestJSONToServiceInstanceRequest(E2EServiceInstanceRequest e2eSir){
+ /**
+ * Converting E2EServiceInstanceRequest to ServiceInstanceRequest and
+ * passing it to camunda engine.
+ *
+ * @param e2eSir
+ * @return
+ */
+ private String mapReqJsonToSvcInstReq(E2EServiceInstanceRequest e2eSir, String requestJSON) {
- ServiceInstancesRequest sir = new ServiceInstancesRequest();
+ sir = new ServiceInstancesRequest();
String returnString = null;
RequestDetails requestDetails = new RequestDetails();
ModelInfo modelInfo = new ModelInfo();
-
- //ModelInvariantId
+
+ // ModelInvariantId
modelInfo.setModelInvariantId(e2eSir.getService().getServiceDefId());
-
- //modelNameVersionId
+
+ // modelNameVersionId
modelInfo.setModelNameVersionId(e2eSir.getService().getTemplateId());
-
+
String modelInfoValue = e2eSir.getService().getParameters().getNodeTemplateName();
String[] arrayOfInfo = modelInfoValue.split(":");
String modelName = arrayOfInfo[0];
String modelVersion = arrayOfInfo[1];
-
- //modelName
+
+ // modelName
modelInfo.setModelName(modelName);
-
- //modelVersion
+
+ // modelVersion
modelInfo.setModelVersion(modelVersion);
-
- //modelType
- //if(ModelType.service.equals(e2eSir.getService().getParameters().getNodeType())){
- modelInfo.setModelType(ModelType.service);
- //}
-
- //setting modelInfo to requestDetails
+
+ // modelType
+ modelInfo.setModelType(ModelType.service);
+
+ // setting modelInfo to requestDetails
requestDetails.setModelInfo(modelInfo);
-
+
SubscriberInfo subscriberInfo = new SubscriberInfo();
- //globalsubscriberId
+ // globalsubscriberId
subscriberInfo.setGlobalSubscriberId(e2eSir.getService().getParameters().getGlobalSubscriberId());
- //subscriberName
+ // subscriberName
subscriberInfo.setSubscriberName(e2eSir.getService().getParameters().getSubscriberName());
-
- //setting subscriberInfo to requestDetails
+
+ // setting subscriberInfo to requestDetails
requestDetails.setSubscriberInfo(subscriberInfo);
-
+
RequestInfo requestInfo = new RequestInfo();
-
- //instanceName
+
+ // instanceName
requestInfo.setInstanceName(e2eSir.getService().getName());
- //source
+ // source
requestInfo.setSource("UUI");
- //suppressRollback
+ // suppressRollback
requestInfo.setSuppressRollback(true);
- //setting requestInfo to requestDetails
+ // setting requestInfo to requestDetails
requestDetails.setRequestInfo(requestInfo);
-
+
RequestParameters requestParameters = new RequestParameters();
-
- //subscriptionServiceType
+
+ // subscriptionServiceType
requestParameters.setSubscriptionServiceType("MOG");
- //Userparams
+ // Userparams
List<E2EUserParam> userParams;
userParams = e2eSir.getService().getParameters().getRequestParameters().getUserParams();
List<Map<String, String>> userParamList = new ArrayList<>();
- Map<String,String> userParamMap= new HashMap<>();
- for(E2EUserParam userp: userParams){
+ Map<String, String> userParamMap = new HashMap<>();
+ //complete json request updated in the camunda
+ userParamMap.put("UUIRequest", requestJSON);
+ userParamMap.put("ServiceInstanceName", e2eSir.getService().getName());
+
+ Map<String, String> userParamMap3 = null;
+ for (E2EUserParam userp : userParams) {
userParamMap.put(userp.getName(), userp.getValue());
userParamList.add(userParamMap);
}
requestParameters.setUserParams(userParamList);
-
- //setting requestParameters to requestDetails
+
+ // setting requestParameters to requestDetails
requestDetails.setRequestParameters(requestParameters);
-
+
sir.setRequestDetails(requestDetails);
- //converting to string
+ // converting to string
ObjectMapper mapper = new ObjectMapper();
try {
returnString = mapper.writeValueAsString(sir);
@@ -507,4 +547,42 @@ public class E2EServiceInstances {
return returnString;
}
+
+ private void createOperationStatusRecord(Action action, String requestId) {
+ {
+ AbstractSessionFactoryManager requestsDbSessionFactoryManager = new RequestsDbSessionFactoryManager();
+
+ Session session = null;
+ try {
+
+ session = requestsDbSessionFactoryManager.getSessionFactory().openSession();
+ session.beginTransaction();
+
+ // if (null == sir) {
+ // sir = new ServiceInstancesRequest();
+ // }
+ OperationStatus os = new OperationStatus();
+ os.setOperation(action.name());
+ os.setOperationContent("");
+ os.setOperationId("");
+ os.setProgress("0");
+ os.setReason("");
+ os.setResult("Processing");
+ os.setServiceId(requestId);
+ os.setUserId("");
+ os.setFinishedAt(new Timestamp(System.currentTimeMillis()));
+ os.setOperateAt(new Timestamp(System.currentTimeMillis()));
+
+ session.save(os);
+ session.getTransaction().commit();
+
+ } catch (Exception e) {
+ msoLogger.error (MessageEnum.APIH_DB_INSERT_EXC, "", "", MsoLogger.ErrorCode.DataError, "Exception when creation record request in Operation", e);
+ } finally {
+ if (null != session) {
+ session.close();
+ }
+ }
+ }
+ }
} \ No newline at end of file
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstancesTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstancesTest.java
index 98a2a11800..b247d81d7f 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstancesTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstancesTest.java
@@ -111,7 +111,7 @@ public class E2EServiceInstancesTest {
};
E2EServiceInstances instance = new E2EServiceInstances();
- String request = "{\"service\":{\"name\":\"service\",\"description\":\"so_test1\",\"serviceDefId\":\"modelInvariantId value from SDC?\",\"templateId\":\"modelVersionId value from SDC??\",\"parameters\":{\"domainHost\":\"localhost\",\"nodeTemplateName\":\"modelName:v3\",\"nodeType\":\"service\",\"globalSubscriberId\":\"NEED THIS UUI - AAI\",\"subscriberName\":\"NEED THIS UUI - AAI\",\"requestParameters\":{\"subscriptionServiceType\":\"MOG\",\"userParams\":[{\"name\":\"someUserParam\",\"value\":\"someValue\"},{\"name\":\"segments\",\"value\":\"value\"},{\"name\":\"nsParameters\",\"value\":\"othervalue\"}]}}}}";
+ String request = "{\"service\":{\"name\":\"service\",\"description\":\"so_test1\",\"serviceDefId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"templateId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"parameters\":{\"domainHost\":\"localhost\",\"nodeTemplateName\":\"modelName:v3\",\"nodeType\":\"service\",\"globalSubscriberId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"subscriberName\":\"NEED THIS UUI - AAI\",\"requestParameters\":{\"subscriptionServiceType\":\"MOG\",\"userParams\":[{\"name\":\"someUserParam\",\"value\":\"someValue\"},{\"name\":\"segments\",\"value\":\"value\"},{\"name\":\"nsParameters\",\"value\":\"othervalue\"}]}}}}";
Response resp = instance.createE2EServiceInstance(request, "v3");
String respStr = resp.getEntity().toString();
assertTrue(respStr.indexOf("Exception while creating record in DB null") != -1);
@@ -175,7 +175,7 @@ public class E2EServiceInstancesTest {
};
E2EServiceInstances instance = new E2EServiceInstances();
- String request = "{\"service\":{\"name\":\"service\",\"description\":\"so_test1\",\"serviceDefId\":\"modelInvariantId value from SDC?\",\"templateId\":\"modelVersionId value from SDC??\",\"parameters\":{\"domainHost\":\"localhost\",\"nodeTemplateName\":\"modelName:v3\",\"nodeType\":\"service\",\"globalSubscriberId\":\"NEED THIS UUI - AAI\",\"subscriberName\":\"NEED THIS UUI - AAI\",\"requestParameters\":{\"subscriptionServiceType\":\"MOG\",\"userParams\":[{\"name\":\"someUserParam\",\"value\":\"someValue\"},{\"name\":\"segments\",\"value\":\"value\"},{\"name\":\"nsParameters\",\"value\":\"othervalue\"}]}}}}";
+ String request = "{\"service\":{\"name\":\"service\",\"description\":\"so_test1\",\"serviceDefId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"templateId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"parameters\":{\"domainHost\":\"localhost\",\"nodeTemplateName\":\"modelName:v3\",\"nodeType\":\"service\",\"globalSubscriberId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"subscriberName\":\"NEED THIS UUI - AAI\",\"requestParameters\":{\"subscriptionServiceType\":\"MOG\",\"userParams\":[{\"name\":\"someUserParam\",\"value\":\"someValue\"},{\"name\":\"segments\",\"value\":\"value\"},{\"name\":\"nsParameters\",\"value\":\"othervalue\"}]}}}}";
Response resp = instance.createE2EServiceInstance(request, "v3");
String respStr = resp.getEntity().toString();
assertTrue(respStr.indexOf("Exception while creating record in DB null") != -1);
@@ -239,7 +239,7 @@ public class E2EServiceInstancesTest {
};
E2EServiceInstances instance = new E2EServiceInstances();
- String request = "{\"service\":{\"name\":\"service\",\"description\":\"so_test1\",\"serviceDefId\":\"modelInvariantId value from SDC?\",\"templateId\":\"modelVersionId value from SDC??\",\"parameters\":{\"domainHost\":\"localhost\",\"nodeTemplateName\":\"modelName:v3\",\"nodeType\":\"service\",\"globalSubscriberId\":\"NEED THIS UUI - AAI\",\"subscriberName\":\"NEED THIS UUI - AAI\",\"requestParameters\":{\"subscriptionServiceType\":\"MOG\",\"userParams\":[{\"name\":\"someUserParam\",\"value\":\"someValue\"},{\"name\":\"segments\",\"value\":\"value\"},{\"name\":\"nsParameters\",\"value\":\"othervalue\"}]}}}}";
+ String request = "{\"service\":{\"name\":\"service\",\"description\":\"so_test1\",\"serviceDefId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"templateId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"parameters\":{\"domainHost\":\"localhost\",\"nodeTemplateName\":\"modelName:v3\",\"nodeType\":\"service\",\"globalSubscriberId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"subscriberName\":\"NEED THIS UUI - AAI\",\"requestParameters\":{\"subscriptionServiceType\":\"MOG\",\"userParams\":[{\"name\":\"someUserParam\",\"value\":\"someValue\"},{\"name\":\"segments\",\"value\":\"value\"},{\"name\":\"nsParameters\",\"value\":\"othervalue\"}]}}}}";
Response resp = instance.createE2EServiceInstance(request, "v3");
String respStr = resp.getEntity().toString();
assertTrue(respStr.indexOf("Exception while creating record in DB null") != -1);
@@ -291,7 +291,7 @@ public class E2EServiceInstancesTest {
};
E2EServiceInstances instance = new E2EServiceInstances();
- String request = "{\"service\":{\"name\":\"service\",\"description\":\"so_test1\",\"serviceDefId\":\"modelInvariantId value from SDC?\",\"templateId\":\"modelVersionId value from SDC??\",\"parameters\":{\"domainHost\":\"localhost\",\"nodeTemplateName\":\"modelName:v3\",\"nodeType\":\"service\",\"globalSubscriberId\":\"NEED THIS UUI - AAI\",\"subscriberName\":\"NEED THIS UUI - AAI\",\"requestParameters\":{\"subscriptionServiceType\":\"MOG\",\"userParams\":[{\"name\":\"someUserParam\",\"value\":\"someValue\"},{\"name\":\"segments\",\"value\":\"value\"},{\"name\":\"nsParameters\",\"value\":\"othervalue\"}]}}}}";
+ String request = "{\"service\":{\"name\":\"service\",\"description\":\"so_test1\",\"serviceDefId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"templateId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"parameters\":{\"domainHost\":\"localhost\",\"nodeTemplateName\":\"modelName:v3\",\"nodeType\":\"service\",\"globalSubscriberId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"subscriberName\":\"NEED THIS UUI - AAI\",\"requestParameters\":{\"subscriptionServiceType\":\"MOG\",\"userParams\":[{\"name\":\"someUserParam\",\"value\":\"someValue\"},{\"name\":\"segments\",\"value\":\"value\"},{\"name\":\"nsParameters\",\"value\":\"othervalue\"}]}}}}";
Response resp = instance.createE2EServiceInstance(request, "v3");
String respStr = resp.getEntity().toString();
assertTrue(respStr.indexOf("Exception while creating record in DB null") != -1);
@@ -340,7 +340,7 @@ public class E2EServiceInstancesTest {
};
E2EServiceInstances instance = new E2EServiceInstances();
- String request = "{\"service\":{\"name\":\"service\",\"description\":\"so_test1\",\"serviceDefId\":\"modelInvariantId value from SDC?\",\"templateId\":\"modelVersionId value from SDC??\",\"parameters\":{\"domainHost\":\"localhost\",\"nodeTemplateName\":\"modelName:v3\",\"nodeType\":\"service\",\"globalSubscriberId\":\"NEED THIS UUI - AAI\",\"subscriberName\":\"NEED THIS UUI - AAI\",\"requestParameters\":{\"subscriptionServiceType\":\"MOG\",\"userParams\":[{\"name\":\"someUserParam\",\"value\":\"someValue\"},{\"name\":\"segments\",\"value\":\"value\"},{\"name\":\"nsParameters\",\"value\":\"othervalue\"}]}}}}";
+ String request = "{\"service\":{\"name\":\"service\",\"description\":\"so_test1\",\"serviceDefId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"templateId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"parameters\":{\"domainHost\":\"localhost\",\"nodeTemplateName\":\"modelName:v3\",\"nodeType\":\"service\",\"globalSubscriberId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"subscriberName\":\"NEED THIS UUI - AAI\",\"requestParameters\":{\"subscriptionServiceType\":\"MOG\",\"userParams\":[{\"name\":\"someUserParam\",\"value\":\"someValue\"},{\"name\":\"segments\",\"value\":\"value\"},{\"name\":\"nsParameters\",\"value\":\"othervalue\"}]}}}}";
Response resp = instance.createE2EServiceInstance(request, "v3");
String respStr = resp.getEntity().toString();
assertTrue(respStr.indexOf("Exception while creating record in DB null") != -1);
@@ -370,7 +370,7 @@ public class E2EServiceInstancesTest {
}
};
E2EServiceInstances instance = new E2EServiceInstances();
- String request = "{\"service\":{\"name\":\"service\",\"description\":\"so_test1\",\"serviceDefId\":\"modelInvariantId value from SDC?\",\"templateId\":\"modelVersionId value from SDC??\",\"parameters\":{\"domainHost\":\"localhost\",\"nodeTemplateName\":\"modelName:v3\",\"nodeType\":\"service\",\"globalSubscriberId\":\"NEED THIS UUI - AAI\",\"subscriberName\":\"NEED THIS UUI - AAI\",\"requestParameters\":{\"subscriptionServiceType\":\"MOG\",\"userParams\":[{\"name\":\"someUserParam\",\"value\":\"someValue\"},{\"name\":\"segments\",\"value\":\"value\"},{\"name\":\"nsParameters\",\"value\":\"othervalue\"}]}}}}";
+ String request = "{\"service\":{\"name\":\"service\",\"description\":\"so_test1\",\"serviceDefId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"templateId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"parameters\":{\"domainHost\":\"localhost\",\"nodeTemplateName\":\"modelName:v3\",\"nodeType\":\"service\",\"globalSubscriberId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"subscriberName\":\"NEED THIS UUI - AAI\",\"requestParameters\":{\"subscriptionServiceType\":\"MOG\",\"userParams\":[{\"name\":\"someUserParam\",\"value\":\"someValue\"},{\"name\":\"segments\",\"value\":\"value\"},{\"name\":\"nsParameters\",\"value\":\"othervalue\"}]}}}}";
Response resp = instance.createE2EServiceInstance(request, "v3");
String respStr = resp.getEntity().toString();
assertTrue(respStr.indexOf("Exception while creating record in DB null") != -1);
@@ -401,7 +401,7 @@ public class E2EServiceInstancesTest {
}
};
E2EServiceInstances instance = new E2EServiceInstances();
- String request = "{\"service\":{\"name\":\"service\",\"description\":\"so_test1\",\"serviceDefId\":\"modelInvariantId value from SDC?\",\"templateId\":\"modelVersionId value from SDC??\",\"parameters\":{\"domainHost\":\"localhost\",\"nodeTemplateName\":\"modelName:v3\",\"nodeType\":\"service\",\"globalSubscriberId\":\"NEED THIS UUI - AAI\",\"subscriberName\":\"NEED THIS UUI - AAI\",\"requestParameters\":{\"subscriptionServiceType\":\"MOG\",\"userParams\":[{\"name\":\"someUserParam\",\"value\":\"someValue\"},{\"name\":\"segments\",\"value\":\"value\"},{\"name\":\"nsParameters\",\"value\":\"othervalue\"}]}}}}";
+ String request = "{\"service\":{\"name\":\"service\",\"description\":\"so_test1\",\"serviceDefId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"templateId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"parameters\":{\"domainHost\":\"localhost\",\"nodeTemplateName\":\"modelName:v3\",\"nodeType\":\"service\",\"globalSubscriberId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"subscriberName\":\"NEED THIS UUI - AAI\",\"requestParameters\":{\"subscriptionServiceType\":\"MOG\",\"userParams\":[{\"name\":\"someUserParam\",\"value\":\"someValue\"},{\"name\":\"segments\",\"value\":\"value\"},{\"name\":\"nsParameters\",\"value\":\"othervalue\"}]}}}}";
Response resp = instance.createE2EServiceInstance(request, "v3");
String respStr = resp.getEntity().toString();
//assertTrue(respStr.indexOf("Recipe could not be retrieved from catalog DB ") !=-1);
@@ -422,7 +422,7 @@ public class E2EServiceInstancesTest {
}
};
E2EServiceInstances instance = new E2EServiceInstances();
- String request = "{\"service\":{\"name\":\"service\",\"description\":\"so_test1\",\"serviceDefId\":\"modelInvariantId value from SDC?\",\"templateId\":\"modelVersionId value from SDC??\",\"parameters\":{\"domainHost\":\"localhost\",\"nodeTemplateName\":\"modelName:v3\",\"nodeType\":\"service\",\"globalSubscriberId\":\"NEED THIS UUI - AAI\",\"subscriberName\":\"NEED THIS UUI - AAI\",\"requestParameters\":{\"subscriptionServiceType\":\"MOG\",\"userParams\":[{\"name\":\"someUserParam\",\"value\":\"someValue\"},{\"name\":\"segments\",\"value\":\"value\"},{\"name\":\"nsParameters\",\"value\":\"othervalue\"}]}}}}";
+ String request = "{\"service\":{\"name\":\"service\",\"description\":\"so_test1\",\"serviceDefId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"templateId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"parameters\":{\"domainHost\":\"localhost\",\"nodeTemplateName\":\"modelName:v3\",\"nodeType\":\"service\",\"globalSubscriberId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"subscriberName\":\"NEED THIS UUI - AAI\",\"requestParameters\":{\"subscriptionServiceType\":\"MOG\",\"userParams\":[{\"name\":\"someUserParam\",\"value\":\"someValue\"},{\"name\":\"segments\",\"value\":\"value\"},{\"name\":\"nsParameters\",\"value\":\"othervalue\"}]}}}}";
Response resp = instance.createE2EServiceInstance(request, "v3");
String respStr = resp.getEntity().toString();
assertTrue(respStr.indexOf("The existing request must finish or be cleaned up before proceeding.") != -1);
@@ -437,7 +437,7 @@ public class E2EServiceInstancesTest {
}
};
E2EServiceInstances instance = new E2EServiceInstances();
- String request = "{\"service\":{\"name\":\"service\",\"description\":\"so_test1\",\"serviceDefId\":\"modelInvariantId value from SDC?\",\"templateId\":\"modelVersionId value from SDC??\",\"parameters\":{\"domainHost\":\"localhost\",\"nodeTemplateName\":\"modelName:v3\",\"nodeType\":\"service\",\"globalSubscriberId\":\"NEED THIS UUI - AAI\",\"subscriberName\":\"NEED THIS UUI - AAI\",\"requestParameters\":{\"subscriptionServiceType\":\"MOG\",\"userParams\":[{\"name\":\"someUserParam\",\"value\":\"someValue\"},{\"name\":\"segments\",\"value\":\"value\"},{\"name\":\"nsParameters\",\"value\":\"othervalue\"}]}}}}";
+ String request = "{\"service\":{\"name\":\"service\",\"description\":\"so_test1\",\"serviceDefId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"templateId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"parameters\":{\"domainHost\":\"localhost\",\"nodeTemplateName\":\"modelName:v3\",\"nodeType\":\"service\",\"globalSubscriberId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"subscriberName\":\"NEED THIS UUI - AAI\",\"requestParameters\":{\"subscriptionServiceType\":\"MOG\",\"userParams\":[{\"name\":\"someUserParam\",\"value\":\"someValue\"},{\"name\":\"segments\",\"value\":\"value\"},{\"name\":\"nsParameters\",\"value\":\"othervalue\"}]}}}}";
Response resp = instance.createE2EServiceInstance(request, "v3");
String respStr = resp.getEntity().toString();
//assertTrue(respStr.indexOf("Recipe could not be retrieved from catalog DB ") != -1);
@@ -447,7 +447,7 @@ public class E2EServiceInstancesTest {
@Test
public void createE2EServiceInstanceTestDBQueryFail(){
E2EServiceInstances instance = new E2EServiceInstances();
- String request = "{\"service\":{\"name\":\"service\",\"description\":\"so_test1\",\"serviceDefId\":\"modelInvariantId value from SDC?\",\"templateId\":\"modelVersionId value from SDC??\",\"parameters\":{\"domainHost\":\"localhost\",\"nodeTemplateName\":\"modelName:v3\",\"nodeType\":\"service\",\"globalSubscriberId\":\"NEED THIS UUI - AAI\",\"subscriberName\":\"NEED THIS UUI - AAI\",\"requestParameters\":{\"subscriptionServiceType\":\"MOG\",\"userParams\":[{\"name\":\"someUserParam\",\"value\":\"someValue\"},{\"name\":\"segments\",\"value\":\"value\"},{\"name\":\"nsParameters\",\"value\":\"othervalue\"}]}}}}";
+ String request = "{\"service\":{\"name\":\"service\",\"description\":\"so_test1\",\"serviceDefId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"templateId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"parameters\":{\"domainHost\":\"localhost\",\"nodeTemplateName\":\"modelName:v3\",\"nodeType\":\"service\",\"globalSubscriberId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"subscriberName\":\"NEED THIS UUI - AAI\",\"requestParameters\":{\"subscriptionServiceType\":\"MOG\",\"userParams\":[{\"name\":\"someUserParam\",\"value\":\"someValue\"},{\"name\":\"segments\",\"value\":\"value\"},{\"name\":\"nsParameters\",\"value\":\"othervalue\"}]}}}}";
Response resp = instance.createE2EServiceInstance(request, "v3");
String respStr = resp.getEntity().toString();
assertTrue(respStr.indexOf("SVC2000") != -1);
@@ -465,7 +465,7 @@ public class E2EServiceInstancesTest {
@Test
public void deleteE2EServiceInstanceTestNormal(){
E2EServiceInstances instance = new E2EServiceInstances();
- String request = "{\"service\":{\"name\":\"service\",\"description\":\"so_test1\",\"serviceDefId\":\"modelInvariantId value from SDC?\",\"templateId\":\"modelVersionId value from SDC??\",\"parameters\":{\"domainHost\":\"localhost\",\"nodeTemplateName\":\"modelName:v3\",\"nodeType\":\"service\",\"globalSubscriberId\":\"NEED THIS UUI - AAI\",\"subscriberName\":\"NEED THIS UUI - AAI\",\"requestParameters\":{\"subscriptionServiceType\":\"MOG\",\"userParams\":[{\"name\":\"someUserParam\",\"value\":\"someValue\"},{\"name\":\"segments\",\"value\":\"value\"},{\"name\":\"nsParameters\",\"value\":\"othervalue\"}]}}}}";
+ String request = "{\"service\":{\"name\":\"service\",\"description\":\"so_test1\",\"serviceDefId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"templateId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"parameters\":{\"domainHost\":\"localhost\",\"nodeTemplateName\":\"modelName:v3\",\"nodeType\":\"service\",\"globalSubscriberId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"subscriberName\":\"NEED THIS UUI - AAI\",\"requestParameters\":{\"subscriptionServiceType\":\"MOG\",\"userParams\":[{\"name\":\"someUserParam\",\"value\":\"someValue\"},{\"name\":\"segments\",\"value\":\"value\"},{\"name\":\"nsParameters\",\"value\":\"othervalue\"}]}}}}";
Response resp = instance.deleteE2EServiceInstance(request, "v3", "12345678");
String respStr = resp.getEntity().toString();
assertTrue(respStr.indexOf("SVC2000") != -1);