Cleaned up content of MsoLogger
[so.git] / bpmn / MSOCommonBPMN / src / main / groovy / org / onap / so / bpmn / common / scripts / VnfAdapterRestV1.groovy
index 50a0fe4..d8b2c4f 100644 (file)
@@ -78,8 +78,8 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
 
                        if (messageId == null || messageId.isEmpty()) {
                                String msg = getProcessKey(execution) + ': no messageId in ' + requestType
-                               logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
-                                               MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue());
+                               logger.error("{} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
+                                               MsoLogger.ErrorCode.UnknownError.getValue());
                                exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
                        }
 
@@ -92,8 +92,8 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
 
                        if (notificationUrl == null || notificationUrl.isEmpty()) {
                                String msg = getProcessKey(execution) + ': no notificationUrl in ' + requestType
-                               logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
-                                               MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue());
+                               logger.error("{} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
+                                               MsoLogger.ErrorCode.UnknownError.getValue());
                                exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
                        }
 
@@ -106,8 +106,8 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
 
                        if (vnfAdapterEndpoint == null || vnfAdapterEndpoint.isEmpty()) {
                                String msg = getProcessKey(execution) + ': mso:adapters:vnf:rest:endpoint URN mapping is not defined'
-                               logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
-                                               MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue());
+                               logger.error("{} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
+                                               MsoLogger.ErrorCode.UnknownError.getValue());
                                exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
                        }
 
@@ -124,8 +124,8 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
 
                                if (vnfId == null || vnfId.isEmpty()) {
                                        String msg = getProcessKey(execution) + ': no vnfId in ' + requestType
-                                       logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
-                                                       MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue());
+                                       logger.error("{} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
+                                                       MsoLogger.ErrorCode.UnknownError.getValue());
                                        exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
                                }
 
@@ -137,8 +137,8 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
 
                                if (vnfId == null || vnfId.isEmpty()) {
                                        String msg = getProcessKey(execution) + ': no vnfId in ' + requestType
-                                       logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
-                                                       MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue());
+                                       logger.error("{} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
+                                                       MsoLogger.ErrorCode.UnknownError.getValue());
                                        exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
                                }
 
@@ -146,8 +146,8 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
 
                                if (vfModuleId == null || vfModuleId.isEmpty()) {
                                        String msg = getProcessKey(execution) + ': no vfModuleId in ' + requestType
-                                       logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
-                                                       MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue());
+                                       logger.error("{} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
+                                                       MsoLogger.ErrorCode.UnknownError.getValue());
                                        exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
                                }
 
@@ -160,8 +160,8 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
 
                                if (vnfId == null || vnfId.isEmpty()) {
                                        String msg = getProcessKey(execution) + ': no vnfId in ' + requestType
-                                       logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
-                                                       MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue());
+                                       logger.error("{} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
+                                                       MsoLogger.ErrorCode.UnknownError.getValue());
                                        exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
                                }
 
@@ -169,8 +169,8 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
 
                                if (vfModuleId == null || vfModuleId.isEmpty()) {
                                        String msg = getProcessKey(execution) + ': no vfModuleId in ' + requestType
-                                       logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
-                                                       MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue());
+                                       logger.error("{} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
+                                                       MsoLogger.ErrorCode.UnknownError.getValue());
                                        exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
                                }
 
@@ -183,8 +183,8 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
 
                                if (vfModuleRollbackNode == null) {
                                        String msg = getProcessKey(execution) + ': no vfModuleRollback in ' + requestType
-                                       logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
-                                                       MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue());
+                                       logger.error("{} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
+                                                       MsoLogger.ErrorCode.UnknownError.getValue());
                                        exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
                                }
 
@@ -192,8 +192,8 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
 
                                if (vnfId == null || vnfId.isEmpty()) {
                                        String msg = getProcessKey(execution) + ': no vnfId in ' + requestType
-                                       logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
-                                                       MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue());
+                                       logger.error("{} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
+                                                       MsoLogger.ErrorCode.UnknownError.getValue());
                                        exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
                                }
 
@@ -201,8 +201,8 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
 
                                if (vfModuleId == null || vfModuleId.isEmpty()) {
                                        String msg = getProcessKey(execution) + ': no vfModuleId in ' + requestType
-                                       logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
-                                                       MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue());
+                                       logger.error("{} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
+                                                       MsoLogger.ErrorCode.UnknownError.getValue());
                                        exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
                                }
 
@@ -222,8 +222,8 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
 
                                if (volumeGroupId == null || volumeGroupId.isEmpty()) {
                                        String msg = getProcessKey(execution) + ': no volumeGroupId in ' + requestType
-                                       logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
-                                                       MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue());
+                                       logger.error("{} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
+                                                       MsoLogger.ErrorCode.UnknownError.getValue());
                                        exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
                                }
 
@@ -238,8 +238,8 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
 
                                if (volumeGroupId == null || volumeGroupId.isEmpty()) {
                                        String msg = getProcessKey(execution) + ': no volumeGroupId in ' + requestType
-                                       logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
-                                                       MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue());
+                                       logger.error("{} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
+                                                       MsoLogger.ErrorCode.UnknownError.getValue());
                                        exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
                                }
 
@@ -254,8 +254,8 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
 
                                if (volumeGroupId == null || volumeGroupId.isEmpty()) {
                                        String msg = getProcessKey(execution) + ': no volumeGroupId in ' + requestType
-                                       logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
-                                                       MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue());
+                                       logger.error("{} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
+                                                       MsoLogger.ErrorCode.UnknownError.getValue());
                                        exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
                                }
 
@@ -267,8 +267,8 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
 
                        } else {
                                String msg = getProcessKey(execution) + ': Unsupported request type: ' + requestType
-                               logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
-                                               MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue());
+                               logger.error("{} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
+                                               MsoLogger.ErrorCode.UnknownError.getValue());
                                exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
                        }
 
@@ -284,17 +284,17 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
                        String basicAuthValue = UrnPropertiesReader.getVariable("mso.adapters.po.auth", execution)
 
                        if (basicAuthValue == null || basicAuthValue.isEmpty()) {
-                               logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+                               logger.error("{} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
                                                getProcessKey(execution) + ": mso:adapters:po:auth URN mapping is not defined", "BPMN",
-                                               MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue());
+                                               MsoLogger.ErrorCode.UnknownError.getValue());
                        } else {
                                try {
                                        def encodedString = utils.getBasicAuth(basicAuthValue, UrnPropertiesReader.getVariable("mso.msoKey", execution))
                                        execution.setVariable(prefix + 'basicAuthHeaderValue', encodedString)
                                } catch (IOException ex) {
-                                       logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+                                       logger.error("{} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
                                                        getProcessKey(execution) + ": Unable to encode BasicAuth credentials for VnfAdapter",
-                                                       "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue());
+                                                       "BPMN", MsoLogger.ErrorCode.UnknownError.getValue());
                                }
                        }
 
@@ -303,8 +303,8 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
                        throw e
                } catch (Exception e) {
                        String msg = 'Caught exception in ' + method + ": " + e
-                       logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
-                                       MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue());
+                       logger.error("{} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
+                                       MsoLogger.ErrorCode.UnknownError.getValue());
                        logger.debug(msg)
                        exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
                }
@@ -355,8 +355,8 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
                                response = httpClient.delete(vnfAdapterRequest)
                        } else {
                                String msg = 'Unsupported HTTP method "' + vnfAdapterMethod + '" in ' + method + ": " + e
-                               logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
-                                               MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue());
+                               logger.error("{} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
+                                               MsoLogger.ErrorCode.UnknownError.getValue());
                                exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
                        }
 
@@ -368,8 +368,8 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
                        throw e
                } catch (Exception e) {
                        String msg = 'Caught exception in ' + method + ": " + e
-                       logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
-                                       MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue());
+                       logger.error("{} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
+                                       MsoLogger.ErrorCode.UnknownError.getValue());
                        exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
                }
        }