* ================================================================================
* 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.logger.MessageEnum
import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
public class UpdateVfModule extends AbstractServiceTaskProcessor {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, UpdateVfModule.class);
+ private static final Logger logger = LoggerFactory.getLogger( UpdateVfModule.class);
ExceptionUtil exceptionUtil = new ExceptionUtil()
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
try {
initProcessVariables(execution)
String request = validateRequest(execution)
- msoLogger.debug("UpdateVfModule request: " + request)
+ logger.debug("UpdateVfModule request: " + request)
def requestInfo = getRequiredNodeXml(execution, request, 'request-info')
execution.setVariable('UPDVfMod_requestInfo', requestInfo)
execution.setVariable('UPDVfMod_requestId', getRequiredNodeText(execution, requestInfo, 'request-id'))
def vnfParams = utils.getNodeXml(request, 'vnf-params')
execution.setVariable('UPDVfMod_vnfParams', vnfParams)
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in preProcessRequest(): ' + e.getMessage())
}
}
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
try {
def requestInfo = execution.getVariable('UPDVfMod_requestInfo')
synchResponse = utils.formatXml(synchResponse)
sendWorkflowResponse(execution, 200, synchResponse)
- msoLogger.debug("UpdateVfModule Synch Response: " + synchResponse)
- msoLogger.trace('Exited ' + method)
+ logger.debug("UpdateVfModule Synch Response: " + synchResponse)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in sendSynchResponse(): ' + e.getMessage())
}
}
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
try {
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in prepDoUpdateVfModule(): ' + e.getMessage())
}
}
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
try {
def requestId = execution.getVariable('UPDVfMod_requestId')
updateInfraRequest = utils.formatXml(updateInfraRequest)
execution.setVariable('UPDVfMod_updateInfraRequest', updateInfraRequest)
- msoLogger.debug('Request for Update Infra Request:\n' + updateInfraRequest)
+ logger.debug('Request for Update Infra Request:\n' + updateInfraRequest)
- msoLogger.debug("UpdateVfModule Infra Request: " + updateInfraRequest)
- msoLogger.trace('Exited ' + method)
+ logger.debug("UpdateVfModule Infra Request: " + updateInfraRequest)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in prepUpdateInfraRequest(): ' + e.getMessage())
}
}
', resultVar=' + resultVar +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
try {
def requestInfo = getVariable(execution, 'UPDVfMod_requestInfo')
"""
content = utils.formatXml(content)
- msoLogger.debug(resultVar + ' = ' + System.lineSeparator() + content)
+ logger.debug(resultVar + ' = ' + System.lineSeparator() + content)
execution.setVariable(resultVar, content)
- msoLogger.debug("UpdateVfModule CompletionHandler Request: " + content)
- msoLogger.trace('Exited ' + method)
+ logger.debug("UpdateVfModule CompletionHandler Request: " + content)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 2000, 'Internal Error')
}
}
', resultVar=' + resultVar +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
try {
def prefix = execution.getVariable('prefix')
</sdncadapterworkflow:FalloutHandlerRequest>
"""
content = utils.formatXml(content)
- msoLogger.debug(resultVar + ' = ' + System.lineSeparator() + content)
+ logger.debug(resultVar + ' = ' + System.lineSeparator() + content)
execution.setVariable(resultVar, content)
- msoLogger.debug("UpdateVfModule fallOutHandler Request: " + content)
- msoLogger.trace('Exited ' + method)
+ logger.debug("UpdateVfModule fallOutHandler Request: " + content)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildWorkflowException(execution, 2000, 'Internal Error')
}
}