diff options
author | r.bogacki <r.bogacki@samsung.com> | 2019-03-14 15:24:57 +0100 |
---|---|---|
committer | r.bogacki <r.bogacki@samsung.com> | 2019-03-18 11:02:58 +0100 |
commit | faa0b29e3b7b1fa23a1444a5d9ac020b3c60dedc (patch) | |
tree | 4839f982eb10e66e587b55b757ffc00dd5f9d30f /asdc-controller/src | |
parent | 4ca3abdffa40e7777a233151f66ee0b4131ed538 (diff) |
Removed MsoLogger class
Bye bye MsoLogger class.
Extracted constants to separated classes.
Fixed imports.
Change-Id: I7c8e0527e7dbd097d3ea93b9dab279354652da47
Issue-ID: LOG-631
Signed-off-by: Robert Bogacki <r.bogacki@samsung.com>
Diffstat (limited to 'asdc-controller/src')
5 files changed, 24 insertions, 24 deletions
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java b/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java index dc30b0e7de..fd810e1e67 100644 --- a/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java +++ b/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java @@ -57,8 +57,8 @@ import org.onap.so.asdc.tenantIsolation.WatchdogDistribution; import org.onap.so.asdc.util.ASDCNotificationLogging; import org.onap.so.db.request.beans.WatchdogDistributionStatus; import org.onap.so.db.request.data.repository.WatchdogDistributionStatusRepository; +import org.onap.so.logger.ErrorCode; 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; @@ -308,7 +308,7 @@ public class ASDCController { } else { logger.error("{} {} {} {} {} {} {}", MessageEnum.ASDC_ARTIFACT_DOWNLOAD_FAIL.toString(), artifact.getArtifactName(), artifact.getArtifactURL(), artifact.getArtifactUUID(), - downloadResult.getDistributionMessageResult(), MsoLogger.ErrorCode.DataError.getValue(), + downloadResult.getDistributionMessageResult(), ErrorCode.DataError.getValue(), "ASDC artifact download fail"); this.sendASDCNotification (NotificationType.DOWNLOAD, @@ -369,7 +369,7 @@ public class ASDCController { logger.debug("Exception :", e); logger.error("{} {} {} {} {} {} {}", MessageEnum.ASDC_ARTIFACT_DOWNLOAD_FAIL.toString(), artifact.getArtifactName(), artifact.getArtifactURL(), artifact.getArtifactUUID(), - resultArtifact.getDistributionMessageResult(), MsoLogger.ErrorCode.DataError.getValue(), + resultArtifact.getDistributionMessageResult(), ErrorCode.DataError.getValue(), "ASDC write to file failed"); } @@ -519,7 +519,7 @@ public class ASDCController { } } catch (RuntimeException e) { logger.warn("{} {} {} {} {}", MessageEnum.ASDC_SEND_NOTIF_ASDC_EXEC.toString(), "ASDC", - "sendASDCNotification", MsoLogger.ErrorCode.SchemaError.getValue(), + "sendASDCNotification", ErrorCode.SchemaError.getValue(), "RuntimeException - sendASDCNotification", e); } } @@ -549,7 +549,7 @@ public class ASDCController { } catch (RuntimeException e) { logger.debug("Exception caught in sendFinalDistributionStatus {}", e.getMessage()); logger.warn("{} {} {} {} {}", MessageEnum.ASDC_SEND_NOTIF_ASDC_EXEC.toString(), "ASDC", "sendASDCNotification", - MsoLogger.ErrorCode.SchemaError.getValue(), "RuntimeException - sendASDCNotification", e); + ErrorCode.SchemaError.getValue(), "RuntimeException - sendASDCNotification", e); } } @@ -671,12 +671,12 @@ public class ASDCController { iNotif.getDistributionID()); logger.error("{} {} {} {} {} {}", MessageEnum.ASDC_GENERAL_EXCEPTION_ARG.toString(), "Database concurrency exception: ", "ASDC", "treatNotification", - MsoLogger.ErrorCode.BusinessProcesssError.getValue(), "RuntimeException in treatNotification", e); + ErrorCode.BusinessProcesssError.getValue(), "RuntimeException in treatNotification", e); } catch (Exception e) { logger.error("", MessageEnum.ASDC_GENERAL_EXCEPTION_ARG.toString(), "Unexpected exception caught during the notification processing", "ASDC", - "treatNotification", MsoLogger.ErrorCode.SchemaError.getValue(), "RuntimeException in treatNotification", + "treatNotification", ErrorCode.SchemaError.getValue(), "RuntimeException in treatNotification", e); try { @@ -785,7 +785,7 @@ public class ASDCController { } catch (ASDCDownloadException | UnsupportedEncodingException e) { logger.error("{} {} {} {} {} {}", MessageEnum.ASDC_GENERAL_EXCEPTION_ARG.toString(), "Exception caught during Installation of artifact", "ASDC", "processResourceNotification", - MsoLogger.ErrorCode.BusinessProcesssError.getValue(), "Exception in processResourceNotification", e); + ErrorCode.BusinessProcesssError.getValue(), "Exception in processResourceNotification", e); } } protected void processCsarServiceArtifacts (INotificationData iNotif, ToscaResourceStructure toscaResourceStructure) { @@ -814,7 +814,7 @@ public class ASDCController { } catch(Exception e){ logger.error("{} {} {} {} {} {}", MessageEnum.ASDC_GENERAL_EXCEPTION_ARG.toString(), "Exception caught during processCsarServiceArtifacts", "ASDC", "processCsarServiceArtifacts", - MsoLogger.ErrorCode.BusinessProcesssError.getValue(), "Exception in processCsarServiceArtifacts", e); + ErrorCode.BusinessProcesssError.getValue(), "Exception in processCsarServiceArtifacts", e); } } else if(artifact.getArtifactType().equals(ASDCConfiguration.WORKFLOWS)){ @@ -834,7 +834,7 @@ public class ASDCController { logger.info("Whats the error {}", e.getMessage()); logger.error("{} {} {} {} {} {}", MessageEnum.ASDC_GENERAL_EXCEPTION_ARG.toString(), "Exception caught during processCsarServiceArtifacts", "ASDC", "processCsarServiceArtifacts", - MsoLogger.ErrorCode.BusinessProcesssError.getValue(), "Exception in processCsarServiceArtifacts", + ErrorCode.BusinessProcesssError.getValue(), "Exception in processCsarServiceArtifacts", e); } } diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/client/test/rest/ASDCRestInterface.java b/asdc-controller/src/main/java/org/onap/so/asdc/client/test/rest/ASDCRestInterface.java index 329c139ec3..e9e5372d98 100644 --- a/asdc-controller/src/main/java/org/onap/so/asdc/client/test/rest/ASDCRestInterface.java +++ b/asdc-controller/src/main/java/org/onap/so/asdc/client/test/rest/ASDCRestInterface.java @@ -40,8 +40,8 @@ import org.onap.so.asdc.client.test.emulators.DistributionClientEmulator; import org.onap.so.asdc.client.test.emulators.NotificationDataImpl; import org.onap.so.asdc.client.test.emulators.JsonStatusData; import org.onap.so.asdc.installer.heat.ToscaResourceInstaller; +import org.onap.so.logger.ErrorCode; 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; @@ -111,7 +111,7 @@ public class ASDCRestInterface { logger.info("Error caught " + e.getMessage()); logger.error("{} {} {} {} {} {}", MessageEnum.ASDC_GENERAL_EXCEPTION.toString(), "Exception caught during ASDCRestInterface", "ASDC", "invokeASDCService", - MsoLogger.ErrorCode.BusinessProcesssError.getValue(), "Exception in invokeASDCService", e); + ErrorCode.BusinessProcesssError.getValue(), "Exception in invokeASDCService", e); } logger.info("ASDC Updates are complete"); logger.info("{} {} {} {}", MessageEnum.ASDC_ARTIFACT_DEPLOY_SUC.toString(), statusData.getDistributionID(), "ASDC", diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/installer/ToscaResourceStructure.java b/asdc-controller/src/main/java/org/onap/so/asdc/installer/ToscaResourceStructure.java index 700a5b16bb..6616bf4b54 100644 --- a/asdc-controller/src/main/java/org/onap/so/asdc/installer/ToscaResourceStructure.java +++ b/asdc-controller/src/main/java/org/onap/so/asdc/installer/ToscaResourceStructure.java @@ -50,8 +50,8 @@ import org.onap.so.db.catalog.beans.ToscaCsar; import org.onap.so.db.catalog.beans.VfModule; import org.onap.so.db.catalog.beans.VfModuleCustomization; import org.onap.so.db.catalog.beans.VnfResourceCustomization; +import org.onap.so.logger.ErrorCode; import org.onap.so.logger.MessageEnum; -import org.onap.so.logger.MsoLogger; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -140,7 +140,7 @@ public class ToscaResourceStructure { logger.info("System out {}", e.getMessage()); logger.error("{} {} {} {} {} {}", MessageEnum.ASDC_GENERAL_EXCEPTION_ARG.toString(), "Exception caught during parser *****LOOK********* " + artifact.getArtifactName(), "ASDC", - "processResourceNotification", MsoLogger.ErrorCode.BusinessProcesssError.getValue(), + "processResourceNotification", ErrorCode.BusinessProcesssError.getValue(), "Exception in " + "processResourceNotification", e); throw new ASDCDownloadException ("Exception caught when passing the csar file to the parser ", e); diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/installer/bpmn/BpmnInstaller.java b/asdc-controller/src/main/java/org/onap/so/asdc/installer/bpmn/BpmnInstaller.java index 7e3f5dfef6..8daa708ee7 100644 --- a/asdc-controller/src/main/java/org/onap/so/asdc/installer/bpmn/BpmnInstaller.java +++ b/asdc-controller/src/main/java/org/onap/so/asdc/installer/bpmn/BpmnInstaller.java @@ -45,8 +45,8 @@ import org.apache.http.entity.mime.MultipartEntityBuilder; import org.apache.http.entity.mime.content.ByteArrayBody; import org.apache.http.entity.mime.content.StringBody; import org.apache.http.impl.client.HttpClientBuilder; +import org.onap.so.logger.ErrorCode; 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; @@ -84,7 +84,7 @@ public class BpmnInstaller { logger.debug("Failed deploying BPMN {}", name); logger .error("{} {} {} {} {} {}", MessageEnum.ASDC_ARTIFACT_NOT_DEPLOYED_DETAIL.toString(), name, fileName, - Integer.toString(response.getStatusLine().getStatusCode()), MsoLogger.ErrorCode.DataError.getValue(), + Integer.toString(response.getStatusLine().getStatusCode()), ErrorCode.DataError.getValue(), "ASDC BPMN deploy failed"); } else { @@ -95,7 +95,7 @@ public class BpmnInstaller { logger.debug("Exception :", e); logger .error("{} {} {} {} {}", MessageEnum.ASDC_ARTIFACT_NOT_DEPLOYED_DETAIL.toString(), name, e.getMessage(), - MsoLogger.ErrorCode.DataError.getValue(), "ASDC BPMN deploy failed"); + ErrorCode.DataError.getValue(), "ASDC BPMN deploy failed"); } } entry = csarFile.getNextEntry(); @@ -104,7 +104,7 @@ public class BpmnInstaller { } catch (IOException ex) { logger.debug("Exception :", ex); logger.error("{} {} {} {} {}", MessageEnum.ASDC_ARTIFACT_NOT_DEPLOYED_DETAIL.toString(), csarFilePath, - ex.getMessage(), MsoLogger.ErrorCode.DataError.getValue(), "ASDC reading CSAR with workflows failed"); + ex.getMessage(), ErrorCode.DataError.getValue(), "ASDC reading CSAR with workflows failed"); } return; } @@ -123,7 +123,7 @@ public class BpmnInstaller { } catch (Exception e) { logger.debug("Exception :", e); logger.error("{} {} {} {} {}", MessageEnum.ASDC_ARTIFACT_CHECK_EXC.toString(), csarFilePath, e.getMessage(), - MsoLogger.ErrorCode.DataError.getValue(), "ASDC Unable to check CSAR entries"); + ErrorCode.DataError.getValue(), "ASDC Unable to check CSAR entries"); } return workflowsInCsar; } diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java b/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java index 6d9e2fbb0c..ef0b4921e4 100644 --- a/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java +++ b/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java @@ -124,8 +124,8 @@ import org.onap.so.db.request.beans.WatchdogServiceModVerIdLookup; import org.onap.so.db.request.data.repository.WatchdogComponentDistributionStatusRepository; import org.onap.so.db.request.data.repository.WatchdogDistributionStatusRepository; import org.onap.so.db.request.data.repository.WatchdogServiceModVerIdLookupRepository; +import org.onap.so.logger.ErrorCode; 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; @@ -267,7 +267,7 @@ public class ToscaResourceInstaller { return status; } catch (Exception e) { logger - .error("{} {} {}", MessageEnum.ASDC_ARTIFACT_CHECK_EXC.toString(), MsoLogger.ErrorCode.SchemaError.getValue(), + .error("{} {} {}", MessageEnum.ASDC_ARTIFACT_CHECK_EXC.toString(), ErrorCode.SchemaError.getValue(), "Exception - isResourceAlreadyDeployed"); throw new ArtifactInstallerException("Exception caught during checking existence of the VNF Resource.", e); } @@ -336,14 +336,14 @@ public class ToscaResourceInstaller { || dbExceptionToCapture instanceof LockAcquisitionException) { logger.warn("{} {} {} {} {}", MessageEnum.ASDC_ARTIFACT_ALREADY_DEPLOYED.toString(), vfResourceStructure.getResourceInstance().getResourceName(), - vfResourceStructure.getNotification().getServiceVersion(), MsoLogger.ErrorCode.DataError.getValue(), + vfResourceStructure.getNotification().getServiceVersion(), ErrorCode.DataError.getValue(), "Exception - ASCDC Artifact already deployed", e); } else { String elementToLog = (!artifactListForLogging.isEmpty() ? artifactListForLogging.get(artifactListForLogging.size() - 1).toString() : "No element listed"); logger.error("{} {} {} {}", MessageEnum.ASDC_ARTIFACT_INSTALL_EXC.toString(), elementToLog, - MsoLogger.ErrorCode.DataError.getValue(), + ErrorCode.DataError.getValue(), "Exception caught during installation of " + vfResourceStructure.getResourceInstance().getResourceName() + ". Transaction rollback", e); throw new ArtifactInstallerException("Exception caught during installation of " @@ -793,7 +793,7 @@ public class ToscaResourceInstaller { case ASDCConfiguration.OTHER: logger.warn("{} {} {} {}", MessageEnum.ASDC_ARTIFACT_TYPE_NOT_SUPPORT.toString(), vfModuleArtifact.getArtifactInfo().getArtifactType() + "(Artifact Name:" + vfModuleArtifact.getArtifactInfo() - .getArtifactName() + ")", MsoLogger.ErrorCode.DataError.getValue(), "Artifact type not supported"); + .getArtifactName() + ")", ErrorCode.DataError.getValue(), "Artifact type not supported"); break; default: break; |