summaryrefslogtreecommitdiffstats
path: root/bpmn
diff options
context:
space:
mode:
Diffstat (limited to 'bpmn')
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerClient.java4
-rw-r--r--bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/CamundaDBSetup.java11
-rw-r--r--bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/PropertyConfiguration.java22
-rw-r--r--bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/ReadConfigTask.java3
-rw-r--r--bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/ReadFileTask.java5
-rw-r--r--bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/XQueryScriptTask.java7
-rw-r--r--bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/json/JsonUtils.java20
-rw-r--r--bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/xml/XmlTool.java15
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateGenericE2EServiceInstance.groovy160
-rw-r--r--bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/FileUtil.java21
-rw-r--r--bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/SDNCAdapterMockTransformer.java2
-rw-r--r--bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/SDNCAdapterNetworkTopologyMockTransformer.java6
-rw-r--r--bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/VnfAdapterCreateMockTransformer.java6
-rw-r--r--bpmn/MSORESTClient/src/main/java/org/openecomp/mso/rest/HostNameVerifier.java6
14 files changed, 242 insertions, 46 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerClient.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerClient.java
index e8dc5af90c..e9752e04cf 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerClient.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerClient.java
@@ -37,9 +37,12 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
+import org.openecomp.mso.logger.MsoLogger;
public class ApplicationControllerClient {
+ private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA);
+
private static final int ACCEPT_SERIES = 100;
private static final int ERROR_SERIES = 200;
private static final int REJECT_SERIES = 300;
@@ -113,6 +116,7 @@ public class ApplicationControllerClient {
requestObject.getClass().getDeclaredMethod("setActionIdentifiers", ActionIdentifiers.class)
.invoke(requestObject, identifier);
} catch (IllegalAccessException | NoSuchMethodException | InvocationTargetException e) {
+ LOGGER.debug("Exception:", e);
throw new Exception("Error Building AppC Request: " + e.getMessage());
}
return requestObject;
diff --git a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/CamundaDBSetup.java b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/CamundaDBSetup.java
index 74bb59c908..d505210abd 100644
--- a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/CamundaDBSetup.java
+++ b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/CamundaDBSetup.java
@@ -13,12 +13,19 @@ import org.openecomp.mso.logger.MsoLogger;
public class CamundaDBSetup {
private static boolean isDBConfigured = false;
private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL);
+
+ private CamundaDBSetup() {
+ /**
+ * Constructor.
+ */
+ }
+
public static synchronized void configure() throws SQLException {
if (isDBConfigured) {
return;
}
- System.out.println("Configuring the Camunda H2 database for MSO");
+ LOGGER.debug ("Configuring the Camunda H2 database for MSO");
Connection connection = null;
PreparedStatement stmt = null;
@@ -67,7 +74,7 @@ public class CamundaDBSetup {
isDBConfigured = true;
} catch (SQLException e) {
- System.out.println("CamundaDBSetup caught " + e.getClass().getSimpleName());
+ LOGGER.debug ("CamundaDBSetup caught " + e.getClass().getSimpleName());
LOGGER.debug("SQLException :",e);
} finally {
if (stmt != null) {
diff --git a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/PropertyConfiguration.java b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/PropertyConfiguration.java
index 70f67a5a77..4e67bd171d 100644
--- a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/PropertyConfiguration.java
+++ b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/PropertyConfiguration.java
@@ -85,15 +85,22 @@ public class PropertyConfiguration {
private volatile String msoConfigPath = null;
private final ConcurrentHashMap<String, Map<String, String>> propFileCache =
- new ConcurrentHashMap<String, Map<String, String>>();
+ new ConcurrentHashMap<>();
private final Object CACHELOCK = new Object();
private FileWatcherThread fileWatcherThread = null;
// The key is the file name
- private Map<String, TimerTask> timerTaskMap = new HashMap<String, TimerTask>();
+ private Map<String, TimerTask> timerTaskMap = new HashMap<>();
/**
+ * Private Constructor.
+ */
+ private PropertyConfiguration() {
+ startUp();
+ }
+
+ /**
* Singleton holder pattern eliminates locking when accessing the instance
* and still provides for lazy initialization.
*/
@@ -112,14 +119,7 @@ public class PropertyConfiguration {
* Returns the list of supported files.
*/
public static List<String> supportedFiles() {
- return new ArrayList<String>(SUPPORTED_FILES);
- }
-
- /**
- * Private Constructor.
- */
- private PropertyConfiguration() {
- startUp();
+ return new ArrayList<>(SUPPORTED_FILES);
}
/**
@@ -245,7 +245,7 @@ public class PropertyConfiguration {
String fileName = file.getName();
LOGGER.debug("Reading " + fileName);
- Map<String, String> properties = new HashMap<String, String>();
+ Map<String, String> properties = new HashMap<>();
Properties newProperties = new Properties();
FileReader reader = null;
diff --git a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/ReadConfigTask.java b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/ReadConfigTask.java
index e9110eb88c..6249040342 100644
--- a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/ReadConfigTask.java
+++ b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/ReadConfigTask.java
@@ -3,6 +3,7 @@
* ONAP - SO
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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.
@@ -86,7 +87,7 @@ public class ReadConfigTask extends BaseTask {
try {
stream.close();
} catch (Exception e) {
- // Do nothing
+ msoLogger.debug("Exception:", e);
}
}
}
diff --git a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/ReadFileTask.java b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/ReadFileTask.java
index 041b3e3d03..6b3cb5a1db 100644
--- a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/ReadFileTask.java
+++ b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/ReadFileTask.java
@@ -3,6 +3,7 @@
* ONAP - SO
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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.
@@ -102,14 +103,14 @@ public class ReadFileTask extends BaseTask {
try {
xmlStream.close();
} catch (Exception e) {
- // Do nothing
+ msoLogger.debug("Exception ", e);
}
}
}
}
execution.setVariable(theInputVariable, value);
execution.setVariable(theOutputVariable, value);
- System.out.println("ServiceInput - " + execution.getVariable("gServiceInput"));
+ msoLogger.debug ("ServiceInput - " + execution.getVariable("gServiceInput"));
if (msoLogger.isDebugEnabled()) {
msoLogger.debug("Done Executing " + getTaskName());
}
diff --git a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/XQueryScriptTask.java b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/XQueryScriptTask.java
index b454450a63..4b34ddf0f0 100644
--- a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/XQueryScriptTask.java
+++ b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/XQueryScriptTask.java
@@ -3,6 +3,7 @@
* ONAP - SO
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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.
@@ -85,7 +86,7 @@ public class XQueryScriptTask extends BaseTask {
getStringField(outputVariable, execution, "outputVariable");
if (msoLogger.isDebugEnabled()) {
- System.out.println("scriptFile = " + theScriptFile
+ msoLogger.debug ("scriptFile = " + theScriptFile
+ " xmlInputVariables = " + theXmlInputVariables
+ " atomicInputVariables = " + theAtomicInputVariables
+ "outputVariable = " + theOutputVariable);
@@ -141,7 +142,7 @@ public class XQueryScriptTask extends BaseTask {
for (String atomicInputVariable : atomicInputVariableArray) {
if (msoLogger.isDebugEnabled()) {
- System.out.println("Injecting object variable '"
+ msoLogger.debug ("Injecting object variable '"
+ atomicInputVariable + "'");
}
@@ -235,7 +236,7 @@ public class XQueryScriptTask extends BaseTask {
try {
xqStream.close();
} catch (Exception e) {
- // Do nothing
+ msoLogger.debug ("Exception:", e);
}
}
}
diff --git a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/json/JsonUtils.java b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/json/JsonUtils.java
index 54a5732e1c..9dbd4b171d 100644
--- a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/json/JsonUtils.java
+++ b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/json/JsonUtils.java
@@ -144,7 +144,7 @@ public class JsonUtils {
jsonObj = (JSONObject) obj;
keys = jsonObj.keys();
while (keys.hasNext()) {
- key = keys.next().toString();
+ key = keys.next();
// msoLogger.debug("toXMLString(): key is " + k);
curObj = jsonObj.opt(key);
if (curObj == null) {
@@ -327,7 +327,7 @@ public class JsonUtils {
return null;
} else {
if (rawValue instanceof String) {
- msoLogger.debug("getJsonValue(): the raw value is a String Object=" + ((String) rawValue).toString());
+ msoLogger.debug("getJsonValue(): the raw value is a String Object=" + ((String) rawValue));
return (String) rawValue;
} else {
msoLogger.debug("getJsonValue(): the raw value is NOT a String Object=" + rawValue.toString());
@@ -356,7 +356,7 @@ public class JsonUtils {
return null;
} else {
if (rawValue instanceof String) {
- msoLogger.debug("getJsonNodeValue(): the raw value is a String Object=" + ((String) rawValue).toString());
+ msoLogger.debug("getJsonNodeValue(): the raw value is a String Object=" + ((String) rawValue));
return (String) rawValue;
} else {
msoLogger.debug("getJsonNodeValue(): the raw value is NOT a String Object=" + rawValue.toString());
@@ -410,14 +410,13 @@ public class JsonUtils {
* @return boolean field value associated with keys - default is false
*/
public static boolean getJsonBooleanValue(String jsonStr, String keys) {
- String isDebugLogEnabled = "true";
try {
Object rawValue = getJsonRawValue(jsonStr, keys);
if (rawValue == null) {
return false;
} else {
if (rawValue instanceof Boolean) {
- msoLogger.debug("getJsonValue(): the raw value is a Boolean Object=" + ((String) rawValue).toString());
+ msoLogger.debug("getJsonValue(): the raw value is a Boolean Object=" + ((String) rawValue));
return (Boolean) rawValue;
} else {
msoLogger.debug("getJsonValue(): the raw value is NOT an Boolean Object=" + rawValue.toString());
@@ -590,7 +589,7 @@ public class JsonUtils {
try {
if (jsonObj.has(key)) {
msoLogger.debug("getJsonValueForKey(): found value for key=" + key);
- return ((Integer) jsonObj.get(key));
+ return (Integer) jsonObj.get(key);
} else {
msoLogger.debug("getJsonValueForKey(): iterating over the keys");
Iterator <String> itr = jsonObj.keys();
@@ -628,12 +627,11 @@ public class JsonUtils {
* @return String field value associated with key
*/
public static Boolean getJsonBooleanValueForKey(JSONObject jsonObj, String key) {
- String isDebugLogEnabled = "true";
Boolean keyValue = false;
try {
if (jsonObj.has(key)) {
msoLogger.debug("getJsonBooleanValueForKey(): found value for key=" + key);
- return ((Boolean) jsonObj.get(key));
+ return (Boolean) jsonObj.get(key);
} else {
msoLogger.debug("getJsonBooleanValueForKey(): iterating over the keys");
Iterator <String> itr = jsonObj.keys();
@@ -863,7 +861,7 @@ public class JsonUtils {
public Map<String, String> entryArrayToMap(Execution execution, String entryArray) {
msoLogger.debug("Started Entry Array To Map Util Method");
- Map<String, String> map = new HashMap<String, String>();
+ Map<String, String> map = new HashMap<>();
//Populate Map
String entryListJson = "{ \"entry\":" + entryArray + "}";
@@ -895,7 +893,7 @@ public class JsonUtils {
public Map<String, String> entryArrayToMap(Execution execution, String entryArray, String keyNode, String valueNode) {
msoLogger.debug("Started Entry Array To Map Util Method");
- Map<String, String> map = new HashMap<String, String>();
+ Map<String, String> map = new HashMap<>();
//Populate Map
String entryListJson = "{ \"entry\":" + entryArray + "}";
JSONObject obj = new JSONObject(entryListJson);
@@ -926,7 +924,7 @@ public class JsonUtils {
public List<String> StringArrayToList(Execution execution, String jsonArrayOfStrings) {
msoLogger.debug("Started String Array To List Util Method");
- List<String> list = new ArrayList<String>();
+ List<String> list = new ArrayList<>();
//Populate List
String stringListJson = "{ \"strings\":" + jsonArrayOfStrings + "}";
JSONObject obj = new JSONObject(stringListJson);
diff --git a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/xml/XmlTool.java b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/xml/XmlTool.java
index 7b6d429912..1cf434052c 100644
--- a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/xml/XmlTool.java
+++ b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/xml/XmlTool.java
@@ -3,6 +3,7 @@
* ONAP - SO
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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.
@@ -60,7 +61,7 @@ import org.xml.sax.SAXException;
*/
public final class XmlTool {
- private static final Map<String, Integer> ENTITIES = new HashMap<String, Integer>();
+ private static final Map<String, Integer> ENTITIES = new HashMap<>();
private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.BPEL);
static {
ENTITIES.put("amp", new Integer(38));
@@ -70,6 +71,12 @@ public final class XmlTool {
}
/**
+ * Instantiation is not allowed.
+ */
+ private XmlTool() {
+ }
+
+ /**
* Normalizes and formats XML. This method consolidates and moves all namespace
* declarations to the root element. The result will not have an XML prolog or
* a trailing newline.
@@ -377,10 +384,4 @@ public final class XmlTool {
// return the modified String representation of the XML
return Optional.of(writer.toString().trim());
}
-
- /**
- * Instantiation is not allowed.
- */
- private XmlTool() {
- }
}
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateGenericE2EServiceInstance.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateGenericE2EServiceInstance.groovy
new file mode 100644
index 0000000000..3302210416
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateGenericE2EServiceInstance.groovy
@@ -0,0 +1,160 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - SO
+ * ================================================================================
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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.infrastructure.scripts;
+
+import static org.apache.commons.lang3.StringUtils.*;
+import groovy.xml.XmlUtil
+import groovy.json.*
+import org.openecomp.mso.bpmn.common.scripts.AbstractServiceTaskProcessor
+import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil
+import org.openecomp.mso.bpmn.common.scripts.VidUtils
+import org.openecomp.mso.bpmn.core.WorkflowException
+import org.openecomp.mso.bpmn.core.json.JsonUtils
+import org.openecomp.mso.rest.APIResponse
+
+import java.util.UUID;
+
+import org.camunda.bpm.engine.delegate.BpmnError
+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
+
+/**
+ * This groovy class supports the <class>CreateGenericE2EServiceInstance.bpmn</class> process.
+ * flow for E2E ServiceInstance Create
+ */
+public class CreateGenericE2EServiceInstance extends AbstractServiceTaskProcessor {
+
+ ExceptionUtil exceptionUtil = new ExceptionUtil()
+
+ JsonUtils jsonUtil = new JsonUtils()
+
+ VidUtils vidUtils = new VidUtils()
+
+ /**
+ * Pre Process the BPMN Flow Request
+ * Inclouds:
+ * Deal with the parameters
+ * generate the service instance id
+ * generate the operation id
+ */
+ public void preProcessRequest (Execution execution) {
+ def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+ String msg = ""
+ utils.log("DEBUG", " *** preProcessRequest() *** ", isDebugEnabled)
+ try {
+
+ String siRequest = execution.getVariable("bpmnRequest")
+ utils.logAudit(siRequest)
+
+ String requestId = execution.getVariable("mso-request-id")
+ execution.setVariable("msoRequestId", requestId)
+ utils.log("DEBUG", "Input Request:" + siRequest + " reqId:" + requestId, isDebugEnabled)
+
+ String serviceInstanceId = execution.getVariable("serviceInstanceId")
+ if (isBlank(serviceInstanceId)) {
+ serviceInstanceId = UUID.randomUUID().toString()
+ }
+ utils.log("DEBUG", "Generated new Service Instance:" + serviceInstanceId, isDebugEnabled)
+ serviceInstanceId = UriUtils.encode(serviceInstanceId,"UTF-8")
+ execution.setVariable("serviceInstanceId", serviceInstanceId)
+
+ String operationId = execution.getVariable("operationId")
+ if (isBlank(operationId)) {
+ operationId = UUID.randomUUID().toString()
+ }
+ utils.log("DEBUG", "Generated new Service Instance Operation:" + operationId, isDebugEnabled)
+ serviceInstanceId = UriUtils.encode(operationId,"UTF-8")
+ execution.setVariable("operationId", operationId)
+ //subscriberInfo, TBD , there is no globalSubscriberId in R1 for E2E Service.
+ //requestInfo TBD , there is no requestDetails for R1 E2E service
+
+ //TBD need to insert operationInfo to RequestDb
+
+ //set service Instance Name
+ execution.setVariable("serviceInstanceName", jsonUtil.getJsonValue(siRequest, "service.name"))
+ execution.setVariable("serviceDescription", jsonUtil.getJsonValue(siRequest, "service.description"))
+ execution.setVariable("templateId", jsonUtil.getJsonValue(siRequest, "service.templateId"))
+
+ //serviceParamters
+ String serviceParamters = jsonUtil.getJsonValue(siRequest, "service.parameters")
+ if (isBlank(serviceParamters)) {
+ msg = "Input service paramters is null"
+ utils.log("DEBUG", msg, isDebugEnabled)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
+ } else
+ {
+ execution.setVariable("serviceParamters", serviceParamters)
+ }
+
+ utils.log("DEBUG", "service parameters:" + serviceParamters, isDebugEnabled)
+ } catch (BpmnError e) {
+ throw e;
+ } catch (Exception ex){
+ msg = "Exception in preProcessRequest " + ex.getMessage()
+ utils.log("DEBUG", msg, isDebugEnabled)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+ }
+ utils.log("DEBUG"," ***** Exit preProcessRequest *****", isDebugEnabled)
+ }
+
+ /**
+ * send the sync response
+ * the response incloudes the instance id and the operation id
+ */
+ public void sendSyncResponse(Execution execution) {
+ def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+ utils.log("DEBUG", " *** sendSyncResponse *** ", isDebugEnabled)
+
+ try {
+ String requestId = execution.getVariable("msoRequestId")
+ String serviceInstanceId = execution.getVariable("serviceInstanceId")
+ String operationId = execution.getVariable("operationId")
+ // RESTResponse for API Handler (APIH) Reply Task
+ String createServiceRestResponse = """{"service":{"serviceId":"${serviceInstanceId}","operationId":"${operationId}"}}""".trim()
+ utils.log("DEBUG", " sendSyncResponse to APIH:" + "\n" + createServiceRestResponse, isDebugEnabled)
+ sendWorkflowResponse(execution, 202, createServiceRestResponse)
+ execution.setVariable("sentSyncResponse", true)
+
+ } catch (Exception ex) {
+ String msg = "Exceptuion in sendSyncResponse:" + ex.getMessage()
+ utils.log("DEBUG", msg, isDebugEnabled)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+ }
+ utils.log("DEBUG"," ***** Exit sendSyncResopnse *****", isDebugEnabled)
+ }
+
+ public void preCreateRequest(Execution execution) {
+ }
+
+ public void postConfigRequest(Execution execution) {
+ }
+
+ public void preVFCRequest(Execution execution) {
+ }
+
+ public void preAdaptorDataRequest(Execution execution) {
+ }
+
+ public void preSDNCRequest(Execution execution) {
+ }
+}
diff --git a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/FileUtil.java b/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/FileUtil.java
index a2076331a3..40539fa1bd 100644
--- a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/FileUtil.java
+++ b/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/FileUtil.java
@@ -2,7 +2,8 @@
* ============LICENSE_START=======================================================
* ONAP - SO
* ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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.
@@ -22,9 +23,26 @@ package org.openecomp.mso.bpmn.mock;
import java.io.IOException;
import java.io.InputStream;
+import org.openecomp.mso.logger.MsoLogger;
+/**
+ *
+ * File utility class.<br/>
+ * <p>
+ * </p>
+ *
+ * @author
+ * @version ONAP Sep 15, 2017
+ */
public class FileUtil {
+ private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA);
+
+ private FileUtil() {
+ /**
+ * Constructor.
+ */
+ }
/**
* Read the specified resource file and return the contents as a String.
*
@@ -42,6 +60,7 @@ public class FileUtil {
stream.close();
return new String(bytes);
} catch (IOException e) {
+ LOGGER.debug("Exception:", e);
return "";
}
}
diff --git a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/SDNCAdapterMockTransformer.java b/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/SDNCAdapterMockTransformer.java
index 1f17a8bf31..848751f055 100644
--- a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/SDNCAdapterMockTransformer.java
+++ b/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/SDNCAdapterMockTransformer.java
@@ -127,7 +127,7 @@ public class SDNCAdapterMockTransformer extends ResponseTransformer {
} catch (InterruptedException e1) {
LOGGER.debug("Exception :",e1);
}
- System.out.println("Sending callback response:" + callbackUrl);
+ LOGGER.debug("Sending callback response:" + callbackUrl);
ClientRequest request = new ClientRequest(callbackUrl);
request.body("text/xml", payLoad);
System.err.println(payLoad);
diff --git a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/SDNCAdapterNetworkTopologyMockTransformer.java b/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/SDNCAdapterNetworkTopologyMockTransformer.java
index b782c05d38..36abbdc5ca 100644
--- a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/SDNCAdapterNetworkTopologyMockTransformer.java
+++ b/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/SDNCAdapterNetworkTopologyMockTransformer.java
@@ -117,16 +117,16 @@ public class SDNCAdapterNetworkTopologyMockTransformer extends ResponseTransform
// TODO Auto-generated catch block
LOGGER.debug("Exception :",e1);
}
- System.out.println("Sending callback response to url: " + callbackUrl);
+ LOGGER.debug("Sending callback response to url: " + callbackUrl);
ClientRequest request = new ClientRequest(callbackUrl);
request.body("text/xml", payLoad);
//System.err.println(payLoad);
try {
ClientResponse result = request.post();
- System.out.println("Successfully posted callback? Status: " + result.getStatus());
+ LOGGER.debug("Successfully posted callback? Status: " + result.getStatus());
} catch (Exception e) {
// TODO Auto-generated catch block
- System.out.println("catch error in - request.post() ");
+ LOGGER.debug("catch error in - request.post() ");
LOGGER.debug("Exception :",e);
}
}
diff --git a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/VnfAdapterCreateMockTransformer.java b/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/VnfAdapterCreateMockTransformer.java
index ebedca8550..5bcab6a2ab 100644
--- a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/VnfAdapterCreateMockTransformer.java
+++ b/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/VnfAdapterCreateMockTransformer.java
@@ -132,18 +132,18 @@ public class VnfAdapterCreateMockTransformer extends ResponseTransformer {
// TODO Auto-generated catch block
LOGGER.debug("Exception :",e1);
}
- System.out.println("Sending callback response to url: " + callbackUrl);
+ LOGGER.debug("Sending callback response to url: " + callbackUrl);
ClientRequest request = new ClientRequest(callbackUrl);
request.body("text/xml", payLoad);
//System.out.println("payLoad: " + payLoad);
try {
ClientResponse result = request.post();
- System.out.println("Successfully posted callback? Status: " + result.getStatus());
+ LOGGER.debug("Successfully posted callback? Status: " + result.getStatus());
//System.err.println("Successfully posted callback:" + result.getStatus());
} catch (Exception e) {
// TODO Auto-generated catch block
- System.out.println("catch error in - request.post() ");
+ LOGGER.debug("catch error in - request.post() ");
LOGGER.debug("Exception :",e);
}
}
diff --git a/bpmn/MSORESTClient/src/main/java/org/openecomp/mso/rest/HostNameVerifier.java b/bpmn/MSORESTClient/src/main/java/org/openecomp/mso/rest/HostNameVerifier.java
index 81a2bd3b96..ffef5f9385 100644
--- a/bpmn/MSORESTClient/src/main/java/org/openecomp/mso/rest/HostNameVerifier.java
+++ b/bpmn/MSORESTClient/src/main/java/org/openecomp/mso/rest/HostNameVerifier.java
@@ -3,6 +3,7 @@
* ONAP - SO
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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.
@@ -23,6 +24,7 @@ package org.openecomp.mso.rest;
import javax.net.ssl.SSLException;
import org.apache.http.conn.ssl.AbstractVerifier;
+import org.openecomp.mso.logger.MsoLogger;
/**
* @version 1.0
@@ -31,6 +33,8 @@ import org.apache.http.conn.ssl.AbstractVerifier;
*/
public class HostNameVerifier extends AbstractVerifier {
+ private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA);
+
public final void verify(
final String host,
final String[] cns,
@@ -38,7 +42,7 @@ public class HostNameVerifier extends AbstractVerifier {
try {
verify(host, cns, subjectAlts, true);
} catch (SSLException sex) {
-
+ LOGGER.debug("Exception:", sex);
}
}