summaryrefslogtreecommitdiffstats
path: root/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/noop
diff options
context:
space:
mode:
Diffstat (limited to 'eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/noop')
-rw-r--r--eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/noop/NoOpAuditLog.java90
-rw-r--r--eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/noop/NoOpDebugLog.java56
-rw-r--r--eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/noop/NoOpEELFLogger.java77
-rw-r--r--eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/noop/NoOpErrorLog.java68
-rw-r--r--eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/noop/NoOpMetricLog.java89
-rw-r--r--eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/noop/package-info.java26
6 files changed, 406 insertions, 0 deletions
diff --git a/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/noop/NoOpAuditLog.java b/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/noop/NoOpAuditLog.java
new file mode 100644
index 0000000..6c1c583
--- /dev/null
+++ b/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/noop/NoOpAuditLog.java
@@ -0,0 +1,90 @@
+/*
+ * ================================================================================
+ * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ *
+ */
+
+package org.onap.dcae.utils.eelf.logger.api.noop;
+
+
+import org.onap.dcae.utils.eelf.logger.api.info.LogLevelCategory;
+import org.onap.dcae.utils.eelf.logger.api.log.AuditLog;
+import org.onap.dcae.utils.eelf.logger.api.spec.AuditLogSpec;
+import org.onap.dcae.utils.eelf.logger.api.spec.OptionalLogSpec;
+
+/**
+ * A no operation implementation of AuditLog
+ *
+ * @author Rajiv Singla
+ */
+public class NoOpAuditLog implements AuditLog {
+
+ @Override
+ public void log(final LogLevelCategory logLevelCategory, final String message, final AuditLogSpec auditLogSpec,
+ final OptionalLogSpec optionalLogSpec, final String... args) {
+ // no operation
+ }
+
+ @Override
+ public void log(final LogLevelCategory logLevelCategory, final String message, final AuditLogSpec auditLogSpec,
+ final String... args) {
+ // no operation
+ }
+
+ @Override
+ public void info(final String message, final AuditLogSpec auditLogSpec, final OptionalLogSpec optionalLogSpec,
+ final String... args) {
+ // no operation
+ }
+
+ @Override
+ public void info(final String message, final AuditLogSpec auditLogSpec, final String... args) {
+ // no operation
+ }
+
+ @Override
+ public void warn(final String message, final AuditLogSpec auditLogSpec, final OptionalLogSpec optionalLogSpec,
+ final String... args) {
+ // no operation
+ }
+
+ @Override
+ public void warn(final String message, final AuditLogSpec auditLogSpec, final String... args) {
+ // no operation
+ }
+
+ @Override
+ public void error(final String message, final AuditLogSpec auditLogSpec, final OptionalLogSpec optionalLogSpec,
+ final String... args) {
+ // no operation
+ }
+
+ @Override
+ public void error(final String message, final AuditLogSpec auditLogSpec, final String... args) {
+ // no operation
+ }
+
+ @Override
+ public void fatal(final String message, final AuditLogSpec auditLogSpec, final OptionalLogSpec optionalLogSpec,
+ final String... args) {
+ // no operation
+ }
+
+ @Override
+ public void fatal(final String message, final AuditLogSpec auditLogSpec, final String... args) {
+ // no operation
+ }
+}
diff --git a/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/noop/NoOpDebugLog.java b/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/noop/NoOpDebugLog.java
new file mode 100644
index 0000000..dd36b52
--- /dev/null
+++ b/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/noop/NoOpDebugLog.java
@@ -0,0 +1,56 @@
+/*
+ * ================================================================================
+ * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ *
+ */
+
+package org.onap.dcae.utils.eelf.logger.api.noop;
+
+
+import org.onap.dcae.utils.eelf.logger.api.info.LogLevelCategory;
+import org.onap.dcae.utils.eelf.logger.api.log.DebugLog;
+import org.onap.dcae.utils.eelf.logger.api.spec.DebugLogSpec;
+import org.onap.dcae.utils.eelf.logger.api.spec.OptionalLogSpec;
+
+/**
+ * A no operation implementation of Debug Log
+ *
+ * @author Rajiv Singla
+ */
+public class NoOpDebugLog implements DebugLog {
+ @Override
+ public void log(final LogLevelCategory logLevelCategory, final String message, final DebugLogSpec debugLogSpec,
+ final OptionalLogSpec optionalLogSpec, final String... args) {
+ // no operation
+ }
+
+ @Override
+ public void log(final LogLevelCategory logLevelCategory, final String message, final DebugLogSpec debugLogSpec,
+ final String... args) {
+ // no operation
+ }
+
+ @Override
+ public void debug(final String message, final DebugLogSpec debugLogSpec, final OptionalLogSpec optionalLogSpec,
+ final String... args) {
+ // no operation
+ }
+
+ @Override
+ public void debug(final String message, final DebugLogSpec debugLogSpec, final String... args) {
+ // no operation
+ }
+}
diff --git a/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/noop/NoOpEELFLogger.java b/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/noop/NoOpEELFLogger.java
new file mode 100644
index 0000000..c761ba1
--- /dev/null
+++ b/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/noop/NoOpEELFLogger.java
@@ -0,0 +1,77 @@
+/*
+ * ================================================================================
+ * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ *
+ */
+
+package org.onap.dcae.utils.eelf.logger.api.noop;
+
+
+import org.onap.dcae.utils.eelf.logger.api.log.AuditLog;
+import org.onap.dcae.utils.eelf.logger.api.log.DebugLog;
+import org.onap.dcae.utils.eelf.logger.api.log.EELFLogger;
+import org.onap.dcae.utils.eelf.logger.api.log.EELFLoggerContext;
+import org.onap.dcae.utils.eelf.logger.api.log.ErrorLog;
+import org.onap.dcae.utils.eelf.logger.api.log.MetricLog;
+
+/**
+ * A no operation implementation of {@link EELFLogger}
+ *
+ * @author Rajiv Singla
+ */
+public class NoOpEELFLogger implements EELFLogger {
+
+ private static final AuditLog NO_OP_AUDIT_LOG = new NoOpAuditLog();
+ private static final MetricLog NO_OP_METRIC_LOG = new NoOpMetricLog();
+ private static final ErrorLog NO_OP_ERROR_LOG = new NoOpErrorLog();
+ private static final DebugLog NO_OP_DEBUG_LOG = new NoOpDebugLog();
+
+ private static final NoOpEELFLogger NO_OP_EELF_LOGGER = new NoOpEELFLogger();
+
+ private NoOpEELFLogger() {
+ // private constructor
+ }
+
+ public static NoOpEELFLogger getInstance() {
+ return NO_OP_EELF_LOGGER;
+ }
+
+ @Override
+ public AuditLog auditLog() {
+ return NO_OP_AUDIT_LOG;
+ }
+
+ @Override
+ public MetricLog metricLog() {
+ return NO_OP_METRIC_LOG;
+ }
+
+ @Override
+ public ErrorLog errorLog() {
+ return NO_OP_ERROR_LOG;
+ }
+
+ @Override
+ public DebugLog debugLog() {
+ return NO_OP_DEBUG_LOG;
+ }
+
+ @Override
+ public EELFLoggerContext loggingContext() {
+ return null;
+ }
+
+}
diff --git a/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/noop/NoOpErrorLog.java b/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/noop/NoOpErrorLog.java
new file mode 100644
index 0000000..c1b4e13
--- /dev/null
+++ b/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/noop/NoOpErrorLog.java
@@ -0,0 +1,68 @@
+/*
+ * ================================================================================
+ * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ *
+ */
+
+package org.onap.dcae.utils.eelf.logger.api.noop;
+
+
+import org.onap.dcae.utils.eelf.logger.api.info.LogLevelCategory;
+import org.onap.dcae.utils.eelf.logger.api.log.ErrorLog;
+import org.onap.dcae.utils.eelf.logger.api.spec.ErrorLogSpec;
+import org.onap.dcae.utils.eelf.logger.api.spec.OptionalLogSpec;
+
+/**
+ * A no operation implementation of Error Log
+ *
+ * @author Rajiv Singla
+ */
+public class NoOpErrorLog implements ErrorLog {
+
+ @Override
+ public void log(final LogLevelCategory logLevelCategory, final String message, final ErrorLogSpec errorLogSpec,
+ final OptionalLogSpec optionalLogSpec, final String... args) {
+ // no operation
+ }
+
+ @Override
+ public void log(final LogLevelCategory logLevelCategory, final String message, final ErrorLogSpec errorLogSpec,
+ final String... args) {
+ // no operation
+ }
+
+ @Override
+ public void error(final String message, final ErrorLogSpec errorLogSpec, final OptionalLogSpec optionalLogSpec,
+ final String... args) {
+ // no operation
+ }
+
+ @Override
+ public void error(final String message, final ErrorLogSpec errorLogSpec, final String... args) {
+ // no operation
+ }
+
+ @Override
+ public void warn(final String message, final ErrorLogSpec errorLogSpec, final OptionalLogSpec optionalLogSpec,
+ final String... args) {
+ // no operation
+ }
+
+ @Override
+ public void warn(final String message, final ErrorLogSpec errorLogSpec, final String... args) {
+ // no operation
+ }
+}
diff --git a/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/noop/NoOpMetricLog.java b/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/noop/NoOpMetricLog.java
new file mode 100644
index 0000000..1c67862
--- /dev/null
+++ b/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/noop/NoOpMetricLog.java
@@ -0,0 +1,89 @@
+/*
+ * ================================================================================
+ * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ *
+ */
+
+package org.onap.dcae.utils.eelf.logger.api.noop;
+
+
+import org.onap.dcae.utils.eelf.logger.api.info.LogLevelCategory;
+import org.onap.dcae.utils.eelf.logger.api.log.MetricLog;
+import org.onap.dcae.utils.eelf.logger.api.spec.MetricLogSpec;
+import org.onap.dcae.utils.eelf.logger.api.spec.OptionalLogSpec;
+
+/**
+ * A no operation implementation of Metric Log
+ *
+ * @author Rajiv Singla
+ */
+public class NoOpMetricLog implements MetricLog {
+ @Override
+ public void log(final LogLevelCategory logLevelCategory, final String message, final MetricLogSpec metricLogSpec,
+ final OptionalLogSpec optionalLogSpec, final String... args) {
+ // no operation
+ }
+
+ @Override
+ public void log(final LogLevelCategory logLevelCategory, final String message, final MetricLogSpec metricLogSpec,
+ final String... args) {
+ // no operation
+ }
+
+ @Override
+ public void info(final String message, final MetricLogSpec metricLogSpec, final OptionalLogSpec optionalLogSpec,
+ final String... args) {
+ // no operation
+ }
+
+ @Override
+ public void info(final String message, final MetricLogSpec metricLogSpec, final String... args) {
+ // no operation
+ }
+
+ @Override
+ public void warn(final String message, final MetricLogSpec metricLogSpec, final OptionalLogSpec optionalLogSpec,
+ final String... args) {
+ // no operation
+ }
+
+ @Override
+ public void warn(final String message, final MetricLogSpec metricLogSpec, final String... args) {
+ // no operation
+ }
+
+ @Override
+ public void error(final String message, final MetricLogSpec metricLogSpec, final OptionalLogSpec optionalLogSpec,
+ final String... args) {
+ // no operation
+ }
+
+ @Override
+ public void error(final String message, final MetricLogSpec metricLogSpec, final String... args) {
+ // no operation
+ }
+
+ @Override
+ public void fatal(final String message, final MetricLogSpec metricLogSpec, final OptionalLogSpec optionalLogSpec,
+ final String... args) {
+ // no operation
+ }
+
+ @Override
+ public void fatal(final String message, final MetricLogSpec metricLogSpec, final String... args) {
+ // no operation
+ }
+}
diff --git a/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/noop/package-info.java b/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/noop/package-info.java
new file mode 100644
index 0000000..f7ed917
--- /dev/null
+++ b/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/noop/package-info.java
@@ -0,0 +1,26 @@
+/*
+ * ================================================================================
+ * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ *
+ */
+
+/**
+ * Contains no operation implementation of EELF Logging API. Generally used as a fallback when no EELF Logging
+ * implementation is detected in the application classpath
+ *
+ * @author Rajiv Singla
+ */
+package org.onap.dcae.utils.eelf.logger.api.noop;