From e8a1f614867b6863c8f097a168e51a05847bf887 Mon Sep 17 00:00:00 2001 From: Piotr Borelowski Date: Tue, 18 Jun 2019 11:28:18 +0200 Subject: Renamed the package name to 'enums' Removing the sonar issues in the package org.onap.sdc.common.onaplog.enums Issue-ID: SDC-2327 Signed-off-by: Piotr Borelowski Change-Id: I589751dbc8616bebf3a84d0f2bb4bb44d2a8893c --- .../org/onap/sdc/common/onaplog/Enums/LogLevel.java | 10 ---------- .../onap/sdc/common/onaplog/Enums/LogMarkers.java | 19 ------------------- .../common/onaplog/Enums/OnapLoggerErrorCode.java | 21 --------------------- .../org/onap/sdc/common/onaplog/Enums/Severity.java | 20 -------------------- .../onap/sdc/common/onaplog/Enums/StatusCode.java | 16 ---------------- .../onap/sdc/common/onaplog/OnapLoggerAudit.java | 8 ++++---- .../org/onap/sdc/common/onaplog/OnapLoggerBase.java | 2 +- .../onap/sdc/common/onaplog/OnapLoggerDebug.java | 4 ++-- .../onap/sdc/common/onaplog/OnapLoggerError.java | 6 +++--- .../onap/sdc/common/onaplog/OnapLoggerMetric.java | 4 ++-- .../org/onap/sdc/common/onaplog/OnapMDCWrapper.java | 2 +- .../org/onap/sdc/common/onaplog/enums/LogLevel.java | 10 ++++++++++ .../onap/sdc/common/onaplog/enums/LogMarkers.java | 19 +++++++++++++++++++ .../common/onaplog/enums/OnapLoggerErrorCode.java | 21 +++++++++++++++++++++ .../org/onap/sdc/common/onaplog/enums/Severity.java | 20 ++++++++++++++++++++ .../onap/sdc/common/onaplog/enums/StatusCode.java | 16 ++++++++++++++++ .../sdc/common/onaplog/interfaces/IOnapLogger.java | 2 +- .../common/onaplog/interfaces/IOnapMdcWrapper.java | 2 +- .../sdc/dcae/composition/util/SystemProperties.java | 3 +-- .../sdc/common/onaplog/OnapLoggerAuditTest.java | 6 +++--- .../sdc/common/onaplog/OnapLoggerDebugTest.java | 2 +- .../sdc/common/onaplog/OnapLoggerErrorTest.java | 4 ++-- .../onap/sdc/common/onaplog/OnapLoogerMetric.java | 4 ++-- 23 files changed, 110 insertions(+), 111 deletions(-) delete mode 100644 src/main/java/org/onap/sdc/common/onaplog/Enums/LogLevel.java delete mode 100644 src/main/java/org/onap/sdc/common/onaplog/Enums/LogMarkers.java delete mode 100644 src/main/java/org/onap/sdc/common/onaplog/Enums/OnapLoggerErrorCode.java delete mode 100644 src/main/java/org/onap/sdc/common/onaplog/Enums/Severity.java delete mode 100644 src/main/java/org/onap/sdc/common/onaplog/Enums/StatusCode.java create mode 100644 src/main/java/org/onap/sdc/common/onaplog/enums/LogLevel.java create mode 100644 src/main/java/org/onap/sdc/common/onaplog/enums/LogMarkers.java create mode 100644 src/main/java/org/onap/sdc/common/onaplog/enums/OnapLoggerErrorCode.java create mode 100644 src/main/java/org/onap/sdc/common/onaplog/enums/Severity.java create mode 100644 src/main/java/org/onap/sdc/common/onaplog/enums/StatusCode.java diff --git a/src/main/java/org/onap/sdc/common/onaplog/Enums/LogLevel.java b/src/main/java/org/onap/sdc/common/onaplog/Enums/LogLevel.java deleted file mode 100644 index 3e6df9d..0000000 --- a/src/main/java/org/onap/sdc/common/onaplog/Enums/LogLevel.java +++ /dev/null @@ -1,10 +0,0 @@ -package org.onap.sdc.common.onaplog.Enums; - -public enum LogLevel { - INFO, - WARN, - DEBUG, - ERROR, - FATAL -} - diff --git a/src/main/java/org/onap/sdc/common/onaplog/Enums/LogMarkers.java b/src/main/java/org/onap/sdc/common/onaplog/Enums/LogMarkers.java deleted file mode 100644 index f9f2f84..0000000 --- a/src/main/java/org/onap/sdc/common/onaplog/Enums/LogMarkers.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.onap.sdc.common.onaplog.Enums; - -public enum LogMarkers { - DEBUG_MARKER("DEBUG_MARKER"), - ERROR_MARKER("ERROR_MARKER"), - AUDIT_MARKER("AUDIT_MARKER"), - METRIC_MARKER("METRICS"); - - private String text; - - LogMarkers (String text){ - this.text = text; - } - - public String text(){ - return text; - } - -} diff --git a/src/main/java/org/onap/sdc/common/onaplog/Enums/OnapLoggerErrorCode.java b/src/main/java/org/onap/sdc/common/onaplog/Enums/OnapLoggerErrorCode.java deleted file mode 100644 index b1984c4..0000000 --- a/src/main/java/org/onap/sdc/common/onaplog/Enums/OnapLoggerErrorCode.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.onap.sdc.common.onaplog.Enums; - -public enum OnapLoggerErrorCode { - SUCCESS(0), - PERMISSION_ERROR(100), - AVAILABILITY_TIMEOUTS_ERROR(200), - DATA_ERROR(300), - SCHEMA_ERROR(400), - BUSINESS_PROCESS_ERROR(500), - UNKNOWN_ERROR(900); - - int errorCode; - - OnapLoggerErrorCode(int errorCode) { - this.errorCode = errorCode; - } - - public int getErrorCode() { - return errorCode; - } -} diff --git a/src/main/java/org/onap/sdc/common/onaplog/Enums/Severity.java b/src/main/java/org/onap/sdc/common/onaplog/Enums/Severity.java deleted file mode 100644 index 219cddc..0000000 --- a/src/main/java/org/onap/sdc/common/onaplog/Enums/Severity.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.onap.sdc.common.onaplog.Enums; - -public enum Severity { - OK(0), - WARNING(1), - CRITICAL(2), - DOWN(3), - UNREACHABLE(4); - - int severityType; - - Severity(int serveryType) { - this.severityType = serveryType; - } - - public int getSeverityType() { - return severityType; - } -} - diff --git a/src/main/java/org/onap/sdc/common/onaplog/Enums/StatusCode.java b/src/main/java/org/onap/sdc/common/onaplog/Enums/StatusCode.java deleted file mode 100644 index 05bbbb7..0000000 --- a/src/main/java/org/onap/sdc/common/onaplog/Enums/StatusCode.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.onap.sdc.common.onaplog.Enums; - -public enum StatusCode { - ERROR("ERROR"), - COMPLETE("COMPLETE"); - - private String text; - - StatusCode(String text) { - this.text = text; - } - - public String getText() { - return text; - } -} diff --git a/src/main/java/org/onap/sdc/common/onaplog/OnapLoggerAudit.java b/src/main/java/org/onap/sdc/common/onaplog/OnapLoggerAudit.java index fc89ad4..1057234 100644 --- a/src/main/java/org/onap/sdc/common/onaplog/OnapLoggerAudit.java +++ b/src/main/java/org/onap/sdc/common/onaplog/OnapLoggerAudit.java @@ -1,9 +1,9 @@ package org.onap.sdc.common.onaplog; -import org.onap.sdc.common.onaplog.Enums.LogMarkers; -import org.onap.sdc.common.onaplog.Enums.OnapLoggerErrorCode; -import org.onap.sdc.common.onaplog.Enums.Severity; -import org.onap.sdc.common.onaplog.Enums.StatusCode; +import org.onap.sdc.common.onaplog.enums.LogMarkers; +import org.onap.sdc.common.onaplog.enums.OnapLoggerErrorCode; +import org.onap.sdc.common.onaplog.enums.Severity; +import org.onap.sdc.common.onaplog.enums.StatusCode; import org.onap.sdc.common.onaplog.interfaces.IOnapMdcWrapper; import org.slf4j.LoggerFactory; import org.slf4j.MDC; diff --git a/src/main/java/org/onap/sdc/common/onaplog/OnapLoggerBase.java b/src/main/java/org/onap/sdc/common/onaplog/OnapLoggerBase.java index c1e879e..973b44c 100644 --- a/src/main/java/org/onap/sdc/common/onaplog/OnapLoggerBase.java +++ b/src/main/java/org/onap/sdc/common/onaplog/OnapLoggerBase.java @@ -20,7 +20,7 @@ package org.onap.sdc.common.onaplog; -import org.onap.sdc.common.onaplog.Enums.LogLevel; +import org.onap.sdc.common.onaplog.enums.LogLevel; import org.onap.sdc.common.onaplog.interfaces.IOnapLogger; import org.onap.sdc.common.onaplog.interfaces.IOnapMdcWrapper; import org.slf4j.Logger; diff --git a/src/main/java/org/onap/sdc/common/onaplog/OnapLoggerDebug.java b/src/main/java/org/onap/sdc/common/onaplog/OnapLoggerDebug.java index 1897aca..23ede18 100644 --- a/src/main/java/org/onap/sdc/common/onaplog/OnapLoggerDebug.java +++ b/src/main/java/org/onap/sdc/common/onaplog/OnapLoggerDebug.java @@ -1,7 +1,7 @@ package org.onap.sdc.common.onaplog; -import org.onap.sdc.common.onaplog.Enums.LogLevel; -import org.onap.sdc.common.onaplog.Enums.LogMarkers; +import org.onap.sdc.common.onaplog.enums.LogLevel; +import org.onap.sdc.common.onaplog.enums.LogMarkers; import org.onap.sdc.common.onaplog.interfaces.IOnapMdcWrapper; import org.slf4j.LoggerFactory; import org.slf4j.MarkerFactory; diff --git a/src/main/java/org/onap/sdc/common/onaplog/OnapLoggerError.java b/src/main/java/org/onap/sdc/common/onaplog/OnapLoggerError.java index 9734419..472b99b 100644 --- a/src/main/java/org/onap/sdc/common/onaplog/OnapLoggerError.java +++ b/src/main/java/org/onap/sdc/common/onaplog/OnapLoggerError.java @@ -1,8 +1,8 @@ package org.onap.sdc.common.onaplog; -import org.onap.sdc.common.onaplog.Enums.LogLevel; -import org.onap.sdc.common.onaplog.Enums.LogMarkers; -import org.onap.sdc.common.onaplog.Enums.OnapLoggerErrorCode; +import org.onap.sdc.common.onaplog.enums.LogLevel; +import org.onap.sdc.common.onaplog.enums.LogMarkers; +import org.onap.sdc.common.onaplog.enums.OnapLoggerErrorCode; import org.onap.sdc.common.onaplog.interfaces.IOnapMdcWrapper; import org.slf4j.LoggerFactory; import org.slf4j.MarkerFactory; diff --git a/src/main/java/org/onap/sdc/common/onaplog/OnapLoggerMetric.java b/src/main/java/org/onap/sdc/common/onaplog/OnapLoggerMetric.java index 5b9dd08..95c0ef4 100644 --- a/src/main/java/org/onap/sdc/common/onaplog/OnapLoggerMetric.java +++ b/src/main/java/org/onap/sdc/common/onaplog/OnapLoggerMetric.java @@ -1,7 +1,7 @@ package org.onap.sdc.common.onaplog; -import org.onap.sdc.common.onaplog.Enums.LogMarkers; -import org.onap.sdc.common.onaplog.Enums.Severity; +import org.onap.sdc.common.onaplog.enums.LogMarkers; +import org.onap.sdc.common.onaplog.enums.Severity; import org.onap.sdc.common.onaplog.interfaces.IOnapMdcWrapper; import org.slf4j.LoggerFactory; import org.slf4j.MarkerFactory; diff --git a/src/main/java/org/onap/sdc/common/onaplog/OnapMDCWrapper.java b/src/main/java/org/onap/sdc/common/onaplog/OnapMDCWrapper.java index 2249f14..9fbcabd 100644 --- a/src/main/java/org/onap/sdc/common/onaplog/OnapMDCWrapper.java +++ b/src/main/java/org/onap/sdc/common/onaplog/OnapMDCWrapper.java @@ -1,6 +1,6 @@ package org.onap.sdc.common.onaplog; -import org.onap.sdc.common.onaplog.Enums.Severity; +import org.onap.sdc.common.onaplog.enums.Severity; import org.onap.sdc.common.onaplog.interfaces.IOnapMdcWrapper; import org.onap.sdc.common.onaplog.interfaces.IStopWatch; import org.slf4j.Logger; diff --git a/src/main/java/org/onap/sdc/common/onaplog/enums/LogLevel.java b/src/main/java/org/onap/sdc/common/onaplog/enums/LogLevel.java new file mode 100644 index 0000000..609b5a3 --- /dev/null +++ b/src/main/java/org/onap/sdc/common/onaplog/enums/LogLevel.java @@ -0,0 +1,10 @@ +package org.onap.sdc.common.onaplog.enums; + +public enum LogLevel { + INFO, + WARN, + DEBUG, + ERROR, + FATAL +} + diff --git a/src/main/java/org/onap/sdc/common/onaplog/enums/LogMarkers.java b/src/main/java/org/onap/sdc/common/onaplog/enums/LogMarkers.java new file mode 100644 index 0000000..032066a --- /dev/null +++ b/src/main/java/org/onap/sdc/common/onaplog/enums/LogMarkers.java @@ -0,0 +1,19 @@ +package org.onap.sdc.common.onaplog.enums; + +public enum LogMarkers { + DEBUG_MARKER("DEBUG_MARKER"), + ERROR_MARKER("ERROR_MARKER"), + AUDIT_MARKER("AUDIT_MARKER"), + METRIC_MARKER("METRICS"); + + private String text; + + LogMarkers (String text){ + this.text = text; + } + + public String text(){ + return text; + } + +} diff --git a/src/main/java/org/onap/sdc/common/onaplog/enums/OnapLoggerErrorCode.java b/src/main/java/org/onap/sdc/common/onaplog/enums/OnapLoggerErrorCode.java new file mode 100644 index 0000000..219a929 --- /dev/null +++ b/src/main/java/org/onap/sdc/common/onaplog/enums/OnapLoggerErrorCode.java @@ -0,0 +1,21 @@ +package org.onap.sdc.common.onaplog.enums; + +public enum OnapLoggerErrorCode { + SUCCESS(0), + PERMISSION_ERROR(100), + AVAILABILITY_TIMEOUTS_ERROR(200), + DATA_ERROR(300), + SCHEMA_ERROR(400), + BUSINESS_PROCESS_ERROR(500), + UNKNOWN_ERROR(900); + + int errorCode; + + OnapLoggerErrorCode(int errorCode) { + this.errorCode = errorCode; + } + + public int getErrorCode() { + return errorCode; + } +} diff --git a/src/main/java/org/onap/sdc/common/onaplog/enums/Severity.java b/src/main/java/org/onap/sdc/common/onaplog/enums/Severity.java new file mode 100644 index 0000000..580e263 --- /dev/null +++ b/src/main/java/org/onap/sdc/common/onaplog/enums/Severity.java @@ -0,0 +1,20 @@ +package org.onap.sdc.common.onaplog.enums; + +public enum Severity { + OK(0), + WARNING(1), + CRITICAL(2), + DOWN(3), + UNREACHABLE(4); + + int severityType; + + Severity(int serveryType) { + this.severityType = serveryType; + } + + public int getSeverityType() { + return severityType; + } +} + diff --git a/src/main/java/org/onap/sdc/common/onaplog/enums/StatusCode.java b/src/main/java/org/onap/sdc/common/onaplog/enums/StatusCode.java new file mode 100644 index 0000000..bc8f33a --- /dev/null +++ b/src/main/java/org/onap/sdc/common/onaplog/enums/StatusCode.java @@ -0,0 +1,16 @@ +package org.onap.sdc.common.onaplog.enums; + +public enum StatusCode { + ERROR("ERROR"), + COMPLETE("COMPLETE"); + + private String text; + + StatusCode(String text) { + this.text = text; + } + + public String getText() { + return text; + } +} diff --git a/src/main/java/org/onap/sdc/common/onaplog/interfaces/IOnapLogger.java b/src/main/java/org/onap/sdc/common/onaplog/interfaces/IOnapLogger.java index 61e94a4..4891a73 100644 --- a/src/main/java/org/onap/sdc/common/onaplog/interfaces/IOnapLogger.java +++ b/src/main/java/org/onap/sdc/common/onaplog/interfaces/IOnapLogger.java @@ -1,6 +1,6 @@ package org.onap.sdc.common.onaplog.interfaces; -import org.onap.sdc.common.onaplog.Enums.LogLevel; +import org.onap.sdc.common.onaplog.enums.LogLevel; /** * Created by dd4296 on 12/24/2017. diff --git a/src/main/java/org/onap/sdc/common/onaplog/interfaces/IOnapMdcWrapper.java b/src/main/java/org/onap/sdc/common/onaplog/interfaces/IOnapMdcWrapper.java index ae94655..661761c 100644 --- a/src/main/java/org/onap/sdc/common/onaplog/interfaces/IOnapMdcWrapper.java +++ b/src/main/java/org/onap/sdc/common/onaplog/interfaces/IOnapMdcWrapper.java @@ -1,7 +1,7 @@ package org.onap.sdc.common.onaplog.interfaces; import org.onap.sdc.common.onaplog.OnapMDCWrapper; -import org.onap.sdc.common.onaplog.Enums.Severity; +import org.onap.sdc.common.onaplog.enums.Severity; /** * Created by dd4296 on 12/25/2017. diff --git a/src/main/java/org/onap/sdc/dcae/composition/util/SystemProperties.java b/src/main/java/org/onap/sdc/dcae/composition/util/SystemProperties.java index 585fe87..4014639 100644 --- a/src/main/java/org/onap/sdc/dcae/composition/util/SystemProperties.java +++ b/src/main/java/org/onap/sdc/dcae/composition/util/SystemProperties.java @@ -3,8 +3,7 @@ package org.onap.sdc.dcae.composition.util; import java.util.Properties; import org.onap.sdc.common.onaplog.OnapLoggerDebug; -import org.onap.sdc.common.onaplog.OnapLoggerError; -import org.onap.sdc.common.onaplog.Enums.LogLevel; +import org.onap.sdc.common.onaplog.enums.LogLevel; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.PropertySource; diff --git a/src/test/java/org/onap/sdc/common/onaplog/OnapLoggerAuditTest.java b/src/test/java/org/onap/sdc/common/onaplog/OnapLoggerAuditTest.java index 8fe3b72..676ab4e 100644 --- a/src/test/java/org/onap/sdc/common/onaplog/OnapLoggerAuditTest.java +++ b/src/test/java/org/onap/sdc/common/onaplog/OnapLoggerAuditTest.java @@ -39,9 +39,9 @@ import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; -import org.onap.sdc.common.onaplog.Enums.LogLevel; -import org.onap.sdc.common.onaplog.Enums.OnapLoggerErrorCode; -import org.onap.sdc.common.onaplog.Enums.Severity; +import org.onap.sdc.common.onaplog.enums.LogLevel; +import org.onap.sdc.common.onaplog.enums.OnapLoggerErrorCode; +import org.onap.sdc.common.onaplog.enums.Severity; import org.slf4j.MDC; import uk.org.lidalia.slf4jtest.LoggingEvent; diff --git a/src/test/java/org/onap/sdc/common/onaplog/OnapLoggerDebugTest.java b/src/test/java/org/onap/sdc/common/onaplog/OnapLoggerDebugTest.java index 5e81739..8d1f3f8 100644 --- a/src/test/java/org/onap/sdc/common/onaplog/OnapLoggerDebugTest.java +++ b/src/test/java/org/onap/sdc/common/onaplog/OnapLoggerDebugTest.java @@ -28,7 +28,7 @@ import com.google.common.collect.ImmutableList; import org.junit.Test; -import org.onap.sdc.common.onaplog.Enums.LogLevel; +import org.onap.sdc.common.onaplog.enums.LogLevel; import org.slf4j.MDC; import uk.org.lidalia.slf4jtest.LoggingEvent; diff --git a/src/test/java/org/onap/sdc/common/onaplog/OnapLoggerErrorTest.java b/src/test/java/org/onap/sdc/common/onaplog/OnapLoggerErrorTest.java index 3d61abd..5c8fbf6 100644 --- a/src/test/java/org/onap/sdc/common/onaplog/OnapLoggerErrorTest.java +++ b/src/test/java/org/onap/sdc/common/onaplog/OnapLoggerErrorTest.java @@ -29,8 +29,8 @@ import com.google.common.collect.ImmutableMap; import org.junit.Test; -import org.onap.sdc.common.onaplog.Enums.LogLevel; -import org.onap.sdc.common.onaplog.Enums.OnapLoggerErrorCode; +import org.onap.sdc.common.onaplog.enums.LogLevel; +import org.onap.sdc.common.onaplog.enums.OnapLoggerErrorCode; import org.slf4j.MDC; import uk.org.lidalia.slf4jtest.LoggingEvent; diff --git a/src/test/java/org/onap/sdc/common/onaplog/OnapLoogerMetric.java b/src/test/java/org/onap/sdc/common/onaplog/OnapLoogerMetric.java index eb49780..fd4435b 100644 --- a/src/test/java/org/onap/sdc/common/onaplog/OnapLoogerMetric.java +++ b/src/test/java/org/onap/sdc/common/onaplog/OnapLoogerMetric.java @@ -33,8 +33,8 @@ import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; -import org.onap.sdc.common.onaplog.Enums.LogLevel; -import org.onap.sdc.common.onaplog.Enums.Severity; +import org.onap.sdc.common.onaplog.enums.LogLevel; +import org.onap.sdc.common.onaplog.enums.Severity; import org.slf4j.MDC; import uk.org.lidalia.slf4jtest.LoggingEvent; -- cgit 1.2.3-korg