Fix for SONAR critical issues
Issue-Id : SO-117

Change-Id: Icdc64605b475e20af7e871135af327f7d0e38792
Signed-off-by: seshukm <seshu.kumar.m@huawei.com>
diff --git a/bpmn/MSOMockServer/pom.xml b/bpmn/MSOMockServer/pom.xml
index 34f7a23..500535d 100644
--- a/bpmn/MSOMockServer/pom.xml
+++ b/bpmn/MSOMockServer/pom.xml
@@ -76,6 +76,11 @@
 			</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>
 			<version>2.0</version>
diff --git a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/SDNCAdapterMockTransformer.java b/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/SDNCAdapterMockTransformer.java
index 33a65e6..1f17a8b 100644
--- a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/SDNCAdapterMockTransformer.java
+++ b/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/SDNCAdapterMockTransformer.java
@@ -2,7 +2,8 @@
  * ============LICENSE_START======================================================= 
  * ONAP - SO 
  * ================================================================================ 
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. 
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
  * ================================================================================ 
  * Licensed under the Apache License, Version 2.0 (the "License"); 
  * you may not use this file except in compliance with the License. 
@@ -22,6 +23,7 @@
 
 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;
@@ -29,6 +31,7 @@
 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
@@ -36,6 +39,7 @@
  */
 public class SDNCAdapterMockTransformer extends ResponseTransformer {
 
+	private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL);
 	private String callbackResponse;
 	private String requestId;
 	
@@ -121,8 +125,7 @@
 				//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);
@@ -132,8 +135,7 @@
 				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);
 			}
 		}
 		
diff --git a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/SDNCAdapterNetworkTopologyMockTransformer.java b/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/SDNCAdapterNetworkTopologyMockTransformer.java
index 673ac00..b782c05 100644
--- a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/SDNCAdapterNetworkTopologyMockTransformer.java
+++ b/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/SDNCAdapterNetworkTopologyMockTransformer.java
@@ -2,7 +2,8 @@
  * ============LICENSE_START======================================================= 
  * ONAP - SO 
  * ================================================================================ 
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. 
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved. 
  * ================================================================================ 
  * Licensed under the Apache License, Version 2.0 (the "License"); 
  * you may not use this file except in compliance with the License. 
@@ -29,8 +30,12 @@
 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;
 	
@@ -110,7 +115,7 @@
 				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);
@@ -122,7 +127,7 @@
 			} catch (Exception e) {
 				// TODO Auto-generated catch block
 				System.out.println("catch error in - request.post() ");
-				e.printStackTrace();
+				LOGGER.debug("Exception :",e);
 			}
 		}
 		
diff --git a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/VnfAdapterCreateMockTransformer.java b/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/VnfAdapterCreateMockTransformer.java
index 1e32077..ebedca8 100644
--- a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/VnfAdapterCreateMockTransformer.java
+++ b/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/VnfAdapterCreateMockTransformer.java
@@ -6,6 +6,7 @@
  * ONAP - SO 
  * ================================================================================ 
  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. 
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
  * ================================================================================ 
  * Licensed under the Apache License, Version 2.0 (the "License"); 
  * you may not use this file except in compliance with the License. 
@@ -27,6 +28,7 @@
 
 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;
@@ -34,12 +36,15 @@
 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;
 
@@ -71,6 +76,7 @@
 			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);
@@ -124,7 +130,7 @@
 				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);
@@ -138,7 +144,7 @@
 			} catch (Exception e) {
 				// TODO Auto-generated catch block
 				System.out.println("catch error in - request.post() ");
-				e.printStackTrace();
+				LOGGER.debug("Exception :",e);
 			}
 		}
 
diff --git a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/VnfAdapterDeleteMockTransformer.java b/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/VnfAdapterDeleteMockTransformer.java
index 553aed6..b2c25fc 100644
--- a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/VnfAdapterDeleteMockTransformer.java
+++ b/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/VnfAdapterDeleteMockTransformer.java
@@ -6,6 +6,7 @@
  * ONAP - SO 
  * ================================================================================ 
  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. 
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
  * ================================================================================ 
  * Licensed under the Apache License, Version 2.0 (the "License"); 
  * you may not use this file except in compliance with the License. 
@@ -25,19 +26,20 @@
 
 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;
@@ -72,6 +74,7 @@
 			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);
@@ -125,7 +128,7 @@
 				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);
@@ -138,7 +141,7 @@
 			} catch (Exception e) {
 				// TODO Auto-generated catch block
 				System.out.println("catch error in - request.post() ");
-				e.printStackTrace();
+				LOGGER.debug("Exception :",e);
 			}
 		}
 
diff --git a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/VnfAdapterQueryMockTransformer.java b/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/VnfAdapterQueryMockTransformer.java
index c1d27d5..5aae339 100644
--- a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/VnfAdapterQueryMockTransformer.java
+++ b/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/VnfAdapterQueryMockTransformer.java
@@ -2,7 +2,8 @@
  * ============LICENSE_START======================================================= 
  * ONAP - SO 
  * ================================================================================ 
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. 
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
  * ================================================================================ 
  * Licensed under the Apache License, Version 2.0 (the "License"); 
  * you may not use this file except in compliance with the License. 
@@ -25,6 +26,7 @@
 
 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;
@@ -32,6 +34,7 @@
 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
  *
@@ -40,6 +43,8 @@
 
 public class VnfAdapterQueryMockTransformer extends ResponseTransformer{
 	
+	private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL);
+	
 	private String notifyCallbackResponse;
 	private String ackResponse;
 	private String messageId;
@@ -84,6 +89,7 @@
 			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);
@@ -139,8 +145,7 @@
 				//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);
@@ -149,8 +154,7 @@
 				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);
 			}
 		}
 
diff --git a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/VnfAdapterRollbackMockTransformer.java b/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/VnfAdapterRollbackMockTransformer.java
index 5207fa0..45a67de 100644
--- a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/VnfAdapterRollbackMockTransformer.java
+++ b/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/VnfAdapterRollbackMockTransformer.java
@@ -5,7 +5,8 @@
  * ============LICENSE_START======================================================= 
  * ONAP - SO 
  * ================================================================================ 
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. 
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
  * ================================================================================ 
  * Licensed under the Apache License, Version 2.0 (the "License"); 
  * you may not use this file except in compliance with the License. 
@@ -32,12 +33,15 @@
 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;
@@ -74,6 +78,7 @@
 			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);
@@ -125,8 +130,7 @@
 				//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);
@@ -137,9 +141,8 @@
 				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);
 			}
 		}
 
diff --git a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/VnfAdapterUpdateMockTransformer.java b/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/VnfAdapterUpdateMockTransformer.java
index e84e57c..d67ffcd 100644
--- a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/VnfAdapterUpdateMockTransformer.java
+++ b/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/VnfAdapterUpdateMockTransformer.java
@@ -5,7 +5,8 @@
  * ============LICENSE_START======================================================= 
  * ONAP - SO 
  * ================================================================================ 
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. 
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
  * ================================================================================ 
  * Licensed under the Apache License, Version 2.0 (the "License"); 
  * you may not use this file except in compliance with the License. 
@@ -25,6 +26,7 @@
 
 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;
@@ -32,12 +34,15 @@
 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;
@@ -74,6 +79,7 @@
 			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);
@@ -125,8 +131,7 @@
 				//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);
@@ -137,9 +142,8 @@
 				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);
 			}
 		}