aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorByung-Woo Jun <byung-woo.jun@ericsson.com>2018-08-30 11:22:49 +0000
committerGerrit Code Review <gerrit@onap.org>2018-08-30 11:22:49 +0000
commit8997d83c459bde6738d48950aff8ebe9103e0649 (patch)
treeaf603cdafc42315dd99f92f339a8ff435e1bf772
parent5dc119fdb38deffcb64f1fcfc3ef2644c779c8f7 (diff)
parent58c79cdb4738a9a64ef599000c8787d28a4582aa (diff)
Merge "fixed sonar issue in BPRestCallback.java"
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/BPRestCallback.java21
1 files changed, 12 insertions, 9 deletions
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/BPRestCallback.java b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/BPRestCallback.java
index 576d7846cd..d5ce96ea5a 100644
--- a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/BPRestCallback.java
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/BPRestCallback.java
@@ -5,6 +5,8 @@
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
+ * Modifications Copyright (C) 2018 IBM.
+ * ================================================================================
* 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
@@ -47,7 +49,8 @@ import org.springframework.core.env.Environment;
public class BPRestCallback {
private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA,BPRestCallback.class);
private static final MsoAlarmLogger ALARMLOGGER = new MsoAlarmLogger();
-
+ private static final String CAMUNDA="Camunda";
+ private static final String MSO_INTERNAL_ERROR="MsoInternalError";
@Autowired
private Environment env;
@@ -91,7 +94,7 @@ public class BPRestCallback {
+ " message=" + message
+ ")");
- LOGGER.info(MessageEnum.RA_CALLBACK_BPEL, message == null ? "[no content]" : message, "Camunda", "");
+ LOGGER.info(MessageEnum.RA_CALLBACK_BPEL, message == null ? "[no content]" : message, CAMUNDA, "");
HttpPost method = null;
HttpResponse httpResponse = null;
@@ -121,9 +124,9 @@ public class BPRestCallback {
String authorization = "Basic " + DatatypeConverter.printBase64Binary(userCredentials.getBytes());
method.setHeader("Authorization", authorization);
} catch (Exception e) {
- LOGGER.error(MessageEnum.RA_SET_CALLBACK_AUTH_EXC, "Camunda", "", MsoLogger.ErrorCode.BusinessProcesssError,
+ LOGGER.error(MessageEnum.RA_SET_CALLBACK_AUTH_EXC, CAMUNDA, "", MsoLogger.ErrorCode.BusinessProcesssError,
"Unable to set authorization in callback request", e);
- ALARMLOGGER.sendAlarm("MsoInternalError", MsoAlarmLogger.CRITICAL,
+ ALARMLOGGER.sendAlarm(MSO_INTERNAL_ERROR, MsoAlarmLogger.CRITICAL,
"Unable to set authorization in callback request: " + e.getMessage());
error = true;
}
@@ -140,15 +143,15 @@ public class BPRestCallback {
if (httpResponse.getStatusLine().getStatusCode() >= 300) {
String msg = "Received error response to callback request: " + httpResponse.getStatusLine();
- LOGGER.error(MessageEnum.RA_CALLBACK_BPEL_EXC, "Camunda", "", MsoLogger.ErrorCode.BusinessProcesssError, msg);
- ALARMLOGGER.sendAlarm("MsoInternalError", MsoAlarmLogger.CRITICAL, msg);
+ LOGGER.error(MessageEnum.RA_CALLBACK_BPEL_EXC, CAMUNDA, "", MsoLogger.ErrorCode.BusinessProcesssError, msg);
+ ALARMLOGGER.sendAlarm(MSO_INTERNAL_ERROR, MsoAlarmLogger.CRITICAL, msg);
}
}
return true;
} catch (Exception e) {
- LOGGER.error(MessageEnum.RA_CALLBACK_BPEL_EXC, "Camunda", "", MsoLogger.ErrorCode.BusinessProcesssError,
+ LOGGER.error(MessageEnum.RA_CALLBACK_BPEL_EXC, CAMUNDA, "", MsoLogger.ErrorCode.BusinessProcesssError,
"Error sending callback request", e);
- ALARMLOGGER.sendAlarm("MsoInternalError", MsoAlarmLogger.CRITICAL,
+ ALARMLOGGER.sendAlarm(MSO_INTERNAL_ERROR, MsoAlarmLogger.CRITICAL,
"Error sending callback request: " + e.getMessage());
return false;
} finally {
@@ -168,7 +171,7 @@ public class BPRestCallback {
LOGGER.debug("Exception:", e);
}
}
- LOGGER.info(MessageEnum.RA_CALLBACK_BPEL_COMPLETE, "Camunda", "","");
+ LOGGER.info(MessageEnum.RA_CALLBACK_BPEL_COMPLETE, CAMUNDA, "","");
}
}
} \ No newline at end of file