diff options
author | seshukm <seshu.kumar.m@huawei.com> | 2017-09-12 16:13:47 +0530 |
---|---|---|
committer | seshukm <seshu.kumar.m@huawei.com> | 2017-09-12 16:13:47 +0530 |
commit | 171ec7b74a11658277f9e9fe1dcc893a8225db9e (patch) | |
tree | 8f475fddfc39f1639ee17b77545a1fbada48ed44 /bpmn/MSOCommonBPMN/src | |
parent | 92ffbb4a56b1f84ed130b04ca3a9954ce610a02a (diff) |
Fix for SONAR critical issues
Issue-Id : SO-117
Change-Id: Icdc64605b475e20af7e871135af327f7d0e38792
Signed-off-by: seshukm <seshu.kumar.m@huawei.com>
Diffstat (limited to 'bpmn/MSOCommonBPMN/src')
3 files changed, 11 insertions, 3 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/util/CryptoHandler.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/util/CryptoHandler.java index 5394ba9601..e938a25fab 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/util/CryptoHandler.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/util/CryptoHandler.java @@ -3,6 +3,7 @@ * ONAP - SO
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,8 +22,10 @@ package org.openecomp.mso.bpmn.common.util;
import java.security.GeneralSecurityException;
+import org.openecomp.mso.logger.MsoLogger;
public class CryptoHandler implements ICryptoHandler {
+ private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL);
private static String msoKey = "aa3871669d893c7fb8abbcda31b88b4f";
//private static String msoAaiPwd = "mso0206";
@@ -32,6 +35,7 @@ public class CryptoHandler implements ICryptoHandler { try {
return CryptoUtils.decrypt(msoAaiEncryptedPwd, msoKey);
} catch (GeneralSecurityException e) {
+ LOGGER.debug("GeneralSecurityException :",e);
return null;
}
}
@@ -41,6 +45,7 @@ public class CryptoHandler implements ICryptoHandler { try {
return CryptoUtils.encrypt(plainMsoPwd, msoKey);
} catch (GeneralSecurityException e) {
+ LOGGER.debug("GeneralSecurityException :",e);
return null;
}
}
@@ -50,6 +55,7 @@ public class CryptoHandler implements ICryptoHandler { try {
return CryptoUtils.decrypt(encryptedPwd, msoKey);
} catch (GeneralSecurityException e) {
+ LOGGER.debug("GeneralSecurityException :",e);
return null;
}
}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/AbstractCallbackService.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/AbstractCallbackService.java index 49e42acaf6..a4a88597bd 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/AbstractCallbackService.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/AbstractCallbackService.java @@ -76,6 +76,7 @@ public abstract class AbstractCallbackService { logCallbackSuccess(method, startTime);
return new CallbackSuccess();
} catch (Exception e) {
+ LOGGER.debug("Exception :",e);
String msg = "Caught " + e.getClass().getSimpleName()
+ " processing " + messageEventName + " with " + correlationVariable
+ " = '" + correlationValue + "'";
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowResource.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowResource.java index 7db4e76ef1..7a537218b3 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowResource.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowResource.java @@ -3,6 +3,7 @@ * ONAP - SO
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -183,8 +184,7 @@ public class WorkflowResource { workflowResponse.setMessageCode(500);
return Response.status(500).entity(workflowResponse).build();
} catch (Exception ex) {
- msoLogger.debug(LOGMARKER + "Exception in startProcessInstance by key");
- ex.printStackTrace();
+ msoLogger.debug(LOGMARKER + "Exception in startProcessInstance by key",ex);
workflowResponse.setMessage("Fail" );
workflowResponse.setResponse("Error occurred while executing the process: " + ex.getMessage());
if (processInstance != null) workflowResponse.setProcessInstanceID(processInstance.getId());
@@ -258,6 +258,7 @@ public class WorkflowResource { try {
return pes.getRuntimeService().createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult() == null ? true : false ;
} catch (Exception e) {
+ msoLogger.debug("Exception :",e);
return true;
}
}
@@ -601,7 +602,7 @@ public class WorkflowResource { + processKey
+ " with response: "
+ response.getResponse());
-
+ msoLogger.debug("Exception :",ex);
}
msoLogger.recordMetricEvent ( startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
|