aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/mso-infrastructure-bpmn
diff options
context:
space:
mode:
authorSteve Smokowski <ss835w@att.com>2019-06-10 14:43:07 +0000
committerGerrit Code Review <gerrit@onap.org>2019-06-10 14:43:07 +0000
commit33ce1d167c0daba899887b8ecd16b8a508cf12a0 (patch)
tree1f1b33d81329020c3463ea364ffbc25d96895aa8 /bpmn/mso-infrastructure-bpmn
parent6ec917f8f6490861a47f2b03a6065cc1da2be1dc (diff)
parent48b34de1fd7d68f41e868a25e8817346af6ef85a (diff)
Merge "replaced String.repeat with static final strings"
Diffstat (limited to 'bpmn/mso-infrastructure-bpmn')
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/CallbackHandlerService.java20
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowMessageResource.java6
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowResource.java6
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/infrastructure/MSOInfrastructureApplication.java4
4 files changed, 18 insertions, 18 deletions
diff --git a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/CallbackHandlerService.java b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/CallbackHandlerService.java
index c3349dd9e2..13ba46a852 100644
--- a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/CallbackHandlerService.java
+++ b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/CallbackHandlerService.java
@@ -26,7 +26,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import com.google.common.base.Strings;
+import org.onap.so.logger.LoggingAnchor;
import org.camunda.bpm.engine.MismatchingMessageCorrelationException;
import org.camunda.bpm.engine.OptimisticLockingException;
import org.camunda.bpm.engine.RuntimeService;
@@ -208,7 +208,7 @@ public class CallbackHandlerService {
+ messageEventName + " with " + correlationVariable + " = '" + correlationValue
+ "'; last exception was:" + queryException;
logger.debug(msg);
- logger.error(Strings.repeat("{} ", 4), MessageEnum.BPMN_GENERAL_EXCEPTION.toString(), "BPMN",
+ logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION.toString(), "BPMN",
ErrorCode.UnknownError.getValue(), msg, queryException);
}
@@ -246,7 +246,7 @@ public class CallbackHandlerService {
String msg = "Caught " + ole.getClass().getSimpleName() + " after receiving " + messageEventName
+ " with " + correlationVariable + " = '" + correlationValue + "': " + ole;
logger.debug(msg);
- logger.error(Strings.repeat("{} ", 4), MessageEnum.BPMN_GENERAL_EXCEPTION.toString(),
+ logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION.toString(),
"BPMN CORRELATION ERROR -", ErrorCode.UnknownError.getValue(), msg, ole);
// Retry for OptimisticLocking Exceptions
@@ -280,7 +280,7 @@ public class CallbackHandlerService {
String strMsg = "Received exception, OptimisticLockingException retry failed, retryCount:"
+ retryCount + " | exception returned: " + olex;
logger.debug(strMsg);
- logger.error(Strings.repeat("{} ", 4), MessageEnum.BPMN_GENERAL_EXCEPTION.toString(), "BPMN",
+ logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION.toString(), "BPMN",
ErrorCode.UnknownError.getValue(), strMsg, olex);
} catch (Exception excep) {
retryCount = 0;
@@ -288,7 +288,7 @@ public class CallbackHandlerService {
String strMsg = "Received exception, OptimisticLockingException retry failed, retryCount:"
+ retryCount + " | exception returned: " + excep;
logger.debug(strMsg);
- logger.error(Strings.repeat("{} ", 4), MessageEnum.BPMN_GENERAL_EXCEPTION.toString(), "BPMN",
+ logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION.toString(), "BPMN",
ErrorCode.UnknownError.getValue(), strMsg, excep);
}
@@ -301,7 +301,7 @@ public class CallbackHandlerService {
+ " after receiving " + messageEventName + " with " + correlationVariable + " = '"
+ correlationValue + "': " + e;
logger.debug(msg);
- logger.error(Strings.repeat("{} ", 4), MessageEnum.BPMN_GENERAL_EXCEPTION.toString(), "BPMN",
+ logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION.toString(), "BPMN",
ErrorCode.UnknownError.getValue(), msg, e);
}
} catch (Exception e) {
@@ -310,8 +310,8 @@ public class CallbackHandlerService {
String msg = "Caught " + e.getClass().getSimpleName() + " after receiving " + messageEventName + " with "
+ correlationVariable + " = '" + correlationValue + "': " + e;
logger.debug(msg);
- logger.error(Strings.repeat("{} ", 4), MessageEnum.BPMN_GENERAL_EXCEPTION.toString(),
- "BPMN CORRELATION ERROR -", ErrorCode.UnknownError.getValue(), msg, e);
+ logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION.toString(), "BPMN CORRELATION ERROR -",
+ ErrorCode.UnknownError.getValue(), msg, e);
}
return true;
@@ -346,10 +346,10 @@ public class CallbackHandlerService {
*/
protected void logCallbackError(String method, long startTime, String msg, Exception e) {
if (e == null) {
- logger.error(Strings.repeat("{} ", 4), MessageEnum.BPMN_CALLBACK_EXCEPTION.toString(), "BPMN",
+ logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_CALLBACK_EXCEPTION.toString(), "BPMN",
ErrorCode.UnknownError.getValue(), msg);
} else {
- logger.error(Strings.repeat("{} ", 4), MessageEnum.BPMN_CALLBACK_EXCEPTION.toString(), "BPMN",
+ logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_CALLBACK_EXCEPTION.toString(), "BPMN",
ErrorCode.UnknownError.getValue(), msg, e);
}
}
diff --git a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowMessageResource.java b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowMessageResource.java
index da18ac2f40..f76fde9ef1 100644
--- a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowMessageResource.java
+++ b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowMessageResource.java
@@ -32,7 +32,7 @@ import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
-import com.google.common.base.Strings;
+import org.onap.so.logger.LoggingAnchor;
import org.onap.so.bpmn.common.workflow.service.CallbackHandlerService.CallbackError;
import org.onap.so.bpmn.common.workflow.service.CallbackHandlerService.CallbackResult;
import org.onap.so.logger.ErrorCode;
@@ -79,7 +79,7 @@ public class WorkflowMessageResource {
if (messageType == null || messageType.isEmpty()) {
String msg = "Missing message type";
logger.debug(LOGMARKER + " " + msg);
- logger.error(Strings.repeat("{} ", 4), MessageEnum.BPMN_GENERAL_EXCEPTION.toString(), "BPMN",
+ logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION.toString(), "BPMN",
ErrorCode.DataError.getValue(), LOGMARKER + ":" + msg);
return Response.status(400).entity(msg).build();
}
@@ -87,7 +87,7 @@ public class WorkflowMessageResource {
if (correlator == null || correlator.isEmpty()) {
String msg = "Missing correlator";
logger.debug(LOGMARKER + " " + msg);
- logger.error(Strings.repeat("{} ", 4), MessageEnum.BPMN_GENERAL_EXCEPTION.toString(), "BPMN",
+ logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION.toString(), "BPMN",
ErrorCode.DataError.getValue(), LOGMARKER + ":" + msg);
return Response.status(400).entity(msg).build();
}
diff --git a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowResource.java b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowResource.java
index ef6a27b0fc..20f3eb4fee 100644
--- a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowResource.java
+++ b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowResource.java
@@ -36,7 +36,7 @@ import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriInfo;
-import com.google.common.base.Strings;
+import org.onap.so.logger.LoggingAnchor;
import org.camunda.bpm.engine.HistoryService;
import org.camunda.bpm.engine.ProcessEngineException;
import org.camunda.bpm.engine.ProcessEngineServices;
@@ -196,7 +196,7 @@ public class WorkflowResource extends ProcessEngineAwareService {
if (processInstance != null)
workflowResponse.setProcessInstanceID(processInstance.getId());
- logger.error(Strings.repeat("{} ", 5), MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), "BPMN",
+ logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), "BPMN",
MDC.get(processKey), ErrorCode.UnknownError.getValue(), LOGMARKER + workflowResponse.getMessage()
+ " for processKey: " + processKey + " with response: " + workflowResponse.getResponse());
@@ -582,7 +582,7 @@ public class WorkflowResource extends ProcessEngineAwareService {
response.setResponse("Failed to retrieve the variables," + ex.getMessage());
response.setProcessInstanceID(processInstanceId);
- logger.error(Strings.repeat("{} ", 5), MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), "BPMN",
+ logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), "BPMN",
MDC.get(processKey), ErrorCode.UnknownError.getValue(), LOGMARKER + response.getMessage()
+ " for processKey: " + processKey + " with response: " + response.getResponse());
logger.debug("Exception :", ex);
diff --git a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/infrastructure/MSOInfrastructureApplication.java b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/infrastructure/MSOInfrastructureApplication.java
index 5aae165c15..093fba089d 100644
--- a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/infrastructure/MSOInfrastructureApplication.java
+++ b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/infrastructure/MSOInfrastructureApplication.java
@@ -24,7 +24,7 @@ package org.onap.so.bpmn.infrastructure;
import java.util.List;
import java.util.concurrent.Executor;
-import com.google.common.base.Strings;
+import org.onap.so.logger.LoggingAnchor;
import javax.annotation.PostConstruct;
import org.camunda.bpm.application.PreUndeploy;
import org.camunda.bpm.application.ProcessApplicationInfo;
@@ -132,7 +132,7 @@ public class MSOInfrastructureApplication {
workflowName += BPMN_SUFFIX;
}
if (workflowBody != null) {
- logger.info(Strings.repeat("{} ", 2), "Deploying custom workflow", workflowName);
+ logger.info(LoggingAnchor.TWO, "Deploying custom workflow", workflowName);
deploymentBuilder.addString(workflowName, workflowBody);
}
deploymentBuilder.enableDuplicateFiltering(true);