* 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.
try {
LOGGER.debug("Current stack " + this.getOutputsAsStringBuilder(heatStack).toString());
} catch (Exception e) {
- LOGGER.debug("an error occurred trying to print out the current outputs of the stack");
+ LOGGER.debug("an error occurred trying to print out the current outputs of the stack", e);
}
if ("CREATE_IN_PROGRESS".equals (heatStack.getStackStatus ())) {
} catch (MsoException me2) {
// We got an exception on the delete - don't throw this exception - throw the original - just log.
- LOGGER.debug("Exception thrown trying to delete " + canonicalName + " on a create->rollback: " + me2.getContextMessage());
+ LOGGER.debug("Exception thrown trying to delete " + canonicalName + " on a create->rollback: " + me2.getContextMessage(), me2);
LOGGER.warn(MessageEnum.RA_CREATE_STACK_ERR, "Create Stack errored, then stack deletion FAILED - exception thrown", "", "", MsoLogger.ErrorCode.BusinessProcesssError, me2.getContextMessage());
}
String str = this.convertNode((JsonNode) obj);
inputs.put(key, str);
} catch (Exception e) {
- LOGGER.debug("DANGER WILL ROBINSON: unable to convert value for JsonNode "+ key);
+ LOGGER.debug("DANGER WILL ROBINSON: unable to convert value for JsonNode "+ key, e);
//effect here is this value will not have been copied to the inputs - and therefore will error out downstream
}
} else if (obj instanceof java.util.LinkedHashMap) {
String str = JSON_MAPPER.writeValueAsString(obj);
inputs.put(key, str);
} catch (Exception e) {
- LOGGER.debug("DANGER WILL ROBINSON: unable to convert value for LinkedHashMap "+ key);
+ LOGGER.debug("DANGER WILL ROBINSON: unable to convert value for LinkedHashMap "+ key, e);
}
} else if (obj instanceof Integer) {
try {
String str = "" + obj;
inputs.put(key, str);
} catch (Exception e) {
- LOGGER.debug("DANGER WILL ROBINSON: unable to convert value for Integer "+ key);
+ LOGGER.debug("DANGER WILL ROBINSON: unable to convert value for Integer "+ key, e);
}
} else {
try {
String str = obj.toString();
inputs.put(key, str);
} catch (Exception e) {
- LOGGER.debug("DANGER WILL ROBINSON: unable to convert value for Other "+ key +" (" + e.getMessage() + ")");
+ LOGGER.debug("DANGER WILL ROBINSON: unable to convert value for Other "+ key +" (" + e.getMessage() + ")", e);
//effect here is this value will not have been copied to the inputs - and therefore will error out downstream
}
}
String str = params.get(key).toString();
sb.append("\n" + key + "=" + str);
} catch (Exception e) {
- //non fatal
+ LOGGER.debug("Exception :",e);
}
}
}
final String json = JSON_MAPPER.writeValueAsString(obj);
return json;
} catch (JsonParseException jpe) {
- LOGGER.debug("Error converting json to string " + jpe.getMessage());
+ LOGGER.debug("Error converting json to string " + jpe.getMessage(), jpe);
} catch (Exception e) {
- LOGGER.debug("Error converting json to string " + e.getMessage());
+ LOGGER.debug("Error converting json to string " + e.getMessage(), e);
}
return "[Error converting json to string]";
}
String str = JSON_MAPPER.writeValueAsString(obj);
sb.append(str + " (a java.util.LinkedHashMap)");
} catch (Exception e) {
+ LOGGER.debug("Exception :",e);
sb.append("(a LinkedHashMap value that would not convert nicely)");
}
} else if (obj instanceof Integer) {
try {
str = obj.toString() + " (an Integer)\n";
} catch (Exception e) {
+ LOGGER.debug("Exception :",e);
str = "(an Integer unable to call .toString() on)";
}
sb.append(str);
try {
str = obj.toString() + " (an ArrayList)";
} catch (Exception e) {
+ LOGGER.debug("Exception :",e);
str = "(an ArrayList unable to call .toString() on?)";
}
sb.append(str);
try {
str = obj.toString() + " (a Boolean)";
} catch (Exception e) {
+ LOGGER.debug("Exception :",e);
str = "(an Boolean unable to call .toString() on?)";
}
sb.append(str);
try {
str = obj.toString() + " (unknown Object type)";
} catch (Exception e) {
+ LOGGER.debug("Exception :",e);
str = "(a value unable to call .toString() on?)";
}
sb.append(str);
String jsonString = lhm.toString();
jsonNode = new ObjectMapper().readTree(jsonString);
} catch (Exception e) {
- LOGGER.debug("Unable to convert " + lhm.toString() + " to a JsonNode " + e.getMessage());
+ LOGGER.debug("Unable to convert " + lhm.toString() + " to a JsonNode " + e.getMessage(), e);
jsonNode = null;
}
return jsonNode;
Set<HeatTemplateParam> paramSet = template.getParameters();
LOGGER.debug("paramSet has " + paramSet.size() + " entries");
} catch (Exception e) {
- LOGGER.debug("Exception occurred in convertInputMap:" + e.getMessage());
+ LOGGER.debug("Exception occurred in convertInputMap:" + e.getMessage(), e);
}
for (HeatTemplateParam htp : template.getParameters()) {
try {
anInteger = Integer.parseInt(integerString);
} catch (Exception e) {
- LOGGER.debug("Unable to convert " + integerString + " to an integer!!");
+ LOGGER.debug("Unable to convert " + integerString + " to an integer!!", e);
anInteger = null;
}
if (anInteger != null) {
try {
jsonNode = new ObjectMapper().readTree(jsonString);
} catch (Exception e) {
- LOGGER.debug("Unable to convert " + jsonString + " to a JsonNode!!");
+ LOGGER.debug("Unable to convert " + jsonString + " to a JsonNode!!", e);
jsonNode = null;
}
if (jsonNode != null) {
else
newInputs.put(key, anArrayList);
} catch (Exception e) {
- LOGGER.debug("Unable to convert " + commaSeparated + " to an ArrayList!!");
+ LOGGER.debug("Unable to convert " + commaSeparated + " to an ArrayList!!", e);
if (alias)
newInputs.put(realName, commaSeparated);
else
* 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.
try {
LOGGER.debug("Current stack " + this.getOutputsAsStringBuilder(heatStack).toString());
} catch (Exception e) {
- LOGGER.debug("an error occurred trying to print out the current outputs of the stack");
+ LOGGER.debug("an error occurred trying to print out the current outputs of the stack", e);
}
String str = JSON_MAPPER.writeValueAsString(obj);
sb.append(str + " (a java.util.LinkedHashMap)");
} catch (Exception e) {
+ LOGGER.debug("Exception :", e);
sb.append("(a LinkedHashMap value that would not convert nicely)");
}
} else if (obj instanceof Integer) {
try {
str = obj.toString() + " (an Integer)\n";
} catch (Exception e) {
+ LOGGER.debug("Exception :", e);
str = "(an Integer unable to call .toString() on)";
}
sb.append(str);
try {
str = obj.toString() + " (an ArrayList)";
} catch (Exception e) {
+ LOGGER.debug("Exception :", e);
str = "(an ArrayList unable to call .toString() on?)";
}
sb.append(str);
try {
str = obj.toString() + " (a Boolean)";
} catch (Exception e) {
+ LOGGER.debug("Exception :", e);
str = "(an Boolean unable to call .toString() on?)";
}
sb.append(str);
try {
str = obj.toString() + " (unknown Object type)";
} catch (Exception e) {
+ LOGGER.debug("Exception :", e);
str = "(a value unable to call .toString() on?)";
}
sb.append(str);
final String json = JSON_MAPPER.writeValueAsString(obj);
return json;
} catch (JsonParseException jpe) {
- LOGGER.debug("Error converting json to string " + jpe.getMessage());
+ LOGGER.debug("Error converting json to string " + jpe.getMessage(), jpe);
} catch (Exception e) {
- LOGGER.debug("Error converting json to string " + e.getMessage());
+ LOGGER.debug("Error converting json to string " + e.getMessage(), e);
}
return "[Error converting json to string]";
}
* 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.
* 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.
package org.openecomp.mso.adapters.vnfrest;
+import org.openecomp.mso.logger.MsoLogger;
+
import java.util.Map;
import org.codehaus.jackson.map.ObjectMapper;
import org.jboss.resteasy.annotations.providers.NoJackson;
-
+import org.openecomp.mso.logger.MsoLogger;
import org.openecomp.mso.openstack.beans.VnfStatus;
@XmlRootElement(name = "queryVfModuleResponse")
@NoJackson
public class QueryVfModuleResponse {
+ private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA);
private String vnfId;
private String vfModuleId;
private String vfModuleStackId;
ObjectMapper mapper = new ObjectMapper();
jsonString = mapper.writeValueAsString(this);
}
- catch (Exception e) {}
+ catch (Exception e) {
+ LOGGER.debug("Exception :",e);
+ }
return jsonString;
}
}
* 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.
import org.codehaus.jackson.map.SerializationConfig;
import org.jboss.resteasy.annotations.providers.NoJackson;
+import org.openecomp.mso.logger.MsoLogger;
+
import org.openecomp.mso.openstack.beans.VnfStatus;
@XmlRootElement(name = "queryVolumeGroupResponse")
@NoJackson
public class QueryVolumeGroupResponse {
+ private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA);
private String volumeGroupId;
private String volumeGroupStackId;
private VnfStatus volumeGroupStatus;
mapper.enable(SerializationConfig.Feature.WRAP_ROOT_VALUE);
jsonString = mapper.writeValueAsString(this);
}
- catch (Exception e) {}
+ catch (Exception e) {
+ LOGGER.debug("Exception :",e);
+ }
return jsonString;
}
}
* 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.
import javax.xml.bind.JAXBContext;
import javax.xml.bind.Marshaller;
+import org.openecomp.mso.logger.MsoLogger;
+
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.map.SerializationConfig;
* except for QueryVfModuleResponse and QueryVolumeGroupResponse.
*/
public abstract class VfResponseCommon {
+ private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA);
private String messageId;
public VfResponseCommon() {
jsonString = mapper.writeValueAsString(this);
return jsonString;
} catch (Exception e) {
- // Shouldn't happen...
- e.printStackTrace();
+ LOGGER.debug("Exception :",e);
return "";
}
}
marshaller.marshal(this, bs);
return bs.toString();
} catch (Exception e) {
- // Shouldn't happen...
- e.printStackTrace();
+ LOGGER.debug("Exception :",e);
return "";
}
}
* 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.
try {
EntityUtils.consume(httpResponse.getEntity());
} catch (Exception e) {
- // Ignore
+ LOGGER.debug("Exception :",e);
}
}
try {
method.reset();
} catch (Exception e) {
- // Ignore
+ LOGGER.debug("Exception :",e);
}
}
* 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.
contentType = ContentType.parse(contentTypeHeader);
} catch (Exception e) {
// If we don't get a valid one, we handle it below.
+ LOGGER.debug("Exception :",e);
}
}
* 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.
try {
return UriUtils.encodePathSegment(pathSegment, "UTF-8");
} catch (UnsupportedEncodingException e) {
- throw new RuntimeException("UTF-8 encoding is not supported");
+ throw new RuntimeException("UTF-8 encoding is not supported",e);
}
}
* ONAP - SO\r
* ================================================================================\r
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.\r
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.\r
* ================================================================================\r
* Licensed under the Apache License, Version 2.0 (the "License");\r
* you may not use this file except in compliance with the License.\r
outFile.write(payloadBytes, 0, payloadBytes.length);\r
outFile.close();\r
} catch (Exception e) { \r
- e.printStackTrace();\r
+ LOGGER.debug("Exception :",e);\r
LOGGER.error(MessageEnum.ASDC_ARTIFACT_DOWNLOAD_FAIL,\r
artifact.getArtifactName (),\r
artifact.getArtifactURL (),\r
* 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.
import org.openecomp.mso.db.catalog.beans.ServiceToNetworks;
import org.openecomp.mso.db.catalog.beans.VnfResource;
+import org.openecomp.mso.logger.MsoLogger;
/**
* This structure exists to avoid having issues if the order of the vfResource/vfmodule artifact is not good (tree structure).
*
*/
public final class VfResourceStructure {
+
+ protected static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.ASDC);
private boolean isDeployedSuccessfully=false;
/**
return listVFModuleMetaData;
} catch (JsonParseException e) {
- e.printStackTrace();
+ LOGGER.debug("JsonParseException : ",e);
} catch (JsonMappingException e) {
- e.printStackTrace();
+ LOGGER.debug("JsonMappingException : ",e);
} catch (IOException e) {
- e.printStackTrace();
+ LOGGER.debug("IOException : ",e);
}
return null;
}
* ONAP - SO\r
* ================================================================================\r
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.\r
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.\r
* ================================================================================\r
* Licensed under the Apache License, Version 2.0 (the "License");\r
* you may not use this file except in compliance with the License.\r
vfResourceStructure.setSuccessfulDeployment();\r
\r
}catch(Exception e){\r
- System.out.println("Exception" + e.getMessage());\r
- e.printStackTrace();\r
+ logger.debug("Exception :",e);\r
\r
Throwable dbExceptionToCapture = e;\r
while (!(dbExceptionToCapture instanceof ConstraintViolationException || dbExceptionToCapture instanceof LockAcquisitionException)\r
* 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.
import java.util.List;
import java.util.Map;
+import org.openecomp.mso.logger.MsoLogger;
import org.openecomp.sdc.api.notification.INotificationData;
private static Map<Object, List<Method>> objectMethodsToLog = new HashMap<>();
+ protected static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.ASDC);
+
private static InvocationHandler handler = new InvocationHandler() {
@Override
public Object invoke(Object arg0, Method arg1, Object[] arg2)
buffer.append(testNull(m.invoke(iNotif, (Object[])null)));
} catch (IllegalAccessException | IllegalArgumentException
| InvocationTargetException e) {
+ LOGGER.debug("Exception :"+e);
buffer.append("UNREADABLE");
}
buffer.append(System.lineSeparator());
<classifier>tests</classifier>\r
<scope>test</scope>\r
</dependency>\r
+ <dependency>\r
+ <groupId>org.openecomp.so</groupId>\r
+ <artifactId>common</artifactId>\r
+ <version>${project.version}</version>\r
+ </dependency>\r
<dependency>\r
<groupId>javax.ws.rs</groupId>\r
<artifactId>javax.ws.rs-api</artifactId>\r
* ONAP - SO\r
* ================================================================================\r
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.\r
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.\r
* ================================================================================\r
* Licensed under the Apache License, Version 2.0 (the "License");\r
* you may not use this file except in compliance with the License.\r
package org.openecomp.mso.bpmn.common.util;\r
\r
import java.security.GeneralSecurityException;\r
+import org.openecomp.mso.logger.MsoLogger;\r
\r
public class CryptoHandler implements ICryptoHandler {\r
+ private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL);\r
\r
private static String msoKey = "aa3871669d893c7fb8abbcda31b88b4f";\r
//private static String msoAaiPwd = "mso0206";\r
try {\r
return CryptoUtils.decrypt(msoAaiEncryptedPwd, msoKey);\r
} catch (GeneralSecurityException e) {\r
+ LOGGER.debug("GeneralSecurityException :",e);\r
return null;\r
}\r
}\r
try {\r
return CryptoUtils.encrypt(plainMsoPwd, msoKey);\r
} catch (GeneralSecurityException e) {\r
+ LOGGER.debug("GeneralSecurityException :",e);\r
return null;\r
}\r
}\r
try {\r
return CryptoUtils.decrypt(encryptedPwd, msoKey);\r
} catch (GeneralSecurityException e) {\r
+ LOGGER.debug("GeneralSecurityException :",e);\r
return null;\r
}\r
}\r
logCallbackSuccess(method, startTime);\r
return new CallbackSuccess();\r
} catch (Exception e) {\r
+ LOGGER.debug("Exception :",e);\r
String msg = "Caught " + e.getClass().getSimpleName()\r
+ " processing " + messageEventName + " with " + correlationVariable\r
+ " = '" + correlationValue + "'";\r
* ONAP - SO\r
* ================================================================================\r
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.\r
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.\r
* ================================================================================\r
* Licensed under the Apache License, Version 2.0 (the "License");\r
* you may not use this file except in compliance with the License.\r
workflowResponse.setMessageCode(500);\r
return Response.status(500).entity(workflowResponse).build();\r
} catch (Exception ex) {\r
- msoLogger.debug(LOGMARKER + "Exception in startProcessInstance by key");\r
- ex.printStackTrace();\r
+ msoLogger.debug(LOGMARKER + "Exception in startProcessInstance by key",ex);\r
workflowResponse.setMessage("Fail" );\r
workflowResponse.setResponse("Error occurred while executing the process: " + ex.getMessage());\r
if (processInstance != null) workflowResponse.setProcessInstanceID(processInstance.getId());\r
try {\r
return pes.getRuntimeService().createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult() == null ? true : false ;\r
} catch (Exception e) {\r
+ msoLogger.debug("Exception :",e);\r
return true;\r
} \r
}\r
+ processKey \r
+ " with response: " \r
+ response.getResponse());\r
- \r
+ msoLogger.debug("Exception :",ex);\r
}\r
\r
msoLogger.recordMetricEvent ( startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, \r
import java.sql.PreparedStatement;
import java.sql.SQLException;
+import org.openecomp.mso.logger.MsoLogger;
+
/**
* Sets up the unit test (H2) database for Camunda.
*/
public class CamundaDBSetup {
private static boolean isDBConfigured = false;
-
+ private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL);
public static synchronized void configure() throws SQLException {
if (isDBConfigured) {
return;
isDBConfigured = true;
} catch (SQLException e) {
System.out.println("CamundaDBSetup caught " + e.getClass().getSimpleName());
- e.printStackTrace();
+ LOGGER.debug("SQLException :",e);
} finally {
if (stmt != null) {
try {
stmt.close();
} catch (Exception e) {
- // Ignore
+ LOGGER.debug("Exception :",e);
}
}
try {
connection.close();
} catch (Exception e) {
- // Ignore
+ LOGGER.debug("Exception :",e);
}
}
}
* 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.
UUID uuid = UUID.fromString(id);
return uuid.toString().equalsIgnoreCase(id);
} catch (IllegalArgumentException iae) {
+ msoLogger.debug("IllegalArgumentException :",iae);
return false;
}
}
* 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.
fileWatcherThread.join(waitInSeconds * 1000);
} catch (InterruptedException e) {
LOGGER.debug("FileWatcherThread " + System.identityHashCode(fileWatcherThread)
- + " shutdown did not occur within " + waitInSeconds + " seconds");
+ + " shutdown did not occur within " + waitInSeconds + " seconds",e);
}
LOGGER.debug("Finished shutting down FileWatcherThread " + System.identityHashCode(fileWatcherThread));
reader.close();
LOGGER.debug("Closed " + fileName);
} catch (Exception e) {
- // Ignore
+ LOGGER.debug("Exception :",e);
}
}
}
}
}
} catch (InterruptedException e) {
+ LOGGER.debug("InterruptedException :",e);
break;
} catch (ClosedWatchServiceException e) {
LOGGER.info(
MessageEnum.BPMN_GENERAL_INFO,
"BPMN",
"FileWatcherThread shut down because the watch service was closed");
+ LOGGER.debug("ClosedWatchServiceException :",e);
break;
} catch (Exception e) {
LOGGER.error(
watchService.close();
} catch (IOException e) {
LOGGER.debug("FileWatcherThread caught " + e.getClass().getSimpleName()
- + " while closing the watch service");
+ + " while closing the watch service",e);
}
LOGGER.info(MessageEnum.BPMN_GENERAL_INFO, "BPMN",
import java.util.Map;
import java.util.Properties;
+import org.openecomp.mso.logger.MsoLogger;
+
import org.openecomp.mso.bpmn.core.PropertyConfiguration;
/**
private static Path bpmnPropertiesPath = null;
private static Path bpmnUrnPropertiesPath = null;
private static boolean modifiedConfiguration = false;
+
+ private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL);
/**
* Ensures that the the PropertyConfiguration is initialized and that the
try {
fileReader.close();
} catch (IOException e) {
- // Ignore
+ LOGGER.debug("Exception :",e);
}
}
try {
outputStream.close();
} catch (IOException e) {
- // Ignore
+ LOGGER.debug("Exception :",e);
}
}
}
try {
fileReader.close();
} catch (IOException e) {
- // Ignore
+ LOGGER.debug("Exception :",e);
}
}
try {
outputStream.close();
} catch (IOException e) {
- // Ignore
+ LOGGER.debug("Exception :",e);
}
}
}
import com.fasterxml.jackson.databind.SerializationFeature;\r
import com.fasterxml.jackson.databind.annotation.JsonSerialize;\r
\r
-\r
+import org.openecomp.mso.logger.MsoLogger;\r
//import org.codehaus.jackson.map.SerializationConfig.Feature;\r
\r
\r
@JsonInclude(Include.NON_NULL)\r
public abstract class JsonWrapper implements Serializable {\r
\r
+ private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL);\r
@JsonInclude(Include.NON_NULL)\r
public String toJsonString(){\r
\r
// }\r
} catch (Exception e){\r
\r
- e.printStackTrace();\r
+ LOGGER.debug("Exception :",e);\r
}\r
return jsonString;\r
}\r
try {\r
json = new JSONObject(mapper.writeValueAsString(this));\r
} catch (JsonGenerationException e) {\r
- // TODO Auto-generated catch block\r
- e.printStackTrace();\r
+ LOGGER.debug("Exception :",e);\r
} catch (JsonMappingException e) {\r
- // TODO Auto-generated catch block\r
- e.printStackTrace();\r
+ LOGGER.debug("Exception :",e);\r
} catch (JSONException e) {\r
- // TODO Auto-generated catch block\r
- e.printStackTrace();\r
+ LOGGER.debug("Exception :",e);\r
} catch (IOException e) {\r
- // TODO Auto-generated catch block\r
- e.printStackTrace();\r
+ LOGGER.debug("Exception :",e);\r
}\r
return json; \r
}\r
try {\r
jsonString = mapper.writeValueAsString(list);\r
} catch (JsonGenerationException e) {\r
- // TODO Auto-generated catch block\r
- e.printStackTrace();\r
+ LOGGER.debug("Exception :",e);\r
} catch (JsonMappingException e) {\r
- // TODO Auto-generated catch block\r
- e.printStackTrace();\r
+ LOGGER.debug("Exception :",e);\r
} catch (IOException e) {\r
- // TODO Auto-generated catch block\r
- e.printStackTrace();\r
+ LOGGER.debug("Exception :",e);\r
}\r
return jsonString;\r
}\r
jsonString = ow.writeValueAsString(this);\r
} catch (Exception e){\r
\r
- e.printStackTrace();\r
+ LOGGER.debug("Exception :",e);\r
}\r
return jsonString;\r
}\r
import com.fasterxml.jackson.databind.JsonMappingException;\r
import com.fasterxml.jackson.databind.ObjectMapper;\r
\r
+import org.openecomp.mso.logger.MsoLogger;\r
+\r
public class DecomposeJsonUtil implements Serializable {\r
- \r
+ private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL);\r
/**\r
* \r
*/\r
try {\r
serviceDecomposition = om.readValue(jsonString, ServiceDecomposition.class);\r
} catch (JsonParseException e) {\r
- // TODO Auto-generated catch block\r
- e.printStackTrace();\r
+ LOGGER.debug("JsonParseException :",e);\r
} catch (JsonMappingException e) {\r
- // TODO Auto-generated catch block\r
- e.printStackTrace();\r
+ LOGGER.debug("JsonMappingException :",e);\r
} catch (IOException e) {\r
- // TODO Auto-generated catch block\r
- e.printStackTrace();\r
+ LOGGER.debug("IOException :",e);\r
}\r
\r
return serviceDecomposition;\r
try {\r
vnfResource = om.readValue(jsonString, VnfResource.class);\r
} catch (JsonParseException e) {\r
- // TODO Auto-generated catch block\r
- e.printStackTrace();\r
+ LOGGER.debug("JsonParseException :",e);\r
} catch (JsonMappingException e) {\r
- // TODO Auto-generated catch block\r
- e.printStackTrace();\r
+ LOGGER.debug("JsonMappingException :",e);\r
} catch (IOException e) {\r
- // TODO Auto-generated catch block\r
- e.printStackTrace();\r
+ LOGGER.debug("IOException :",e);\r
}\r
return vnfResource;\r
}\r
try {\r
networkResource = om.readValue(jsonString, NetworkResource.class);\r
} catch (JsonParseException e) {\r
- // TODO Auto-generated catch block\r
- e.printStackTrace();\r
+ LOGGER.debug("Exception :",e);\r
} catch (JsonMappingException e) {\r
- // TODO Auto-generated catch block\r
- e.printStackTrace();\r
+ LOGGER.debug("Exception :",e);\r
} catch (IOException e) {\r
- // TODO Auto-generated catch block\r
- e.printStackTrace();\r
+ LOGGER.debug("Exception :",e);\r
}\r
return networkResource;\r
}\r
try {\r
allottedResource = om.readValue(jsonString, AllottedResource.class);\r
} catch (JsonParseException e) {\r
- // TODO Auto-generated catch block\r
- e.printStackTrace();\r
+ LOGGER.debug("Exception :",e);\r
} catch (JsonMappingException e) {\r
- // TODO Auto-generated catch block\r
- e.printStackTrace();\r
+ LOGGER.debug("Exception :",e);\r
} catch (IOException e) {\r
- // TODO Auto-generated catch block\r
- e.printStackTrace();\r
+ LOGGER.debug("Exception :",e);\r
}\r
return allottedResource;\r
}\r
* ONAP - SO\r
* ================================================================================\r
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.\r
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.\r
* ================================================================================\r
* Licensed under the Apache License, Version 2.0 (the "License");\r
* you may not use this file except in compliance with the License.\r
return jsonObj.toString(MSOJsonIndentFactor);\r
}\r
} catch (Exception e){\r
- msoLogger.debug("xml2json(): unable to parse xml and convert to json. Exception was: " + e.toString());\r
+ msoLogger.debug("xml2json(): unable to parse xml and convert to json. Exception was: " + e.toString(), e);\r
return null;\r
}\r
}\r
return toXMLString(jsonObj, null);\r
}\r
} catch (Exception e){\r
- msoLogger.debug("json2xml(): unable to parse json and convert to xml. Exception was: " + e.toString());\r
+ msoLogger.debug("json2xml(): unable to parse json and convert to xml. Exception was: " + e.toString(), e);\r
return null;\r
}\r
}\r
JSONObject jsonObj = new JSONObject(jsonStr);\r
return jsonObj.toString(MSOJsonIndentFactor);\r
} catch (Exception e){\r
- msoLogger.debug("prettyJson(): unable to parse/format json input. Exception was: " + e.toString());\r
+ msoLogger.debug("prettyJson(): unable to parse/format json input. Exception was: " + e.toString(), e);\r
return null;\r
}\r
}\r
}\r
}\r
} catch (Exception e) {\r
- msoLogger.debug("getJsonValue(): unable to parse json to retrieve value for field=" + keys + ". Exception was: " + e.toString());\r
+ msoLogger.debug("getJsonValue(): unable to parse json to retrieve value for field=" + keys + ". Exception was: " + e.toString(),e);\r
}\r
return null;\r
}\r
}\r
}\r
} catch (Exception e) {\r
- msoLogger.debug("getJsonNodeValue(): unable to parse json to retrieve node for field=" + keys + ". Exception was: " + e.toString());\r
+ msoLogger.debug("getJsonNodeValue(): unable to parse json to retrieve node for field=" + keys + ". Exception was: " + e.toString(), e);\r
}\r
return null;\r
}\r
}\r
}\r
} catch (Exception e) {\r
- msoLogger.debug("getJsonValue(): unable to parse json to retrieve value for field=" + keys + ". Exception was: " + e.toString());\r
+ msoLogger.debug("getJsonValue(): unable to parse json to retrieve value for field=" + keys + ". Exception was: " + e.toString(), e);\r
}\r
return 0;\r
}\r
}\r
}\r
} catch (Exception e) {\r
- msoLogger.debug("getJsonValue(): unable to parse json to retrieve value for field=" + keys + ". Exception was: " + e.toString());\r
+ msoLogger.debug("getJsonValue(): unable to parse json to retrieve value for field=" + keys + ". Exception was: " + e.toString(),e);\r
}\r
return false;\r
}\r
}\r
} catch (JSONException je) {\r
// JSONObject::get() throws this exception if one of the specified keys is not found\r
- msoLogger.debug("getJsonParamValue(): caught JSONException attempting to retrieve param value for keys:" + keys + ", name=" + name);\r
+ msoLogger.debug("getJsonParamValue(): caught JSONException attempting to retrieve param value for keys:" + keys + ", name=" + name, je);\r
} catch (Exception e) {\r
- msoLogger.debug("getJsonParamValue(): unable to parse json to retrieve value for field=" + keys + ". Exception was: " + e.toString());\r
+ msoLogger.debug("getJsonParamValue(): unable to parse json to retrieve value for field=" + keys + ". Exception was: " + e.toString(), e);\r
}\r
return null;\r
}\r
return getJsonValueForKey(jsonObj, key);\r
}\r
} catch (Exception e) {\r
- msoLogger.debug("getJsonValueForKey(): unable to parse json to retrieve value for field=" + key + ". Exception was: " + e.toString());\r
+ msoLogger.debug("getJsonValueForKey(): unable to parse json to retrieve value for field=" + key + ". Exception was: " + e.toString(), e);\r
}\r
return null;\r
}\r
}\r
} catch (JSONException je) {\r
// JSONObject::get() throws this exception if one of the specified keys is not found\r
- msoLogger.debug("getJsonValueForKey(): caught JSONException attempting to retrieve value for key=" + key);\r
+ msoLogger.debug("getJsonValueForKey(): caught JSONException attempting to retrieve value for key=" + key, je);\r
keyValue = null;\r
} catch (Exception e) {\r
- msoLogger.debug("getJsonValueForKey(): unable to parse json to retrieve value for field=" + key + ". Exception was: " + e.toString());\r
+ msoLogger.debug("getJsonValueForKey(): unable to parse json to retrieve value for field=" + key + ". Exception was: " + e.toString(), e);\r
}\r
return keyValue;\r
}\r
}\r
} catch (JSONException je) {\r
// JSONObject::get() throws this exception if one of the specified keys is not found\r
- msoLogger.debug("getJsonValueForKey(): caught JSONException attempting to retrieve value for key=" + key);\r
+ msoLogger.debug("getJsonValueForKey(): caught JSONException attempting to retrieve value for key=" + key, je);\r
keyValue = null;\r
} catch (Exception e) {\r
- msoLogger.debug("getJsonValueForKey(): unable to parse json to retrieve value for field=" + key + ". Exception was: " + e.toString());\r
+ msoLogger.debug("getJsonValueForKey(): unable to parse json to retrieve value for field=" + key + ". Exception was: " + e.toString(),e);\r
}\r
return keyValue;\r
}\r
}\r
} catch (JSONException je) {\r
// JSONObject::get() throws this exception if one of the specified keys is not found\r
- msoLogger.debug("getJsonBooleanValueForKey(): caught JSONException attempting to retrieve value for key=" + key);\r
+ msoLogger.debug("getJsonBooleanValueForKey(): caught JSONException attempting to retrieve value for key=" + key,je);\r
keyValue = null;\r
} catch (Exception e) {\r
- msoLogger.debug("getJsonBooleanValueForKey(): unable to parse json to retrieve value for field=" + key + ". Exception was: " + e.toString());\r
+ msoLogger.debug("getJsonBooleanValueForKey(): unable to parse json to retrieve value for field=" + key + ". Exception was: " + e.toString(),e);\r
}\r
return keyValue;\r
}\r
\r
} catch (JSONException je) {\r
// JSONObject::get() throws this exception if one of the specified keys is not found\r
- msoLogger.debug("getJsonRawValue(): caught JSONException attempting to retrieve raw value for key=" + keyStr);\r
+ msoLogger.debug("getJsonRawValue(): caught JSONException attempting to retrieve raw value for key=" + keyStr,je);\r
} catch (Exception e) {\r
- msoLogger.debug("getJsonRawValue(): unable to parse json to retrieve value for field=" + keys + ". Exception was: " + e.toString());\r
+ msoLogger.debug("getJsonRawValue(): unable to parse json to retrieve value for field=" + keys + ". Exception was: " + e.toString(),e);\r
}\r
return null;\r
}\r
\r
} catch (JSONException je) {\r
// JSONObject::get() throws this exception if one of the specified keys is not found\r
- msoLogger.debug("putJsonValue(): caught JSONException attempting to retrieve value for key=" + keyStr);\r
+ msoLogger.debug("putJsonValue(): caught JSONException attempting to retrieve value for key=" + keyStr,je);\r
return null;\r
} catch (Exception e) {\r
- msoLogger.debug("putJsonValue(): unable to parse json to put value for key=" + keys + ". Exception was: " + e.toString());\r
+ msoLogger.debug("putJsonValue(): unable to parse json to put value for key=" + keys + ". Exception was: " + e.toString(),e);\r
}\r
return null;\r
}\r
return true;\r
}\r
} catch (Exception e) {\r
- msoLogger.debug("jsonElementExist(): unable to determine if json element exist. Exception is: " + e.toString());\r
+ msoLogger.debug("jsonElementExist(): unable to determine if json element exist. Exception is: " + e.toString(),e);\r
}\r
return true;\r
}\r
import com.fasterxml.jackson.databind.ObjectWriter;\r
import com.fasterxml.jackson.databind.SerializationFeature;\r
\r
+import org.openecomp.mso.logger.MsoLogger;\r
+\r
@JsonInclude(Include.NON_NULL)\r
public abstract class JsonWrapper implements Serializable {\r
\r
\r
private static final long serialVersionUID = 8633550139273639875L;\r
\r
+ private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL);\r
@JsonInclude(Include.NON_NULL)\r
public String toJsonString(){\r
\r
// }\r
} catch (Exception e){\r
\r
- e.printStackTrace();\r
+ LOGGER.debug("Exception :",e);\r
}\r
return jsonString;\r
}\r
try {\r
json = new JSONObject(mapper.writeValueAsString(this));\r
} catch (JsonGenerationException e) {\r
- // TODO Auto-generated catch block\r
- e.printStackTrace();\r
+ LOGGER.debug("Exception :",e);\r
} catch (JsonMappingException e) {\r
- // TODO Auto-generated catch block\r
- e.printStackTrace();\r
+ LOGGER.debug("Exception :",e);\r
} catch (JSONException e) {\r
- // TODO Auto-generated catch block\r
- e.printStackTrace();\r
+ LOGGER.debug("Exception :",e);\r
} catch (IOException e) {\r
- // TODO Auto-generated catch block\r
- e.printStackTrace();\r
+ LOGGER.debug("Exception :",e);\r
} \r
return json; \r
}\r
try {\r
jsonString = mapper.writeValueAsString(list);\r
} catch (JsonGenerationException e) {\r
- // TODO Auto-generated catch block\r
- e.printStackTrace();\r
+ LOGGER.debug("Exception :",e);\r
} catch (JsonMappingException e) {\r
- // TODO Auto-generated catch block\r
- e.printStackTrace();\r
+ LOGGER.debug("Exception :",e);\r
} catch (IOException e) {\r
- // TODO Auto-generated catch block\r
- e.printStackTrace();\r
+ LOGGER.debug("Exception :",e);\r
}\r
return jsonString;\r
}\r
jsonString = ow.writeValueAsString(this);\r
} catch (Exception e){\r
\r
- e.printStackTrace();\r
+ LOGGER.debug("Exception :",e);\r
}\r
return jsonString;\r
}\r
</exclusion>
</exclusions>
</dependency>
+ <dependency>
+ <groupId>org.openecomp.so</groupId>
+ <artifactId>common</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
* ============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.
import org.jboss.resteasy.client.ClientRequest;
import org.jboss.resteasy.client.ClientResponse;
+import org.openecomp.mso.logger.MsoLogger;
import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder;
import com.github.tomakehurst.wiremock.common.FileSource;
import com.github.tomakehurst.wiremock.http.Request;
import com.github.tomakehurst.wiremock.http.ResponseDefinition;
+import org.openecomp.mso.logger.MsoLogger;
/**
*
* Simulates SDNC Adapter Callback response
*/
public class SDNCAdapterMockTransformer extends ResponseTransformer {
+ private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL);
private String callbackResponse;
private String requestId;
//Delay sending callback response
sleep(delay);
} catch (InterruptedException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
+ LOGGER.debug("Exception :",e1);
}
System.out.println("Sending callback response:" + callbackUrl);
ClientRequest request = new ClientRequest(callbackUrl);
ClientResponse result = request.post();
//System.err.println("Successfully posted callback:" + result.getStatus());
} catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ LOGGER.debug("Exception :",e);
}
}
* ============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.
import com.github.tomakehurst.wiremock.http.Request;
import com.github.tomakehurst.wiremock.http.ResponseDefinition;
+import org.openecomp.mso.logger.MsoLogger;
+
public class SDNCAdapterNetworkTopologyMockTransformer extends ResponseTransformer {
+ private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL);
+
private String callbackResponse;
private String requestId;
sleep(delay);
} catch (InterruptedException e1) {
// TODO Auto-generated catch block
- e1.printStackTrace();
+ LOGGER.debug("Exception :",e1);
}
System.out.println("Sending callback response to url: " + callbackUrl);
ClientRequest request = new ClientRequest(callbackUrl);
} catch (Exception e) {
// TODO Auto-generated catch block
System.out.println("catch error in - request.post() ");
- e.printStackTrace();
+ LOGGER.debug("Exception :",e);
}
}
* 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.
import org.jboss.resteasy.client.ClientRequest;
import org.jboss.resteasy.client.ClientResponse;
+import org.openecomp.mso.logger.MsoLogger;
import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder;
import com.github.tomakehurst.wiremock.common.FileSource;
import com.github.tomakehurst.wiremock.http.Request;
import com.github.tomakehurst.wiremock.http.ResponseDefinition;
+import org.openecomp.mso.logger.MsoLogger;
/**
* Please describe the VnfAdapterCreateMockTransformer.java class
*
*/
public class VnfAdapterCreateMockTransformer extends ResponseTransformer {
+ private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL);
+
private String notifyCallbackResponse;
private String ackResponse;
responseMessageId = ackResponse.substring(ackResponse.indexOf("<messageId>")+11, ackResponse.indexOf("</messageId>"));
updatedResponse = ackResponse.replace(responseMessageId, messageId);
} catch (Exception ex) {
+ LOGGER.debug("Exception :",ex);
System.out.println(" ******* Use default response file in '__files/vnfAdapterMocks/vnfCreateSimResponse.xml'");
responseMessageId = notifyCallbackResponse.substring(notifyCallbackResponse.indexOf("<messageId>")+11, notifyCallbackResponse.indexOf("</messageId>"));
updatedResponse = notifyCallbackResponse.replace(responseMessageId, messageId);
sleep(delay);
} catch (InterruptedException e1) {
// TODO Auto-generated catch block
- e1.printStackTrace();
+ LOGGER.debug("Exception :",e1);
}
System.out.println("Sending callback response to url: " + callbackUrl);
ClientRequest request = new ClientRequest(callbackUrl);
} catch (Exception e) {
// TODO Auto-generated catch block
System.out.println("catch error in - request.post() ");
- e.printStackTrace();
+ LOGGER.debug("Exception :",e);
}
}
* 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.
import org.jboss.resteasy.client.ClientRequest;
import org.jboss.resteasy.client.ClientResponse;
+import org.openecomp.mso.logger.MsoLogger;
import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder;
import com.github.tomakehurst.wiremock.common.FileSource;
import com.github.tomakehurst.wiremock.extension.ResponseTransformer;
import com.github.tomakehurst.wiremock.http.Request;
import com.github.tomakehurst.wiremock.http.ResponseDefinition;
-
/**
* Please describe the VnfAdapterCreateMockTransformer.java class
*
*/
public class VnfAdapterDeleteMockTransformer extends ResponseTransformer {
+ private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL);
private String notifyCallbackResponse;
private String ackResponse;
responseMessageId = ackResponse.substring(ackResponse.indexOf("<messageId>")+11, ackResponse.indexOf("</messageId>"));
updatedResponse = ackResponse.replace(responseMessageId, messageId);
} catch (Exception ex) {
+ LOGGER.debug("Exception :",ex);
System.out.println(" ******* Use default response file in '__files/vnfAdapterMocks/vnfDeleteSimResponse.xml'");
responseMessageId = notifyCallbackResponse.substring(notifyCallbackResponse.indexOf("<messageId>")+11, notifyCallbackResponse.indexOf("</messageId>"));
updatedResponse = notifyCallbackResponse.replace(responseMessageId, messageId);
sleep(delay);
} catch (InterruptedException e1) {
// TODO Auto-generated catch block
- e1.printStackTrace();
+ LOGGER.debug("Exception :",e1);
}
System.out.println("Sending callback response to url: " + callbackUrl);
ClientRequest request = new ClientRequest(callbackUrl);
} catch (Exception e) {
// TODO Auto-generated catch block
System.out.println("catch error in - request.post() ");
- e.printStackTrace();
+ LOGGER.debug("Exception :",e);
}
}
* ============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.
import org.jboss.resteasy.client.ClientRequest;
import org.jboss.resteasy.client.ClientResponse;
+import org.openecomp.mso.logger.MsoLogger;
import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder;
import com.github.tomakehurst.wiremock.common.FileSource;
import com.github.tomakehurst.wiremock.http.Request;
import com.github.tomakehurst.wiremock.http.ResponseDefinition;
+import org.openecomp.mso.logger.MsoLogger;
/**
* Please describe the VnfAdapterQueryMockTransformer.java class
*
public class VnfAdapterQueryMockTransformer extends ResponseTransformer{
+ private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL);
+
private String notifyCallbackResponse;
private String ackResponse;
private String messageId;
responseMessageId = ackResponse.substring(ackResponse.indexOf("<messageId>")+11, ackResponse.indexOf("</messageId>"));
updatedResponse = ackResponse.replace(responseMessageId, messageId);
} catch (Exception ex) {
+ LOGGER.debug("Exception :",ex);
System.out.println(" ******* Use default response file in '__files/vnfAdapterMocks/vnfQuerySimResponse.xml'");
responseMessageId = notifyCallbackResponse.substring(notifyCallbackResponse.indexOf("<messageId>")+11, notifyCallbackResponse.indexOf("</messageId>"));
updatedResponse = notifyCallbackResponse.replace(responseMessageId, messageId);
//Delay sending callback response
sleep(delay);
} catch (InterruptedException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
+ LOGGER.debug("Exception :",e1);
}
ClientRequest request = new ClientRequest(callbackUrl);
request.body("text/xml", payLoad);
ClientResponse result = request.post();
//System.err.println("Successfully posted callback:" + result.getStatus());
} catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ LOGGER.debug("Exception :",e);
}
}
* ============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.
import com.github.tomakehurst.wiremock.http.Request;
import com.github.tomakehurst.wiremock.http.ResponseDefinition;
+import org.openecomp.mso.logger.MsoLogger;
/**
* Please describe the VnfAdapterCreateMockTransformer.java class
*
*/
public class VnfAdapterRollbackMockTransformer extends ResponseTransformer {
+ private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL);
+
private String notifyCallbackResponse;
private String ackResponse;
private String messageId;
responseMessageId = ackResponse.substring(ackResponse.indexOf("<messageId>")+11, ackResponse.indexOf("</messageId>"));
updatedResponse = ackResponse.replace(responseMessageId, messageId);
} catch (Exception ex) {
+ LOGGER.debug("Exception :",ex);
System.out.println(" ******* Use default response file in '__files/vnfAdapterMocks/vnfRollbackSimResponse.xml'");
responseMessageId = notifyCallbackResponse.substring(notifyCallbackResponse.indexOf("<messageId>")+11, notifyCallbackResponse.indexOf("</messageId>"));
updatedResponse = notifyCallbackResponse.replace(responseMessageId, messageId);
//Delay sending callback response
sleep(delay);
} catch (InterruptedException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
+ LOGGER.debug("Exception :",e1);
}
System.out.println("Sending callback response to url: " + callbackUrl);
ClientRequest request = new ClientRequest(callbackUrl);
System.out.println("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() ");
- e.printStackTrace();
+ LOGGER.debug("Exception :",e);
}
}
* ============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.
import org.jboss.resteasy.client.ClientRequest;
import org.jboss.resteasy.client.ClientResponse;
+import org.openecomp.mso.logger.MsoLogger;
import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder;
import com.github.tomakehurst.wiremock.common.FileSource;
import com.github.tomakehurst.wiremock.http.Request;
import com.github.tomakehurst.wiremock.http.ResponseDefinition;
+import org.openecomp.mso.logger.MsoLogger;
/**
* Please describe the VnfAdapterUpdateMockTransformer.java class
*
*/
public class VnfAdapterUpdateMockTransformer extends ResponseTransformer {
+ private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL);
+
private String notifyCallbackResponse;
private String requestId;
private String ackResponse;
responseMessageId = ackResponse.substring(ackResponse.indexOf("<messageId>")+11, ackResponse.indexOf("</messageId>"));
updatedResponse = ackResponse.replace(responseMessageId, messageId);
} catch (Exception ex) {
+ LOGGER.debug("Exception :",ex);
System.out.println(" ******* Use default response file in 'vnfAdapter/vnfUpdateSimResponse.xml'");
responseMessageId = notifyCallbackResponse.substring(notifyCallbackResponse.indexOf("<messageId>")+11, notifyCallbackResponse.indexOf("</messageId>"));
updatedResponse = notifyCallbackResponse.replace(responseMessageId, messageId);
//Delay sending callback response
sleep(delay);
} catch (InterruptedException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
+ LOGGER.debug("Exception :", e1);
}
System.out.println("Sending callback response to url: " + callbackUrl);
ClientRequest request = new ClientRequest(callbackUrl);
System.out.println("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() ");
- e.printStackTrace();
+ LOGGER.debug("Exception :",e);
}
}
<scope>test</scope>\r
</dependency>\r
\r
+ <dependency>\r
+ <groupId>org.openecomp.so</groupId>\r
+ <artifactId>common</artifactId>\r
+ <version>${project.version}</version>\r
+ </dependency>\r
</dependencies>\r
<build>\r
<finalName>MSORESTClient</finalName>\r
* 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.
import org.apache.http.message.AbstractHttpMessage;
import org.apache.http.util.EntityUtils;
+import org.openecomp.mso.logger.MsoLogger;
/**
* Client used to send RESTFul requests.
* <p>
* @since 1.0
*/
public class RESTClient {
+
+ private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL);
private final String proxyHost;
private final int proxyPort;
}
}
} catch (UnsupportedEncodingException e) {
- // should not occur
- e.printStackTrace();
+ LOGGER.debug("Exception :", e);
}
return sb.toString();
}
clientBuilder = HttpClientBuilder.create().setConnectionManager(
manager);
} catch (Exception ex) {
+ LOGGER.debug("Exception :", ex);
throw new RESTException(ex.getMessage());
}
clientBuilder.disableRedirectHandling();
* 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.
* 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.
/**
*/
public class UUIDChecker {
+
+ private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.GENERAL);
private UUIDChecker() {
UUID uuid = UUID.fromString(id);
return uuid.toString().equalsIgnoreCase(id);
} catch (IllegalArgumentException iae) {
+ LOGGER.debug("IllegalArgumentException", iae);
return false;
}
}
* ONAP - SO\r
* ================================================================================\r
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.\r
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.\r
* ================================================================================\r
* Licensed under the Apache License, Version 2.0 (the "License");\r
* you may not use this file except in compliance with the License.\r
completeResp = mapper.writeValueAsString(trr);\r
}\r
catch (Exception e) {\r
- msoLogger.debug("Unable to format response");\r
+ msoLogger.debug("Unable to format response",e);\r
Response resp = msoRequest.buildServiceErrorResponse(bpelStatus,\r
MsoException.ServiceException,\r
"Request Failed due to bad response format" ,\r
* 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.
requestJSON = mapper.writeValueAsString(sir.getRequestDetails());
} catch(Exception e){
- throw new ValidationException ("Parse ServiceInstanceRequest to JSON string");
+ throw new ValidationException ("Parse ServiceInstanceRequest to JSON string",e);
}
if(instanceIdMap != null){
* 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.
requestDetails = mapper.readValue(requestBody, RequestDetails.class);
}catch(Exception e){
- msoLogger.debug("Exception caught mapping requestBody to RequestDetails");
+ msoLogger.debug("Exception caught mapping requestBody to RequestDetails",e);
}
request.setRequestDetails(requestDetails);
* 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.
msoRequest.updateFinalStatus (Status.FAILED);
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.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 (),e);
return resp;
}
msoRequest.updateFinalStatus (Status.FAILED);
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.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 (),e);
return resp;
}
TasksGetResponse trr = new TasksGetResponse();
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.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 (),e);
return resp;
}
taskList.add(taskListEntry);
jsonResponse = mapper.writeValueAsString(trr);
}
catch (Exception e) {
- msoLogger.debug("Unable to format response");
+ msoLogger.debug("Unable to format response",e);
Response resp = msoRequest.buildServiceErrorResponse(500,
MsoException.ServiceException,
"Request Failed due to bad response format" ,
* 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.
try {
environment = (HeatEnvironment) query.uniqueResult ();
} catch (org.hibernate.NonUniqueResultException nure) {
- LOGGER.debug("Non Unique Result Exception - the Catalog Database does not match a unique row for Envt - data integrity error: artifactUuid='" + artifactUuid +"'");
+ LOGGER.debug("Non Unique Result Exception - the Catalog Database does not match a unique row for Envt - data integrity error: artifactUuid='" + artifactUuid +"'", nure);
LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for heatEnvironment artifactUuid=" + artifactUuid, "", "", MsoLogger.ErrorCode.DataError, "Non unique result for artifactUuid==" + artifactUuid);
environment = null;
} catch (org.hibernate.HibernateException he) {
try {
result = (Service) query.uniqueResult();
} catch (org.hibernate.NonUniqueResultException nure) {
- LOGGER.debug("Non Unique Result Exception - the Catalog Database does not match a unique row - data integrity error: modelInvariantId='" + modelInvariantId + "', modelVersion='" + modelVersion + "'");
+ LOGGER.debug("Non Unique Result Exception - the Catalog Database does not match a unique row - data integrity error: modelInvariantId='" + modelInvariantId + "', modelVersion='" + modelVersion + "'", nure);
LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for modelInvariantId=" + modelInvariantId + " and modelVersion=" + modelVersion, "", "", MsoLogger.ErrorCode.DataError, "Non unique result for modelInvariantId=" + modelInvariantId);
throw new Exception("Non Unique Result Exception - the Catalog Database does not match a unique row - data integrity error: modelInvariantId='" + modelInvariantId + "', modelVersion='" + modelVersion + "'");
}
//session.merge(heat);
session.save(heat);
} catch (HibernateException he1) {
- LOGGER.debug("Hibernate Exception encountered on first attempt at save(heat) - try again..." + he1.getMessage());
- LOGGER.debug(he1.getStackTrace().toString());
+ LOGGER.debug("Hibernate Exception encountered on first attempt at save(heat) - try again..." + he1.getMessage(), he1);
try {
Session session = this.getSession();
//session.merge(heat);
LOGGER.debug(he2.getStackTrace().toString());
throw he2;
} catch (Exception e2) {
- LOGGER.debug("General Exception encountered on second attempt at save(heat)..." + e2.getMessage());
+ LOGGER.debug("General Exception encountered on second attempt at save(heat)..." + e2.getMessage(),e2);
LOGGER.debug(e2.getStackTrace().toString());
throw e2;
}
} catch (Exception e1) {
- LOGGER.debug("General Exception encountered on first attempt at save(heat) - try again..." + e1.getMessage());
+ LOGGER.debug("General Exception encountered on first attempt at save(heat) - try again..." + e1.getMessage(), e1);
LOGGER.debug(e1.getStackTrace().toString());
try {
Session session = this.getSession();
//session.merge(heat);
session.save(heat);
} catch (HibernateException he2) {
- LOGGER.debug("General Exception encountered on second attempt at save(heat)" + he2.getMessage());
+ LOGGER.debug("General Exception encountered on second attempt at save(heat)" + he2.getMessage(), he2);
LOGGER.debug(he2.getStackTrace().toString());
throw he2;
} catch (Exception e2) {
- LOGGER.debug("General Exception encountered on second attempt at save(heat)..." + e2.getMessage());
+ LOGGER.debug("General Exception encountered on second attempt at save(heat)..." + e2.getMessage(), e2);
LOGGER.debug(e2.getStackTrace().toString());
throw e2;
}
try {
env = (HeatEnvironment) query.uniqueResult ();
} catch (org.hibernate.NonUniqueResultException nure) {
- LOGGER.debug("Non Unique Result Exception - the Catalog Database does not match a unique row - data integrity error: envName='" + name + "', version='" + version + "' and asdcResourceName=" + asdcResourceName);
+ LOGGER.debug("Non Unique Result Exception - the Catalog Database does not match a unique row - data integrity error: envName='" + name + "', version='" + version + "' and asdcResourceName=" + asdcResourceName, nure);
LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for envName=" + name + " and version=" + version + " and asdcResourceName=" + asdcResourceName, "", "", MsoLogger.ErrorCode.DataError, "non unique result for envName=" + name);
env = null;
} catch (org.hibernate.HibernateException he) {
- LOGGER.debug("Hibernate Exception - while searching for: envName='" + name + "', asdc_service_model_version='" + version + "' and asdcResourceName=" + asdcResourceName);
+ LOGGER.debug("Hibernate Exception - while searching for: envName='" + name + "', asdc_service_model_version='" + version + "' and asdcResourceName=" + asdcResourceName, he);
LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Hibernate exception searching for envName=" + name + " and version=" + version + " and asdcResourceName=" + asdcResourceName, "", "", MsoLogger.ErrorCode.DataError, "Hibernate exception searching for envName=" + name);
env = null;
} catch (Exception e) {
- LOGGER.debug("Generic Exception - while searching for: envName='" + name + "', asdc_service_model_version='" + version + "' and asdcResourceName=" + asdcResourceName);
+ LOGGER.debug("Generic Exception - while searching for: envName='" + name + "', asdc_service_model_version='" + version + "' and asdcResourceName=" + asdcResourceName, e);
LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " Generic exception searching for envName=" + name + " and version=" + version + " and asdcResourceName=" + asdcResourceName, "", "", MsoLogger.ErrorCode.DataError, "Generic exception searching for envName=" + name);
env = null;
}
try {
LOGGER.debug(vnfResourceCustomization.toString());
} catch (Exception e) {
- LOGGER.debug("Unable to print VRC " + e.getMessage());
+ LOGGER.debug("Unable to print VRC " + e.getMessage(), e);
}
try {
// Check if NetworkResourceCustomzation record already exists. If so, skip saving it.
try {
LOGGER.debug("Existing VRC entry found\n" + existing.toString());
} catch (Exception e) {
- LOGGER.debug("Unable to print VRC2 " + e.getMessage());
+ LOGGER.debug("Unable to print VRC2 " + e.getMessage(), e);
}
return false;
}
LOGGER.debug("heat template id = " + vfModule.getHeatTemplateArtifactUUId() + ", vol template id = "+ vfModule.getVolHeatTemplateArtifactUUId());
LOGGER.debug(vfModule.toString());
} catch (Exception e) {
- LOGGER.debug("unable to print vfmodule " + e.getMessage());
+ LOGGER.debug("unable to print vfmodule " + e.getMessage(), e);
}
try {
VfModule existing = this.getVfModuleByModelUUID(vfModule.getModelUUID());
try {
LOGGER.debug("Found an existing vf module!\n" + existing.toString());
} catch (Exception e) {
- LOGGER.debug("unable to print vfmodule2 " + e.getMessage());
+ LOGGER.debug("unable to print vfmodule2 " + e.getMessage(), e);
}
}
LOGGER.debug("env id = " + vfModuleCustomization.getHeatEnvironmentArtifactUuid() + ", vol Env=" + vfModuleCustomization.getVolEnvironmentArtifactUuid());
LOGGER.debug(vfModuleCustomization.toString());
} catch (Exception e) {
- LOGGER.debug("unable to print vfmodulecust " + e.getMessage());
+ LOGGER.debug("unable to print vfmodulecust " + e.getMessage(), e);
}
try {
VfModuleCustomization existing = this.getVfModuleCustomizationByModelCustomizationId(vfModuleCustomization.getModelCustomizationUuid());
try {
LOGGER.debug("Found an existing vf module customization entry\n" + existing.toString());
} catch (Exception e) {
- LOGGER.debug("unable to print vfmodulecust2 " + e.getMessage());
+ LOGGER.debug("unable to print vfmodulecust2 " + e.getMessage(), e);
}
}
return resultList.get (0);
} catch (Exception e) {
- LOGGER.debug("Error trying to find Network Resource with " + modelUUID +", " + e.getMessage());
+ LOGGER.debug("Error trying to find Network Resource with " + modelUUID +", " + e.getMessage(),e);
} finally {
LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getNetworkResourceByModelUuid", null);
}
return resultList.get (0);
} catch (Exception e) {
- LOGGER.debug("Error trying to find Network Resource with " + modelCustomizationUuid +", " + e.getMessage());
+ LOGGER.debug("Error trying to find Network Resource with " + modelCustomizationUuid +", " + e.getMessage(),e);
} finally {
LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getNetworkResourceByModelCustUuid", null);
}
try {
LOGGER.debug("Returning theObjects:" + theObjects.size());
} catch (Exception e) {
- LOGGER.debug("Returning theObjects");
+ LOGGER.debug("Returning theObjects",e);
}
LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "executeQuerySingleRow", null);
}