Replaced MsoLogger with plain slf4j.
Refactored login output.
Fixed imports.
Change-Id: I05fa4d03fe2688a888c592a9c19c90e4fc213e48
Issue-ID: LOG-631
Signed-off-by: Robert Bogacki <r.bogacki@samsung.com>
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
import org.onap.so.bpmn.core.UrnPropertiesReader;
import org.onap.so.logger.MessageEnum;
import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
public static final long FAST_POLL_INT_MS = 100;
public static final long SLOW_POLL_INT_MS = 1000;
- private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, CallbackHandlerService.class);
+ private static final Logger logger = LoggerFactory.getLogger(CallbackHandlerService.class);
@Autowired
RuntimeService runtimeService;
long startTime = System.currentTimeMillis();
- LOGGER.debug(logMarker + " " + method + " received message: "
+ logger.debug(logMarker + " " + method + " received message: "
+ (message == null ? "" : System.lineSeparator()) + message);
try {
logCallbackSuccess(method, startTime);
return new CallbackSuccess();
} catch (Exception e) {
- LOGGER.debug("Exception :",e);
+ logger.debug("Exception :",e);
String msg = "Caught " + e.getClass().getSimpleName()
+ " processing " + messageEventName + " with " + correlationVariable
+ " = '" + correlationValue + "'";
protected boolean correlate(String messageEventName, String correlationVariable,
String correlationValue, Map<String, Object> variables, String logMarker) {
try{
- LOGGER.debug(logMarker + " Attempting to find process waiting"
+ logger.debug(logMarker + " Attempting to find process waiting"
+ " for " + messageEventName + " with " + correlationVariable
+ " = '" + correlationValue + "'");
execInfoList.add(new ExecInfo(execution));
}
- LOGGER.debug(logMarker + " Found " + count + " process(es) waiting"
+ logger.debug(logMarker + " Found " + count + " process(es) waiting"
+ " for " + messageEventName + " with " + correlationVariable
+ " = '" + correlationValue + "': " + execInfoList);
+ messageEventName + " with " + correlationVariable
+ " = '" + correlationValue + "'; last exception was:"
+ queryException;
- LOGGER.debug(msg);
- LOGGER.error(MessageEnum.BPMN_GENERAL_EXCEPTION, "BPMN", MsoLogger.getServiceName(),
- MsoLogger.ErrorCode.UnknownError, msg, queryException);
+ logger.debug(msg);
+ logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION.toString(), "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), msg, queryException);
}
return false;
// acknowledged the notification associated with request #1.
try {
- LOGGER.debug(logMarker + " Running " + execInfoList.get(0) + " to receive "
+ logger.debug(logMarker + " Running " + execInfoList.get(0) + " to receive "
+ messageEventName + " with " + correlationVariable + " = '"
+ correlationValue + "'");
String msg = "Caught " + ole.getClass().getSimpleName() + " after receiving " + messageEventName
+ " with " + correlationVariable + " = '" + correlationValue
+ "': " + ole;
- LOGGER.debug(msg);
- LOGGER.error(MessageEnum.BPMN_GENERAL_EXCEPTION, "BPMN CORRELATION ERROR -", MsoLogger.getServiceName(),
- MsoLogger.ErrorCode.UnknownError, msg, ole);
+ logger.debug(msg);
+ logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION.toString(), "BPMN CORRELATION ERROR -",
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), msg, ole);
//Retry for OptimisticLocking Exceptions
int retryCount = 0;
}
}
- LOGGER.debug("Retry correlate for OptimisticLockingException, retryCount:" + retryCount);
+ logger.debug("Retry correlate for OptimisticLockingException, retryCount:{}", retryCount);
for (; retryCount >0 ; retryCount--) {
.processInstanceVariableEquals(correlationVariable, correlationValue)
.correlateWithResult();
retryCount = 0;
- LOGGER.debug("OptimisticLockingException retry was successful, seting retryCount: " + retryCount);
+ logger.debug("OptimisticLockingException retry was successful, seting retryCount: {}", retryCount);
} catch (OptimisticLockingException olex) {
//oleFlag = ex instanceof org.camunda.bpm.engine.OptimisticLockingException;
String strMsg = "Received exception, OptimisticLockingException retry failed, retryCount:" + retryCount + " | exception returned: " + olex;
- LOGGER.debug(strMsg);
- LOGGER.error(MessageEnum.BPMN_GENERAL_EXCEPTION, "BPMN", MsoLogger.getServiceName(),
- MsoLogger.ErrorCode.UnknownError, strMsg, olex);
+ logger.debug(strMsg);
+ logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION.toString(), "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), strMsg, olex);
} catch (Exception excep) {
retryCount = 0;
//oleFlag = ex instanceof org.camunda.bpm.engine.OptimisticLockingException;
String strMsg = "Received exception, OptimisticLockingException retry failed, retryCount:" + retryCount + " | exception returned: " + excep;
- LOGGER.debug(strMsg);
- LOGGER.error(MessageEnum.BPMN_GENERAL_EXCEPTION, "BPMN", MsoLogger.getServiceName(),
- MsoLogger.ErrorCode.UnknownError, strMsg, excep);
+ logger.debug(strMsg);
+ logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION.toString(), "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), strMsg, excep);
}
}
+ execInfoList.get(0) + " after receiving " + messageEventName
+ " with " + correlationVariable + " = '" + correlationValue
+ "': " + e;
- LOGGER.debug(msg);
- LOGGER.error(MessageEnum.BPMN_GENERAL_EXCEPTION, "BPMN", MsoLogger.getServiceName(),
- MsoLogger.ErrorCode.UnknownError, msg, e);
+ logger.debug(msg);
+ logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION.toString(), "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), msg, e);
}
} catch (Exception e) {
// This must be an exception from the flow itself. Log it, but don't
String msg = "Caught " + e.getClass().getSimpleName() + " after receiving " + messageEventName
+ " with " + correlationVariable + " = '" + correlationValue
+ "': " + e;
- LOGGER.debug(msg);
- LOGGER.error(MessageEnum.BPMN_GENERAL_EXCEPTION, "BPMN CORRELATION ERROR -", MsoLogger.getServiceName(),
- MsoLogger.ErrorCode.UnknownError, msg, e);
+ logger.debug(msg);
+ logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION.toString(), "BPMN CORRELATION ERROR -",
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), msg, e);
}
return true;
* @param startTime the request start time
*/
protected void logCallbackSuccess(String method, long startTime) {
- LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.COMPLETE,
- MsoLogger.ResponseCode.Suc, "Completed " + method);
-
- LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE,
- MsoLogger.ResponseCode.Suc, "Completed " + method,
- "BPMN", MsoLogger.getServiceName(), null);
}
/**
*/
protected void logCallbackError(String method, long startTime, String msg, Exception e) {
if (e == null) {
- LOGGER.error(MessageEnum.BPMN_CALLBACK_EXCEPTION, "BPMN", MsoLogger.getServiceName(),
- MsoLogger.ErrorCode.UnknownError, msg);
+ logger.error("{} {} {} {} {}", MessageEnum.BPMN_CALLBACK_EXCEPTION.toString(), "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), msg);
} else {
- LOGGER.error(MessageEnum.BPMN_CALLBACK_EXCEPTION, "BPMN", MsoLogger.getServiceName(),
- MsoLogger.ErrorCode.UnknownError, msg, e);
+ logger.error("{} {} {} {} {}", MessageEnum.BPMN_CALLBACK_EXCEPTION.toString(), "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), msg, e);
}
-
- LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.COMPLETE,
- MsoLogger.ResponseCode.InternalError, "Completed " + method);
-
- LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE,
- MsoLogger.ResponseCode.InternalError, "Completed " + method,
- "BPMN", MsoLogger.getServiceName(), null);
}
/**
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
import org.onap.so.bpmn.common.workflow.context.WorkflowContext;
import org.onap.so.bpmn.common.workflow.context.WorkflowContextHolder;
import org.onap.so.bpmn.common.workflow.context.WorkflowResponse;
-import org.onap.so.logger.MsoLogger;
import org.openecomp.mso.bpmn.common.workflow.service.WorkflowProcessorException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.slf4j.MDC;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
this.processor = processor;
}
- protected static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL,WorkflowAsyncResource.class);
+ protected static final Logger logger = LoggerFactory.getLogger(WorkflowAsyncResource.class);
protected static final long DEFAULT_WAIT_TIME = 60000; //default wait time
/**
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
import org.onap.so.bpmn.common.workflow.service.CallbackHandlerService.CallbackResult;
import org.onap.so.logger.MessageEnum;
import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Api(description = "Provides a generic service to inject messages into a waiting BPMN Proccess")
@Component
public class WorkflowMessageResource{
- private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, WorkflowMessageResource.class);
+ private static final Logger logger = LoggerFactory.getLogger(WorkflowMessageResource.class);
private static final String LOGMARKER = "[WORKFLOW-MESSAGE]";
@Autowired
MsoLogger.setServiceName("MSO." + method);
MsoLogger.setLogContext(correlator, "N/A");
- LOGGER.debug(LOGMARKER + " Received workflow message"
+ logger.debug(LOGMARKER + " Received workflow message"
+ " type='" + messageType + "'"
+ " correlator='" + correlator + "'"
+ (contentType == null ? "" : " contentType='" + contentType + "'")
if (messageType == null || messageType.isEmpty()) {
String msg = "Missing message type";
- LOGGER.debug(LOGMARKER + " " + msg);
- LOGGER.error(MessageEnum.BPMN_GENERAL_EXCEPTION, "BPMN", MsoLogger.getServiceName(),
- MsoLogger.ErrorCode.DataError, LOGMARKER + ":" + msg);
+ logger.debug(LOGMARKER + " " + msg);
+ logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION.toString(), "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.DataError.getValue(), LOGMARKER + ":" + msg);
return Response.status(400).entity(msg).build();
}
if (correlator == null || correlator.isEmpty()) {
String msg = "Missing correlator";
- LOGGER.debug(LOGMARKER + " " + msg);
- LOGGER.error(MessageEnum.BPMN_GENERAL_EXCEPTION, "BPMN", MsoLogger.getServiceName(),
- MsoLogger.ErrorCode.DataError, LOGMARKER + ":" + msg);
+ logger.debug(LOGMARKER + " " + msg);
+ logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION.toString(), "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.DataError.getValue(), LOGMARKER + ":" + msg);
return Response.status(400).entity(msg).build();
}
return Response.status(204).build();
}
}
-}
\ No newline at end of file
+}
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
import org.camunda.bpm.engine.runtime.ProcessInstance;
import org.camunda.bpm.engine.variable.impl.VariableMapImpl;
import org.onap.so.bpmn.common.workflow.context.WorkflowResponse;
-import org.onap.so.logger.MsoLogger;
import org.openecomp.mso.bpmn.common.workflow.service.WorkflowProcessorException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
@Service
public class WorkflowProcessor extends ProcessEngineAwareService {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, WorkflowProcessor.class);
+ private static final Logger logger = LoggerFactory.getLogger(WorkflowProcessor.class);
protected static final String logMarker = "[WRKFLOW-RESOURCE]";
@Async
// Note: this creates a random businessKey if it wasn't specified.
String businessKey = getBusinessKey(inputVariables);
- msoLogger.debug("***Received MSO startProcessInstanceByKey with processKey: " + processKey
- + " and variables: " + inputVariables);
+ logger.debug("***Received MSO startProcessInstanceByKey with processKey: {} and variables: {}", processKey,
+ inputVariables);
RuntimeService runtimeService = getProcessEngineServices().getRuntimeService();
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(processKey, businessKey,
inputVariables);
processInstanceId = processInstance.getId();
- msoLogger.debug(logMarker + "Process " + processKey + ":" + processInstanceId + " "
+ logger.debug(logMarker + "Process " + processKey + ":" + processInstanceId + " "
+ (processInstance.isEnded() ? "ENDED" : "RUNNING"));
} catch (Exception e) {
-
- msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.InternalError,
- logMarker + "Error in starting the process: " + e.getMessage());
-
WorkflowResponse workflowResponse = new WorkflowResponse();
workflowResponse.setResponse("Error occurred while executing the process: " + e);
workflowResponse.setProcessInstanceID(processInstanceId);
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
import org.onap.so.bpmn.core.WorkflowException;
import org.onap.so.logger.MessageEnum;
import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.slf4j.MDC;
import org.springframework.stereotype.Component;
@Component
public class WorkflowResource extends ProcessEngineAwareService {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, WorkflowResource.class);
+ private static final Logger logger = LoggerFactory.getLogger(WorkflowResource.class);
private static final String LOGMARKER = "[WRKFLOW-RESOURCE]";
private static final int DEFAULT_WAIT_TIME = 30000;
try {
//Kickoff the process
- ProcessThread thread = new ProcessThread(inputVariables,processKey,msoLogger);
+ ProcessThread thread = new ProcessThread(inputVariables,processKey);
thread.start();
Map<String, Object> responseMap = null;
processInstance = thread.getProcessInstance();
if (processInstance == null) {
- msoLogger.debug(LOGMARKER + processKey + " process has not been created yet");
+ logger.debug("{} process has not been created yet", LOGMARKER + processKey );
continue;
}
responseMap = getResponseMap(processInstance, processKey, timeProcessEnded);
if (responseMap == null) {
- msoLogger.debug(LOGMARKER + processKey + " has not produced a response yet");
+ logger.debug("{} has not produced a response yet", LOGMARKER + processKey);
if (timeProcessEnded.longValue() != 0) {
long elapsedSinceEnded = System.currentTimeMillis() - timeProcessEnded.longValue();
workflowResponse.setMessageCode(500);
return Response.status(500).entity(workflowResponse).build();
} catch (Exception ex) {
- msoLogger.debug(LOGMARKER + "Exception in startProcessInstance by key",ex);
+ logger.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());
-
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "BPMN", MDC.get(processKey),
- MsoLogger.ErrorCode.UnknownError, LOGMARKER + workflowResponse.getMessage()
- + " for processKey: " + processKey + " with response: " + workflowResponse.getResponse());
+
+ logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), "BPMN", MDC.get(processKey),
+ MsoLogger.ErrorCode.UnknownError.getValue(),
+ LOGMARKER + workflowResponse.getMessage() + " for processKey: " + processKey + " with response: "
+ + workflowResponse.getResponse());
workflowResponse.setMessageCode(500);
recordEvents(processKey, workflowResponse, startTime);
try {
return Integer.parseInt(timeout)*1000;
} catch (NumberFormatException nex) {
- msoLogger.debug("Invalid input for mso-service-request-timeout");
+ logger.debug("Invalid input for mso-service-request-timeout");
}
}
return DEFAULT_WAIT_TIME;
}
private void recordEvents(String processKey, WorkflowResponse response, long startTime) {
-
- msoLogger.recordMetricEvent ( startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
- LOGMARKER + response.getMessage() + " for processKey: "
- + processKey + " with response: " + response.getResponse(), "BPMN", MDC.get(processKey), null);
-
- msoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
- LOGMARKER + response.getMessage() + " for processKey: "
- + processKey + " with response: " + response.getResponse());
}
private void setLogContext(String processKey, Map<String, Object> inputVariables) {
try {
return pes.getRuntimeService().createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult() == null ? true : false ;
} catch (Exception e) {
- msoLogger.debug("Exception :",e);
+ logger.debug("Exception :",e);
return true;
}
}
try {
workflowResponse.setMessageCode(Integer.parseInt(responseCode));
} catch(NumberFormatException nex) {
- msoLogger.debug(LOGMARKER + "Failed to parse ResponseCode: " + responseCode);
+ logger.debug(LOGMARKER + "Failed to parse ResponseCode: " + responseCode);
workflowResponse.setMessageCode(-1);
}
} else if ("Fail".equalsIgnoreCase(String.valueOf(status))) {
workflowResponse.setMessage("Fail");
} else {
- msoLogger.debug(LOGMARKER + "Unrecognized Status: " + responseCode);
+ logger.debug(LOGMARKER + "Unrecognized Status: " + responseCode);
workflowResponse.setMessage("Fail");
}
}
private class ProcessThread extends Thread {
private final Map<String,Object> inputVariables;
private final String processKey;
- private final MsoLogger msoLogger;
private final String businessKey;
private ProcessInstance processInstance = null;
private Exception exception = null;
- public ProcessThread(Map<String, Object> inputVariables, String processKey, MsoLogger msoLogger) {
+ public ProcessThread(Map<String, Object> inputVariables, String processKey) {
this.inputVariables = inputVariables;
this.processKey = processKey;
- this.msoLogger = msoLogger;
this.businessKey = UUID.randomUUID().toString();
}
long startTime = System.currentTimeMillis();
try {
- msoLogger.debug(LOGMARKER + "***Received MSO startProcessInstanceByKey with processKey:"
- + processKey + " and variables: " + inputVariables);
-
- msoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, LOGMARKER
- + "Call to MSO workflow/services in Camunda. Received MSO startProcessInstanceByKey with"
- + " processKey:" + processKey
- + " businessKey:" + businessKey
- + " variables: " + inputVariables);
RuntimeService runtimeService = getProcessEngineServices().getRuntimeService();
processKey, inputVariables);
} catch (Exception e) {
- msoLogger.debug(LOGMARKER + "ProcessThread caught an exception executing "
+ logger.debug(LOGMARKER + "ProcessThread caught an exception executing "
+ processKey + ": " + e);
setException(e);
}
responseMapVariable);
if (responseMap != null) {
- msoLogger.debug(LOGMARKER + "Obtained " + responseMapVariable
+ logger.debug(LOGMARKER + "Obtained " + responseMapVariable
+ " from process " + processInstanceId + " history");
return responseMap;
}
// Check for 'WorkflowResponse' variable
Object workflowResponseObject = getVariableFromHistory(historyService, processInstanceId, "WorkflowResponse");
String workflowResponse = workflowResponseObject == null ? null : String.valueOf(workflowResponseObject);
- msoLogger.debug(LOGMARKER + "WorkflowResponse: " + workflowResponse);
+ logger.debug(LOGMARKER + "WorkflowResponse: " + workflowResponse);
if (workflowResponse != null) {
Object responseCodeObject = getVariableFromHistory(historyService, processInstanceId, prefix + "ResponseCode");
String responseCode = responseCodeObject == null ? null : String.valueOf(responseCodeObject);
- msoLogger.debug(LOGMARKER + prefix + "ResponseCode: " + responseCode);
+ logger.debug(LOGMARKER + prefix + "ResponseCode: " + responseCode);
responseMap = new HashMap<>();
responseMap.put("WorkflowResponse", workflowResponse);
responseMap.put("ResponseCode", responseCode);
}
}
- msoLogger.debug(LOGMARKER + "WorkflowException: " + workflowExceptionText);
+ logger.debug(LOGMARKER + "WorkflowException: " + workflowExceptionText);
// BEGIN LEGACY SUPPORT. TODO: REMOVE THIS CODE
Object object = getVariableFromHistory(historyService, processInstanceId, processKey + "Response");
String response = object == null ? null : String.valueOf(object);
- msoLogger.debug(LOGMARKER + processKey + "Response: " + response);
+ logger.debug(LOGMARKER + processKey + "Response: " + response);
if (response != null) {
object = getVariableFromHistory(historyService, processInstanceId, prefix + "ResponseCode");
String responseCode = object == null ? null : String.valueOf(object);
- msoLogger.debug(LOGMARKER + prefix + "ResponseCode: " + responseCode);
+ logger.debug(LOGMARKER + prefix + "ResponseCode: " + responseCode);
responseMap = new HashMap<>();
responseMap.put("Response", response);
responseMap.put("ResponseCode", responseCode);
object = getVariableFromHistory(historyService, processInstanceId, prefix + "ErrorResponse");
String errorResponse = object == null ? null : String.valueOf(object);
- msoLogger.debug(LOGMARKER + prefix + "ErrorResponse: " + errorResponse);
+ logger.debug(LOGMARKER + prefix + "ErrorResponse: " + errorResponse);
if (errorResponse != null) {
object = getVariableFromHistory(historyService, processInstanceId, prefix + "ResponseCode");
String responseCode = object == null ? null : String.valueOf(object);
- msoLogger.debug(LOGMARKER + prefix + "ResponseCode: " + responseCode);
+ logger.debug(LOGMARKER + prefix + "ResponseCode: " + responseCode);
responseMap = new HashMap<>();
responseMap.put("Response", errorResponse);
responseMap.put("ResponseCode", responseCode);
return runtimeService.getVariable(executionId, variableName);
} catch (ProcessEngineException e) {
// Most likely cause is that the execution no longer exists.
- msoLogger.debug("Error retrieving execution " + executionId
+ logger.debug("Error retrieving execution " + executionId
+ " variable " + variableName + ": " + e);
return null;
}
.processInstanceId(processInstanceId).variableName(variableName).singleResult();
return v == null ? null : v.getValue();
} catch (Exception e) {
- msoLogger.debug("Error retrieving process " + processInstanceId
- + " variable " + variableName + " from history: " + e);
+ logger.debug("Error retrieving process {} variable {} from history: ", processInstanceId,
+ variableName, e);
return null;
}
}
variablesMap.put(variableInstance.getName(), variableInstance.getValue().toString());
}
- msoLogger.debug(LOGMARKER + "***Received MSO getProcessVariables with processKey:" + processKey + " and variables: " + variablesMap.toString());
-
- msoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, LOGMARKER
- + "Call to MSO workflow/services in Camunda. Received MSO getProcessVariables with processKey:"
- + processKey + " and variables: "
- + variablesMap.toString());
-
+ logger.debug(LOGMARKER + "***Received MSO getProcessVariables with processKey:" + processKey + " and variables: " +
+ variablesMap.toString());
response.setVariables(variablesMap);
response.setMessage("Success");
response.setResponse("Successfully retrieved the variables");
response.setProcessInstanceID(processInstanceId);
- msoLogger.debug(LOGMARKER + response.getMessage() + " for processKey: " + processKey + " with response: " + response.getResponse());
+ logger.debug(LOGMARKER + response.getMessage() + " for processKey: " + processKey + " with response: " + response
+ .getResponse());
} catch (Exception ex) {
response.setMessage("Fail");
response.setResponse("Failed to retrieve the variables," + ex.getMessage());
response.setProcessInstanceID(processInstanceId);
-
- msoLogger.error (MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "BPMN", MDC.get(processKey), MsoLogger.ErrorCode.UnknownError, LOGMARKER
- + response.getMessage()
- + " for processKey: "
- + processKey
- + " with response: "
- + response.getResponse());
- msoLogger.debug("Exception :",ex);
+
+ logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), "BPMN", MDC.get(processKey),
+ MsoLogger.ErrorCode.UnknownError.getValue(),
+ LOGMARKER + response.getMessage() + " for processKey: " + processKey + " with response: " + response
+ .getResponse());
+ logger.debug("Exception :",ex);
}
-
- msoLogger.recordMetricEvent ( startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
- LOGMARKER + response.getMessage() + " for processKey: "
- + processKey + " with response: " + response.getResponse(), "BPMN", MDC.get(processKey), null);
-
- msoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
- LOGMARKER + response.getMessage() + " for processKey: "
- + processKey + " with response: " + response.getResponse());
-
return response;
}
}
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
import org.onap.so.logger.MessageEnum;
import org.onap.so.logger.MsoLogger;
-import org.slf4j.MDC;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.AbstractEnvironment;
import org.springframework.core.env.Environment;
* Logs details about the current activity.
*/
public class LoggingExecutionListener implements ExecutionListener {
- private final MsoLogger logger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL,LoggingExecutionListener.class);
+ private final Logger logger = LoggerFactory.getLogger(LoggingExecutionListener.class);
private String event;
MsoLogger.setLogContext(requestId, svcid);
}
} catch(Exception e) {
- logger.error(e);
+ logger.error("Exception occurred", e);
}
}
}
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
import org.onap.so.bpmn.common.workflow.service.WorkflowAsyncResource;
import org.onap.so.bpmn.common.workflow.service.WorkflowMessageResource;
import org.onap.so.bpmn.common.workflow.service.WorkflowResource;
-import org.onap.so.logger.MsoLogger;
import org.onap.so.logging.cxf.interceptor.SOAPLoggingInInterceptor;
import org.onap.so.logging.cxf.interceptor.SOAPLoggingOutInterceptor;
import org.onap.so.logging.jaxrs.filter.JaxRsFilterLogging;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
@Configuration
public class CXFConfiguration {
- private static final MsoLogger logger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL,CXFConfiguration.class);
+ private static final Logger logger = LoggerFactory.getLogger(CXFConfiguration.class);
@Autowired
private Bus bus;
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
import org.camunda.bpm.application.ProcessApplicationInfo;
import org.camunda.bpm.engine.ProcessEngine;
import org.onap.so.bpmn.common.DefaultToShortClassNameBeanNameGenerator;
-import org.onap.so.logger.MsoLogger;
import org.onap.so.logging.jaxrs.filter.MDCTaskDecorator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@Filter(type = FilterType.ANNOTATION, classes = SpringBootApplication.class) })
public class MSOInfrastructureApplication {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL,
- MSOInfrastructureApplication.class);
+ private static final Logger logger = LoggerFactory.getLogger(MSOInfrastructureApplication.class);
@Value("${mso.async.core-pool-size}")
private int corePoolSize;
@PostDeploy
public void postDeploy(ProcessEngine processEngineInstance) {
- long startTime = System.currentTimeMillis();
-
- msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
- "Post deployment complete...");
}
@PreUndeploy
public void cleanup(ProcessEngine processEngine, ProcessApplicationInfo processApplicationInfo,
List<ProcessEngine> processEngines) {
- long startTime = System.currentTimeMillis();
-
- msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
- "Pre Undeploy complete...");
-
}
@Bean
executor.initialize();
return executor;
}
-}
\ No newline at end of file
+}
* ONAP - SO
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
+ * ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
import java.util.Map;
import java.util.UUID;
-import org.camunda.bpm.engine.RuntimeService;
-import org.camunda.bpm.engine.test.Deployment;
import org.junit.Assert;
-import org.junit.Ignore;
import org.junit.Test;
import org.onap.so.BaseIntegrationTest;
import org.onap.so.bpmn.core.WorkflowException;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Unit test for CreateAAIVfModule.bpmn.
public class CreateAAIVfModuleIT extends BaseIntegrationTest {
- MsoLogger logger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL,CreateAAIVfModuleIT.class);
+ Logger logger = LoggerFactory.getLogger(CreateAAIVfModuleIT.class);
@Test
public void TestCreateGenericVnfSuccess_200() {
.withStatus(200)));
}
-}
\ No newline at end of file
+}
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
import org.junit.Test;
import org.onap.so.BaseIntegrationTest;
import org.onap.so.bpmn.mock.FileUtil;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Unit tests for CreateAAIVfModuleVolumeGroup.bpmn.
public class CreateAAIVfModuleVolumeGroupIT extends BaseIntegrationTest {
- MsoLogger logger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL,CreateAAIVfModuleVolumeGroupIT.class);
+ Logger logger = LoggerFactory.getLogger(CreateAAIVfModuleVolumeGroupIT.class);
/**
* Test the happy path through the flow.
Assert.assertTrue(isProcessEnded(businessKey));
String response = (String) getVariableFromHistory(businessKey, "CAAIVfModVG_updateVfModuleResponse");
Integer responseCode = (Integer) getVariableFromHistory(businessKey, "CAAIVfModVG_updateVfModuleResponseCode");
- logger.debug("Subflow response code: " + responseCode);
- logger.debug("Subflow response: " + response);
+ logger.debug("Subflow response code: {}", responseCode);
+ logger.debug("Subflow response: {}", response);
Assert.assertEquals(200, responseCode.intValue());
logEnd();
Assert.assertTrue(isProcessEnded(businessKey));
String response = (String) getVariableFromHistory(businessKey, "CAAIVfModVG_getVfModuleResponse");
Integer responseCode = (Integer) getVariableFromHistory(businessKey, "CAAIVfModVG_getVfModuleResponseCode");
- logger.debug("Subflow response code: " + responseCode);
- logger.debug("Subflow response: " + response);
+ logger.debug("Subflow response code: {}", responseCode);
+ logger.debug("Subflow response: {}", response);
Assert.assertEquals(404, responseCode.intValue());
logEnd();
Assert.assertTrue(isProcessEnded(businessKey));
String response = (String) getVariableFromHistory(businessKey, "CAAIVfModVG_updateVfModuleResponse");
Integer responseCode = (Integer) getVariableFromHistory(businessKey, "CAAIVfModVG_updateVfModuleResponseCode");
- logger.debug("Subflow response code: " + responseCode);
- logger.debug("Subflow response: " + response);
+ logger.debug("Subflow response code: {}", responseCode);
+ logger.debug("Subflow response: {}", response);
Assert.assertEquals(404, responseCode.intValue());
logEnd();
import org.camunda.bpm.engine.RuntimeService;
import org.camunda.bpm.engine.test.Deployment;
import org.junit.Assert;
-import org.junit.Ignore;
import org.junit.Test;
import org.onap.so.BaseIntegrationTest;
import org.onap.so.bpmn.core.WorkflowException;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Unit test for DeleteAAIVfModule.bpmn.
public class DeleteAAIVfModuleIT extends BaseIntegrationTest {
private static final String EOL = "\n";
- MsoLogger logger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL,DeleteAAIVfModuleIT.class);
+ Logger logger = LoggerFactory.getLogger(DeleteAAIVfModuleIT.class);
@Test
public void TestDeleteGenericVnfSuccess_200() {
* ONAP - SO
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
+ * ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
import org.junit.Assert;
import org.junit.Test;
import org.onap.so.BaseIntegrationTest;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Unit test for FalloutHandler.bpmn.
public class FalloutHandlerIT extends BaseIntegrationTest {
- MsoLogger logger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL,FalloutHandlerIT.class);
+ Logger logger = LoggerFactory.getLogger(FalloutHandlerIT.class);
private void setupMocks() {
public void msoFalloutHandlerWithNotificationurlNoRequestId() throws Exception{
String method = getClass().getSimpleName() + "." + new Object() {
}.getClass().getEnclosingMethod().getName();
- logger.debug("STARTED TEST: " + method);
+ logger.debug("STARTED TEST: {}", method);
//Setup Mocks
setupMocks();
//Execute Flow
public void msoFalloutHandlerWithNoNotificationurlNoRequestId() throws Exception{
String method = getClass().getSimpleName() + "." + new Object() {
}.getClass().getEnclosingMethod().getName();
- logger.debug("STARTED TEST: " + method);
+ logger.debug("STARTED TEST: {}", method);
//Setup Mocks
setupMocks();
//Execute Flow
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
import org.junit.Assert;
import org.junit.Test;
import org.onap.so.BaseIntegrationTest;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Unit test for RainyDayHandler.bpmn.
*/
public class ManualHandlingIT extends BaseIntegrationTest {
- MsoLogger logger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL,ManualHandlingIT.class);
+ Logger logger = LoggerFactory.getLogger(ManualHandlingIT.class);
@Test
public void TestManualHandlingSuccess() {
List<Task> tasks = q.orderByTaskCreateTime().asc().list();
for (Task task : tasks) {
- logger.debug("TASK ID: " + task.getId());
- logger.debug("TASK NAME: " + task.getName());
+ logger.debug("TASK ID: {}", task.getId());
+ logger.debug("TASK NAME: {}", task.getName());
try {
logger.debug("Completing the task");
completeVariables.put("responseValue", "skip");
taskService.complete(task.getId(), completeVariables);
} catch(Exception e) {
- logger.debug("GOT EXCEPTION: " + e.getMessage());
+ logger.debug("GOT EXCEPTION: {}", e.getMessage());
}
}
Assert.assertTrue(isProcessEnded(businessKey));
}
-}
\ No newline at end of file
+}
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
import org.onap.so.bpmn.core.domain.ServiceInstance;
import org.onap.so.bpmn.core.domain.VnfResource;
import org.onap.so.bpmn.mock.FileUtil;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.util.ArrayList;
@Ignore
public class OofHomingTestIT extends BaseIntegrationTest {
- MsoLogger logger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL,CreateAAIVfModuleIT.class);
+ Logger logger = LoggerFactory.getLogger(CreateAAIVfModuleIT.class);
ServiceDecomposition serviceDecomposition = new ServiceDecomposition();
String subscriber = "";
vnfModel.setModelType("testModelTypeVNF");
vnf.setModelInfo(vnfModel);
vnfList.add(vnf);
- logger.debug("SERVICE DECOMP: " + serviceDecomposition.getServiceResourcesJsonString());
+ logger.debug("SERVICE DECOMP: {}", serviceDecomposition.getServiceResourcesJsonString());
serviceDecomposition.setModelInfo(sModel);
serviceDecomposition.setAllottedResources(arList);
serviceDecomposition.setVnfResources(vnfList);
ServiceDecomposition sd = (ServiceDecomposition) getVariableFromHistory(busKey,
"serviceDecomposition");
- logger.debug("In testHoming_success_vnfResourceList, ServiceDecomposition = " + sd);
+ logger.debug("In testHoming_success_vnfResourceList, ServiceDecomposition = {}", sd);
List<VnfResource> vnfResourceList = sd.getVnfResources();
-//logger.debug(" vnfResourceList = " + vnfResourceList);
vnfResourceList.get(0).setResourceId("test-resource-id-000");
// Invoke Homing
"WorkflowException");
ServiceDecomposition serviceDecompositionExp = (ServiceDecomposition) getVariableFromHistory(businessKey,
"serviceDecomposition");
- logger.debug("serviceDecompositionExp is: " + serviceDecompositionExp);
+ logger.debug("serviceDecompositionExp is: {}", serviceDecompositionExp);
Resource resourceVnf = serviceDecompositionExp.getServiceResource("test-resource-id-000");
- logger.debug("resourceVnf is: " + resourceVnf);
+ logger.debug("resourceVnf is: {}", resourceVnf);
HomingSolution resourceVnfHoming = resourceVnf.getHomingSolution();
String resourceVnfHomingString = resourceVnfHoming.toString();
- logger.debug("resourceVnfHomingString is: " + resourceVnfHomingString);
+ logger.debug("resourceVnfHomingString is: {}", resourceVnfHomingString);
resourceVnfHomingString = resourceVnfHomingString.replaceAll("\\s+", " ");
- logger.debug("Now resourceVnfHomingString is: " + resourceVnfHomingString);
+ logger.debug("Now resourceVnfHomingString is: {}", resourceVnfHomingString);
assertNull(workflowException);
//Verify request
String oofRequest = (String) getVariableFromHistory(businessKey, "oofRequest");
- logger.debug("oofRequest is: " + oofRequest);
+ logger.debug("oofRequest is: {}", oofRequest);
assertEquals(FileUtil.readResourceFile("__files/BuildingBlocks/oofRequest_infravnf").
replaceAll("\n", "").replaceAll("\r", "").
replaceAll("\t", ""), oofRequest.replaceAll("\n", "").
replaceAll("\r", "").replaceAll("\t", ""));
- //logger.debug("resourceVnfHoming.getVnf().getResourceId() is: " + resourceVnfHoming.getVnf().getResourceId());
-
assertEquals(homingSolutionService("service", "service-instance-01234",
"MDTNJ01", "test-resource-id-000","CloudOwner",
"mtmnj1a",
}
@Test
-
public void testHoming_error_inputVariable() throws Exception {
String businessKey = UUID.randomUUID().toString();
* ONAP - SO
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
+ * ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
import org.camunda.bpm.engine.test.Deployment;
import org.junit.Assert;
-import org.junit.Ignore;
import org.junit.Test;
import org.onap.so.BaseIntegrationTest;
import org.onap.so.bpmn.core.WorkflowException;
import org.onap.so.bpmn.mock.FileUtil;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Unit tests for PrepareUpdateAAIVfModule.bpmn.
public class PrepareUpdateAAIVfModuleIT extends BaseIntegrationTest {
- MsoLogger logger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL,PrepareUpdateAAIVfModuleIT.class);
+ Logger logger = LoggerFactory.getLogger(PrepareUpdateAAIVfModuleIT.class);
/**
* Test the happy path through the flow.
Assert.assertTrue(isProcessEnded(businessKey));
String response = (String) getVariableFromHistory(businessKey, "PUAAIVfMod_updateVfModuleResponse");
Integer responseCode = (Integer) getVariableFromHistory(businessKey, "PUAAIVfMod_updateVfModuleResponseCode");
- logger.debug("Subflow response code: " + responseCode);
- logger.debug("Subflow response: " + response);
+ logger.debug("Subflow response code: {}", responseCode);
+ logger.debug("Subflow response: {}", response);
Assert.assertEquals(200, responseCode.intValue());
String heatStackId = (String) getVariableFromHistory(businessKey, "PUAAIVfMod_heatStackId");
- logger.debug("Ouput heat-stack-id:" + heatStackId);
+ logger.debug("Ouput heat-stack-id:{}", heatStackId);
Assert.assertEquals("slowburn", heatStackId);
logEnd();
String response = (String) getVariableFromHistory(businessKey, "PUAAIVfMod_getVnfResponse");
Integer responseCode = (Integer) getVariableFromHistory(businessKey, "PUAAIVfMod_getVnfResponseCode");
WorkflowException workflowException = (WorkflowException) getVariableFromHistory(businessKey, "WorkflowException");
- logger.debug("Subflow response code: " + responseCode);
- logger.debug("Subflow response: " + response);
+ logger.debug("Subflow response code: {}", responseCode);
+ logger.debug("Subflow response: {}", response);
Assert.assertEquals(404, responseCode.intValue());
Assert.assertNotNull(workflowException);
- logger.debug("Subflow WorkflowException error message: " + workflowException.getErrorMessage());
+ logger.debug("Subflow WorkflowException error message: {}", workflowException.getErrorMessage());
logEnd();
}
WorkflowException workflowException = (WorkflowException) getVariableFromHistory(businessKey, "WorkflowException");
Assert.assertNotNull(workflowException);
- logger.debug("Subflow WorkflowException error message: " + workflowException.getErrorMessage());
+ logger.debug("Subflow WorkflowException error message: {}", workflowException.getErrorMessage());
Assert.assertTrue(workflowException.getErrorMessage().startsWith("VF Module validation error: Orchestration"));
logEnd();
WorkflowException workflowException = (WorkflowException) getVariableFromHistory(businessKey, "WorkflowException");
Assert.assertNotNull(workflowException);
- logger.debug("Subflow WorkflowException error message: " + workflowException.getErrorMessage());
+ logger.debug("Subflow WorkflowException error message: {}", workflowException.getErrorMessage());
Assert.assertTrue(workflowException.getErrorMessage().startsWith("VF Module validation error: VF Module"));
logEnd();
String response = (String) getVariableFromHistory(businessKey, "PUAAIVfMod_updateVfModuleResponse");
Integer responseCode = (Integer) getVariableFromHistory(businessKey, "PUAAIVfMod_updateVfModuleResponseCode");
WorkflowException workflowException = (WorkflowException) getVariableFromHistory(businessKey, "WorkflowException");
- logger.debug("Subflow response code: " + responseCode);
- logger.debug("Subflow response: " + response);
+ logger.debug("Subflow response code: {}", responseCode);
+ logger.debug("Subflow response: {}", response);
Assert.assertEquals(404, responseCode.intValue());
Assert.assertNotNull(workflowException);
- logger.debug("Subflow WorkflowException error message: " + workflowException.getErrorMessage());
+ logger.debug("Subflow WorkflowException error message: {}", workflowException.getErrorMessage());
logEnd();
}
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
import org.junit.Test;
import org.onap.so.BaseIntegrationTest;
import org.onap.so.bpmn.mock.FileUtil;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Unit tests for SDNCAdapterRestV2.bpmn.
private final CallbackSet callbacks = new CallbackSet();
- MsoLogger logger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL,SDNCAdapterRestV2IT.class);
+ Logger logger = LoggerFactory.getLogger(SDNCAdapterRestV2IT.class);
/**
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
import org.onap.so.bpmn.core.WorkflowException;
import org.onap.so.bpmn.core.domain.*;
import org.onap.so.bpmn.mock.FileUtil;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
@Ignore
public class SniroHomingV1IT extends BaseIntegrationTest {
- MsoLogger logger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL,SniroHomingV1IT.class);
+ Logger logger = LoggerFactory.getLogger(SniroHomingV1IT.class);
ServiceDecomposition serviceDecomposition = new ServiceDecomposition();
vnfModel.setModelType("testModelTypeVNF");
vnf.setModelInfo(vnfModel);
vnfList.add(vnf);
- logger.debug("SERVICE DECOMP: " + serviceDecomposition.getServiceResourcesJsonString());
+ logger.debug("SERVICE DECOMP: {}", serviceDecomposition.getServiceResourcesJsonString());
serviceDecomposition.setModelInfo(sModel);
serviceDecomposition.setAllottedResources(arList);
serviceDecomposition.setVnfResources(vnfList);
* ONAP - SO
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
+ * ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
import org.onap.so.BaseIntegrationTest;
import org.onap.so.bpmn.core.WorkflowException;
import org.onap.so.bpmn.mock.FileUtil;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Unit tests for UpdateAAIGenericVnf bpmn.
public class UpdateAAIGenericVnfIT extends BaseIntegrationTest {
- MsoLogger logger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL,CreateAAIVfModuleIT.class);
+ Logger logger = LoggerFactory.getLogger(CreateAAIVfModuleIT.class);
/**
Assert.assertTrue(isProcessEnded(businessKey));
String response = (String) getVariableFromHistory(businessKey, "UAAIGenVnf_updateGenericVnfResponse");
Integer responseCode = (Integer) getVariableFromHistory(businessKey, "UAAIGenVnf_updateGenericVnfResponseCode");
- logger.debug("Subflow response code: " + responseCode);
- logger.debug("Subflow response: " + response);
+ logger.debug("Subflow response code: {}", responseCode);
+ logger.debug("Subflow response: {}", response);
Assert.assertEquals(200, responseCode.intValue());
logEnd();
Assert.assertTrue(isProcessEnded(businessKey));
WorkflowException workflowException = (WorkflowException) getVariableFromHistory(businessKey, "WorkflowException");
- logger.debug("Workflow Exception: " + workflowException);
+ logger.debug("Workflow Exception: {}", workflowException);
Assert.assertNotNull(workflowException);
logEnd();
Assert.assertTrue(isProcessEnded(businessKey));
String response = (String) getVariableFromHistory(businessKey, "UAAIGenVnf_getGenericVnfResponse");
Integer responseCode = (Integer) getVariableFromHistory(businessKey, "UAAIGenVnf_getGenericVnfResponseCode");
- logger.debug("Subflow response code: " + responseCode);
- logger.debug("Subflow response: " + response);
+ logger.debug("Subflow response code: {}", responseCode);
+ logger.debug("Subflow response: {}", response);
Assert.assertEquals(404, responseCode.intValue());
logEnd();
Assert.assertTrue(isProcessEnded(businessKey));
String response = (String) getVariableFromHistory(businessKey, "UAAIGenVnf_updateGenericVnfResponse");
Integer responseCode = (Integer) getVariableFromHistory(businessKey, "UAAIGenVnf_updateGenericVnfResponseCode");
- logger.debug("Subflow response code: " + responseCode);
- logger.debug("Subflow response: " + response);
+ logger.debug("Subflow response code: {}", responseCode);
+ logger.debug("Subflow response: {}", response);
Assert.assertEquals(404, responseCode.intValue());
logEnd();
* ONAP - SO
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
+ * ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
import org.onap.so.BaseIntegrationTest;
import org.onap.so.bpmn.mock.FileUtil;
import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Unit tests for UpdateAAIVfModuleTest.bpmn.
public class UpdateAAIVfModuleIT extends BaseIntegrationTest {
- MsoLogger logger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL,CreateAAIVfModuleIT.class);
+ Logger logger = LoggerFactory.getLogger(CreateAAIVfModuleIT.class);
/**
Assert.assertTrue(isProcessEnded(businessKey));
String response = (String) getVariableFromHistory(businessKey, "UAAIVfMod_updateVfModuleResponse");
Integer responseCode = (Integer) getVariableFromHistory(businessKey, "UAAIVfMod_updateVfModuleResponseCode");
- logger.debug("Subflow response code: " + responseCode);
- logger.debug("Subflow response: " + response);
+ logger.debug("Subflow response code: {}", responseCode);
+ logger.debug("Subflow response: {}", response);
Assert.assertEquals(200, responseCode.intValue());
logEnd();
Assert.assertTrue(isProcessEnded(businessKey));
String response = (String) getVariableFromHistory(businessKey, "UAAIVfMod_getVfModuleResponse");
Integer responseCode = (Integer) getVariableFromHistory(businessKey, "UAAIVfMod_getVfModuleResponseCode");
- logger.debug("Subflow response code: " + responseCode);
- logger.debug("Subflow response: " + response);
+ logger.debug("Subflow response code: {}", responseCode);
+ logger.debug("Subflow response: {}", response);
Assert.assertEquals(404, responseCode.intValue());
logEnd();
Assert.assertTrue(isProcessEnded(businessKey));
String response = (String) getVariableFromHistory(businessKey, "UAAIVfMod_updateVfModuleResponse");
Integer responseCode = (Integer) getVariableFromHistory(businessKey, "UAAIVfMod_updateVfModuleResponseCode");
- logger.debug("Subflow response code: " + responseCode);
- logger.debug("Subflow response: " + response);
+ logger.debug("Subflow response code: {}", responseCode);
+ logger.debug("Subflow response: {}", response);
Assert.assertEquals(404, responseCode.intValue());
logEnd();
/*-
- * ============LICENSE_START=======================================================
+ * ============LICENSE_START=======================================================
* ONAP - SO
- * ================================================================================
+ * ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
+ * ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
import org.junit.Test;
import org.onap.so.BaseIntegrationTest;
import org.onap.so.bpmn.core.WorkflowException;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Unit tests for VnfAdapterRestV1.
public class VnfAdapterRestV1IT extends BaseIntegrationTest {
- MsoLogger logger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL,VnfAdapterRestV1IT.class);
+ Logger logger = LoggerFactory.getLogger(VnfAdapterRestV1IT.class);
private static final String EOL = "\n";
waitForProcessEnd(businessKey, 10000);
String response = (String) getVariableFromHistory(businessKey, "vnfAdapterRestV1Response");
- logger.debug("Response:\n" + response);
+ logger.debug("Response:\n{}", response);
assertTrue(response!=null && response.contains("<createVfModuleResponse>"));
assertTrue((boolean) getVariableFromHistory(businessKey, "VNFREST_SuccessIndicator"));
waitForProcessEnd(businessKey, 10000);
String response = (String) getVariableFromHistory(businessKey, "vnfAdapterRestV1Response");
- logger.debug("Response:\n" + response);
+ logger.debug("Response:\n{}", response);
assertTrue(response.contains("<updateVfModuleResponse>"));
assertTrue((boolean) getVariableFromHistory(businessKey, "VNFREST_SuccessIndicator"));
waitForProcessEnd(businessKey, 10000);
String response = (String) getVariableFromHistory(businessKey, "vnfAdapterRestV1Response");
- logger.debug("Response:\n" + response);
+ logger.debug("Response:\n{}", response);
assertTrue(response.contains("<deleteVfModuleResponse>"));
assertTrue((boolean) getVariableFromHistory(businessKey, "VNFREST_SuccessIndicator"));
waitForProcessEnd(businessKey, 10000);
String response = (String) getVariableFromHistory(businessKey, "vnfAdapterRestV1Response");
- logger.debug("Response:\n" + response);
+ logger.debug("Response:\n{}", response);
assertTrue(response.contains("<rollbackVfModuleResponse>"));
assertTrue((boolean) getVariableFromHistory(businessKey, "VNFREST_SuccessIndicator"));
logger.debug(wfe.toString());
String response = (String) getVariableFromHistory(businessKey, "WorkflowResponse");
- logger.debug("Response:\n" + response);
+ logger.debug("Response:\n{}", response);
assertTrue(response.contains("<vfModuleException>"));
assertFalse((boolean) getVariableFromHistory(businessKey, "VNFREST_SuccessIndicator"));
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
import org.onap.so.bpmn.common.workflow.service.WorkflowResource;
import org.onap.so.bpmn.core.domain.Resource;
import org.onap.so.bpmn.core.domain.ServiceDecomposition;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
public abstract class WorkflowTest {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, WorkflowTest.class);
+ private static final Logger logger = LoggerFactory.getLogger(WorkflowTest.class);
//TODO this is not used anymore, can maybe be removed
@Rule
* Logs a test start method.
*/
protected void logStart() {
- msoLogger.debug("STARTED TEST");
+ logger.debug("STARTED TEST");
}
/**
* Logs a test end method.
*/
protected void logEnd() {
- msoLogger.debug("ENDED TEST");
+ logger.debug("ENDED TEST");
}
/**
protected void invokeSubProcess(String processKey, String businessKey, Map<String, Object> injectedVariables) {
RuntimeMXBean runtimeMxBean = ManagementFactory.getRuntimeMXBean();
List<String> arguments = runtimeMxBean.getInputArguments();
- msoLogger.debug("JVM args = " + arguments);
+ logger.debug("JVM args = {}", arguments);
msoRequestId = (String) injectedVariables.get("mso-request-id");
String requestId = (String) injectedVariables.get("msoRequestId");
if (msoRequestId == null && requestId == null) {
String msg = "mso-request-id variable was not provided";
- msoLogger.debug(msg);
+ logger.debug(msg);
fail(msg);
}
protected String invokeSubProcess(String processKey, Map<String, Object> injectedVariables) {
RuntimeMXBean runtimeMxBean = ManagementFactory.getRuntimeMXBean();
List<String> arguments = runtimeMxBean.getInputArguments();
- msoLogger.debug("JVM args = " + arguments);
+ logger.debug("JVM args = {}", arguments);
msoRequestId = (String) injectedVariables.get("mso-request-id");
String requestId = (String) injectedVariables.get("msoRequestId");
if (msoRequestId == null && requestId == null) {
String msg = "mso-request-id variable was not provided";
- msoLogger.debug(msg);
+ logger.debug(msg);
fail(msg);
}
RuntimeMXBean runtimeMxBean = ManagementFactory.getRuntimeMXBean();
List<String> arguments = runtimeMxBean.getInputArguments();
- msoLogger.debug("JVM args = " + arguments);
+ logger.debug("JVM args = {}", arguments);
Map<String, Object> variables = createVariables(schemaVersion, businessKey,
request, injectedVariables, false);
VariableMapImpl variableMapImpl = createVariableMapImpl(variables);
- msoLogger.debug("Sending " + request + " to " + processKey + " process");
+ logger.debug("Sending {} to {} process", request, processKey);
TestAsyncResponse asyncResponse = new TestAsyncResponse();
RuntimeMXBean runtimeMxBean = ManagementFactory.getRuntimeMXBean();
List<String> arguments = runtimeMxBean.getInputArguments();
- msoLogger.debug("JVM args = " + arguments);
+ logger.debug("JVM args = {}", arguments);
Map<String, Object> variables = createVariables(schemaVersion, businessKey,
request, injectedVariables, serviceInstantiationModel);
VariableMapImpl variableMapImpl = createVariableMapImpl(variables);
- msoLogger.debug("Sending " + request + " to " + processKey + " process");
+ logger.debug("Sending {} to {} process", request, processKey);
return workflowResource.startProcessInstanceByKey( processKey, variableMapImpl);
for (String var : notAllowed) {
if (var.equals(key)) {
String msg = "Cannot specify " + var + " in injected variables";
- msoLogger.debug(msg);
+ logger.debug(msg);
fail(msg);
}
}
catch(Exception e) {
}
if (msoRequestId == null || msoRequestId.trim().equals("")) {
- msoLogger.debug("No requestId element in injectedVariables");
+ logger.debug("No requestId element in injectedVariables");
variables.put("mso-request-id", UUID.randomUUID().toString());
}
if (msoServiceInstanceId == null || msoServiceInstanceId.trim().equals("")) {
- msoLogger.debug("No seviceInstanceId element in injectedVariables");
+ logger.debug("No seviceInstanceId element in injectedVariables");
variables.put("mso-service-instance-id", UUID.randomUUID().toString());
}
}
if (msoRequestId == null || msoRequestId.trim().equals("")) {
String msg = "No request-id element in " + request;
- msoLogger.debug(msg);
+ logger.debug(msg);
fail(msg);
}
}
*/
protected WorkflowResponse receiveResponse(String businessKey,
TestAsyncResponse asyncResponse, long timeout) {
- msoLogger.debug("Waiting " + timeout + "ms for process with business key " + businessKey
- + " to send a response");
+ logger.debug("Waiting {}ms for process with business key {} to send a response", timeout, businessKey);
long now = System.currentTimeMillis() + timeout;
long endTime = now + timeout;
Response response = asyncResponse.getResponse();
if (response != null) {
- msoLogger.debug("Received a response from process with business key " + businessKey);
+ logger.debug("Received a response from process with business key {}", businessKey);
Object entity = response.getEntity();
String msg = "Response entity is " +
(entity == null ? "null" : entity.getClass().getName()) +
", expected WorkflowResponse";
- msoLogger.debug(msg);
+ logger.debug(msg);
fail(msg);
return null; // unreachable
}
} catch (InterruptedException e) {
String msg = "Interrupted waiting for a response from process with business key " +
businessKey;
- msoLogger.debug(msg);
+ logger.debug(msg);
fail(msg);
return null; // unreachable
}
String msg = "No response received from process with business key " + businessKey +
" within " + timeout + "ms";
- msoLogger.debug(msg);
+ logger.debug(msg);
fail("Process with business key " + businessKey + " did not end within 10000ms");
return null; // unreachable
}
if (callbackData == null) {
String msg = "No callback defined for '" + action + "' SDNC request";
- msoLogger.debug(msg);
+ logger.debug(msg);
fail(msg);
}
contentType = JSON;
} else {
String msg = "Invalid SDNC program modifier: '" + modifier + "'";
- msoLogger.debug(msg);
+ logger.debug(msg);
fail(msg);
}
if (callbackData == null) {
String msg = "No callback defined for '" + action + "' SDNC request";
- msoLogger.debug(msg);
+ logger.debug(msg);
fail(msg);
}
if (callbackData == null) {
String msg = "No callback defined for '" + action + "' SDNC request";
- msoLogger.debug(msg);
+ logger.debug(msg);
fail(msg);
}
respMsg = "SERVER ERROR";
} else {
String msg = "Invalid SDNC program modifier: '" + modifier + "'";
- msoLogger.debug(msg);
+ logger.debug(msg);
fail(msg);
}
if (callbackData == null) {
String msg = "No callback defined for '" + action + "' VNF REST request";
- msoLogger.debug(msg);
+ logger.debug(msg);
fail(msg);
}
contentType = "text/plain";
} else {
String msg = "Invalid VNF REST program modifier: '" + modifier + "'";
- msoLogger.debug(msg);
+ logger.debug(msg);
fail(msg);
}
if (callbackData == null) {
String msg = "No callback defined for '" + action + "' VNF request";
- msoLogger.debug(msg);
+ logger.debug(msg);
fail(msg);
}
content = callbackData.getContent();
} else if ("ERR".equals(modifier)) {
String msg = "Currently unsupported VNF program modifier: '" + modifier + "'";
- msoLogger.debug(msg);
+ logger.debug(msg);
fail(msg);
} else {
String msg = "Invalid VNF program modifier: '" + modifier + "'";
- msoLogger.debug(msg);
+ logger.debug(msg);
fail(msg);
}
if (!injected) {
String msg = "Failed to inject VNF '" + action + "' callback";
- msoLogger.debug(msg);
+ logger.debug(msg);
fail(msg);
}
* @param timeout the timeout in milliseconds
*/
protected void waitForRunningProcessCount(String processKey, int count, long timeout) {
- msoLogger.debug("Waiting " + timeout + "ms for there to be " + count + " "
- + processKey + " instances");
+ logger.debug("Waiting {}ms for there to be {} {} instances", timeout, count, processKey);
long now = System.currentTimeMillis() + timeout;
long endTime = now + timeout;
.list().size();
if (actual != last) {
- msoLogger.debug("There are now " + actual + " "
- + processKey + " instances");
+ logger.debug("There are now {} {} instances", actual, processKey);
last = actual;
}
} catch (InterruptedException e) {
String msg = "Interrupted waiting for there to be " + count + " "
+ processKey + " instances";
- msoLogger.debug(msg);
+ logger.debug(msg);
fail(msg);
}
String msg = "Timed out waiting for there to be " + count + " "
+ processKey + " instances";
- msoLogger.debug(msg);
+ logger.debug(msg);
fail(msg);
}
protected Object getProcessVariable(String processKey, String variable,
long timeout) {
- msoLogger.debug("Waiting " + timeout + "ms for "
- + processKey + "." + variable + " to be set");
+ logger.debug("Waiting " + timeout + "ms for " + processKey + "." + variable + " to be set");
long now = System.currentTimeMillis() + timeout;
long endTime = now + timeout;
while (value == null) {
if (now > endTime) {
if (processInstance == null) {
- msoLogger.debug("Timed out waiting for "
+ logger.debug("Timed out waiting for "
+ processKey + " to start");
} else {
- msoLogger.debug("Timed out waiting for "
+ logger.debug("Timed out waiting for "
+ processKey + "[" + processInstance.getId()
+ "]." + variable + " to be set");
}
processInstance = processInstanceQuery.singleResult();
}else{
//TODO There shouldnt be more than one in the list but seems to be happening, need to figure out why happening and best way to get correct one from list
- msoLogger.debug("Process Instance Query returned " + processInstanceQuery.count() + " instance. Getting the last instance in the list");
+ logger.debug("Process Instance Query returned {} instance. Getting the last instance in the list",
+ processInstanceQuery.count());
List<ProcessInstance> processList = processInstanceQuery.list();
processInstance = processList.get((processList.size() - 1));
}
try {
Thread.sleep(200);
} catch (InterruptedException e) {
- msoLogger.debug("Interrupted waiting for "
- + processKey + "." + variable + " to be set");
+ logger.debug("Interrupted waiting for {}.{} to be set", processKey, variable);
return null;
}
now = System.currentTimeMillis();
}
- msoLogger.debug(processKey + "["
+ logger.debug(processKey + "["
+ processInstance.getId() + "]." + variable + "="
+ value);
// Deprecated usage. All test code should switch to the (( ... )) syntax.
content = content.replace("{{REQUEST-ID}}", sdncRequestId);
- msoLogger.debug("Injecting SDNC adapter callback");
+ logger.debug("Injecting SDNC adapter callback");
Response response = workflowMessageResource.deliver(contentType, "SDNCAResponse", sdncRequestId, content);
- msoLogger.debug("Workflow response to SDNC adapter callback: " + response);
+ logger.debug("Workflow response to SDNC adapter callback: " + response);
return true;
}
// TODO this needs to be fixed. It is causing double tags and content
// Need to parse content before setting below since content includes not just RequestData or modify callback files to only contain RequestData contents.
- msoLogger.debug("Injecting SDNC adapter callback");
+ logger.debug("Injecting SDNC adapter callback");
CallbackHeader callbackHeader = new CallbackHeader();
callbackHeader.setRequestId(sdncRequestId);
callbackHeader.setResponseCode(String.valueOf(respCode));
sdncAdapterCallbackRequest.setCallbackHeader(callbackHeader);
sdncAdapterCallbackRequest.setRequestData(content);
SDNCAdapterResponse sdncAdapterResponse = callbackService.sdncAdapterCallback(sdncAdapterCallbackRequest);
- msoLogger.debug("Workflow response to SDNC adapter callback: " + sdncAdapterResponse);
+ logger.debug("Workflow response to SDNC adapter callback: " + sdncAdapterResponse);
return true;
}
// Deprecated usage. All test code should switch to the (( ... )) syntax.
content = content.replace("{{MESSAGE-ID}}", messageId);
- msoLogger.debug("Injecting VNF adapter callback");
+ logger.debug("Injecting VNF adapter callback");
Response response = workflowMessageResource.deliver(contentType, "VNFAResponse", messageId, content);
- msoLogger.debug("Workflow response to VNF adapter callback: " + response);
+ logger.debug("Workflow response to VNF adapter callback: {}", response);
return true;
}
content = content.replace("{{REQUEST-ID}}", msoRequestId);
}
- msoLogger.debug("Injecting VNF adapter callback");
+ logger.debug("Injecting VNF adapter callback");
// Is it possible to unmarshal this with JAXB? I couldn't.
createVnfNotification.setRollback(rollback);
} catch (Exception e) {
- msoLogger.debug("Failed to unmarshal VNF callback content:");
- msoLogger.debug(content);
+ logger.debug("Failed to unmarshal VNF callback content:");
+ logger.debug(content);
return false;
}
// Deprecated usage. All test code should switch to the (( ... )) syntax.
content = content.replace("{{MESSAGE-ID}}", messageId);
- msoLogger.debug("Injecting VNF adapter delete callback");
+ logger.debug("Injecting VNF adapter delete callback");
// Is it possible to unmarshal this with JAXB? I couldn't.
}
} catch (Exception e) {
- msoLogger.debug("Failed to unmarshal VNF Delete callback content:");
- msoLogger.debug(content);
+ logger.debug("Failed to unmarshal VNF Delete callback content:");
+ logger.debug(content);
return false;
}
// Deprecated usage. All test code should switch to the (( ... )) syntax.
content = content.replace("{{REQUEST-ID}}", msoRequestId);
- msoLogger.debug("Injecting VNF adapter callback");
+ logger.debug("Injecting VNF adapter callback");
// Is it possible to unmarshal this with JAXB? I couldn't.
updateVnfNotification.setRollback(rollback);
} catch (Exception e) {
- msoLogger.debug("Failed to unmarshal VNF callback content:");
- msoLogger.debug(content);
+ logger.debug("Failed to unmarshal VNF callback content:");
+ logger.debug(content);
return false;
}
if (callbackData == null) {
String msg = "No '" + action + "' workflow message callback is defined";
- msoLogger.debug(msg);
+ logger.debug(msg);
fail(msg);
}
if (messageType == null || messageType.trim().equals("")) {
String msg = "No workflow message type is defined in the '" + action + "' callback";
- msoLogger.debug(msg);
+ logger.debug(msg);
fail(msg);
}
contentType = callbackData.getContentType();
} else {
String msg = "Invalid workflow message program modifier: '" + modifier + "'";
- msoLogger.debug(msg);
+ logger.debug(msg);
fail(msg);
}
content = content.replace("((CORRELATOR))", correlator);
}
- msoLogger.debug("Injecting " + messageType + " message");
+ logger.debug("Injecting " + messageType + " message");
Response response = workflowMessageResource.deliver(contentType, messageType, correlator, content);
- msoLogger.debug("Workflow response to " + messageType + " message: " + response);
+ logger.debug("Workflow response to {} message: {}", messageType, response);
return true;
}
if (callbackData == null) {
String msg = "No '" + action + "' workflow message callback is defined";
- msoLogger.debug(msg);
+ logger.debug(msg);
fail(msg);
}
if (messageType == null || messageType.trim().equals("")) {
String msg = "No workflow message type is defined in the '" + action + "' callback";
- msoLogger.debug(msg);
+ logger.debug(msg);
fail(msg);
}
contentType = callbackData.getContentType();
} else {
String msg = "Invalid workflow message program modifier: '" + modifier + "'";
- msoLogger.debug(msg);
+ logger.debug(msg);
fail(msg);
}
}
}
}
- msoLogger.debug("Injecting " + messageType + " message");
+ logger.debug("Injecting " + messageType + " message");
Response response = workflowMessageResource.deliver(contentType, messageType, correlator, content);
- msoLogger.debug("Workflow response to " + messageType + " message: " + response);
+ logger.debug("Workflow response to {} message: {}", messageType, response);
return true;
}
* @param timeout the amount of time to wait, in milliseconds
*/
protected void waitForProcessEnd(String businessKey, long timeout) {
- msoLogger.debug("Waiting " + timeout + "ms for process with business key " +
- businessKey + " to end");
+ logger.debug("Waiting {}ms for process with business key {} to end", timeout, businessKey);
long now = System.currentTimeMillis() + timeout;
long endTime = now + timeout;
while (now <= endTime) {
if (isProcessEnded(businessKey)) {
- msoLogger.debug("Process with business key " + businessKey + " has ended");
+ logger.debug("Process with business key {} has ended", businessKey);
return;
}
} catch (InterruptedException e) {
String msg = "Interrupted waiting for process with business key " +
businessKey + " to end";
- msoLogger.debug(msg);
+ logger.debug(msg);
fail(msg);
}
String msg = "Process with business key " + businessKey +
" did not end within " + timeout + "ms";
- msoLogger.debug(msg);
+ logger.debug(msg);
fail(msg);
}
* @author cb645j
*/
protected void waitForProcessEnd(String businessKey, String processName, long timeout) {
- msoLogger.debug("Waiting " + timeout + "ms for process with business key " +
- businessKey + " to end");
+ logger.debug("Waiting {}ms for process with business key {} to end", timeout, businessKey);
long now = System.currentTimeMillis() + timeout;
long endTime = now + timeout;
while (now <= endTime) {
if (isProcessEnded(businessKey, processName)) {
- msoLogger.debug("Process with business key " + businessKey + " has ended");
+ logger.debug("Process with business key {} has ended", businessKey);
return;
}
} catch (InterruptedException e) {
String msg = "Interrupted waiting for process with business key " +
businessKey + " to end";
- msoLogger.debug(msg);
+ logger.debug(msg);
fail(msg);
}
String msg = "Process with business key " + businessKey +
" did not end within " + timeout + "ms";
- msoLogger.debug(msg);
+ logger.debug(msg);
fail(msg);
}
.variableName(variableName).singleResult();
return v == null ? null : v.getValue();
} catch (Exception e) {
- msoLogger.debug("Error retrieving variable " + variableName +
- " from historical process with business key " + businessKey + ": " + e);
+ logger.debug("Error retrieving variable {} from historical process with business key {}: ", variableName, businessKey,
+ e);
return null;
}
}
return variable == null ? null : variable.getValue();
}catch(ProcessEngineException e){
- msoLogger.debug("Multiple proccess instances exist with process name " + processName + " and business key " + businessKey + ". Must pass instance index as a parameter.");
+ logger.debug("Multiple proccess instances exist with process name {} and business key {}. Must pass instance "
+ + "index as a parameter.", processName, businessKey);
return null;
}catch(Exception e){
- msoLogger.debug("Error retrieving variable " + variableName + " from historical process for process " + processName + " with business key " + businessKey + ": " + e);
+ logger.debug("Error retrieving variable {} from historical process for process {} with business key {}: ",
+ variableName, processName, businessKey, e);
return null;
}
}
return variable == null ? null : variable.getValue();
}catch(Exception e) {
- msoLogger.debug("Error retrieving variable " + variableName + " from historical process for process " + processName + " with business key " + businessKey + ": " + e);
+ logger.debug("Error retrieving variable {} from historical process for process {} with business key {}: ",
+ variableName, processName, businessKey, e);
return null;
}
}
.variableName(variableName).singleResult();
return v == null ? null : v.getValue();
} catch (Exception e) {
- msoLogger.debug("Error retrieving variable " + variableName +
- " from sub flow: " + subflowName + ", Exception is: " + e);
+ logger.debug("Error retrieving variable {} from sub flow: {}, Exception is: ", variableName, subflowName, e);
return null;
}
}
.variableName(variableName).singleResult();
return v == null ? null : v.getValue();
} catch (Exception e) {
- msoLogger.debug("Error retrieving variable " + variableName +
- " from " + subflowInstanceIndex + " instance index of sub flow: " + subflowName + ", Exception is: " + e);
+ logger.debug("Error retrieving variable {} from {} instance index of sub flow: {}, Exception is: ", variableName,
+ subflowInstanceIndex, subflowName, e);
return null;
}
}