*.log
*.tmp
packages/root-pack-extras/config-resources/mariadb/db-sql-scripts/main-schemas/MySQL-Catalog-schema.sql
-packages/root-pack-extras/config-resources/mariadb/db-sql-scripts/main-schemas/MySQL-Requests-schema.sql
\ No newline at end of file
+packages/root-pack-extras/config-resources/mariadb/db-sql-scripts/main-schemas/MySQL-Requests-schema.sql
+/bin/
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",
+/*-
+ * ============LICENSE_START=======================================================
+ * 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.
+ * 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.core;
import java.io.FileOutputStream;
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();