From 28f6c6b526dc6c384c56f53290a5d4390ac5ca99 Mon Sep 17 00:00:00 2001 From: Krzysztof Opasiak Date: Mon, 28 Jan 2019 21:07:52 +0100 Subject: Use helper class to retrieve network logger Instead of abusing constant from Topic interface use new dedicated helper class to retrive network logger. Issue-ID: POLICY-1486 Change-Id: Ia715aafb578aeb2842566de2623e8d22e42652fc Signed-off-by: Krzysztof Opasiak --- policy-endpoints/pom.xml | 8 ++++---- .../common/endpoints/event/comm/bus/NoopTopicEndpoint.java | 8 +++++--- .../event/comm/bus/internal/InlineBusTopicSink.java | 11 ++++++----- .../comm/bus/internal/SingleThreadedBusTopicSource.java | 13 +++++++------ 4 files changed, 22 insertions(+), 18 deletions(-) (limited to 'policy-endpoints') diff --git a/policy-endpoints/pom.xml b/policy-endpoints/pom.xml index 4a7f91fe..41fa2f30 100644 --- a/policy-endpoints/pom.xml +++ b/policy-endpoints/pom.xml @@ -133,13 +133,13 @@ jersey-client ${jersey.version} - + org.glassfish.jersey.core jersey-common ${jersey.version} - + com.google.code.gson gson @@ -193,13 +193,13 @@ junit test - + org.powermock powermock-api-mockito test - + org.assertj assertj-core diff --git a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/NoopTopicEndpoint.java b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/NoopTopicEndpoint.java index 091e46bf..a2ad4d3d 100644 --- a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/NoopTopicEndpoint.java +++ b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/NoopTopicEndpoint.java @@ -3,13 +3,14 @@ * ONAP * ================================================================================ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2019 Samsung Electronics Co., Ltd. * ================================================================================ * 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. @@ -22,6 +23,7 @@ package org.onap.policy.common.endpoints.event.comm.bus; import java.util.List; import org.onap.policy.common.endpoints.event.comm.bus.internal.TopicBase; +import org.onap.policy.common.utils.slf4j.LoggerFactoryWrapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -38,7 +40,7 @@ public abstract class NoopTopicEndpoint extends TopicBase { /** * Network logger. */ - private static final Logger netLogger = LoggerFactory.getLogger(NETWORK_LOGGER); + private static final Logger netLogger = LoggerFactoryWrapper.getNetworkLogger(); /** * {@inheritDoc}. diff --git a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/InlineBusTopicSink.java b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/InlineBusTopicSink.java index c8d6bd5a..93896898 100644 --- a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/InlineBusTopicSink.java +++ b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/InlineBusTopicSink.java @@ -3,14 +3,14 @@ * policy-endpoints * ================================================================================ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. - * Modifications Copyright (C) 2018 Samsung Electronics Co., Ltd. - * ================================================================================ + * Modifications Copyright (C) 2018-2019 Samsung Electronics Co., Ltd. +* ================================================================================ * 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. @@ -24,6 +24,7 @@ package org.onap.policy.common.endpoints.event.comm.bus.internal; import java.util.UUID; import org.onap.policy.common.endpoints.event.comm.bus.BusTopicSink; +import org.onap.policy.common.utils.slf4j.LoggerFactoryWrapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -38,7 +39,7 @@ public abstract class InlineBusTopicSink extends BusTopicBase implements BusTopi * Loggers. */ private static Logger logger = LoggerFactory.getLogger(InlineBusTopicSink.class); - private static final Logger netLogger = LoggerFactory.getLogger(NETWORK_LOGGER); + private static final Logger netLogger = LoggerFactoryWrapper.getNetworkLogger(); /** * The partition key to publish to. diff --git a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/SingleThreadedBusTopicSource.java b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/SingleThreadedBusTopicSource.java index b588d1f3..4cc8fbb1 100644 --- a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/SingleThreadedBusTopicSource.java +++ b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/SingleThreadedBusTopicSource.java @@ -3,14 +3,14 @@ * policy-endpoints * ================================================================================ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. - * Modifications Copyright (C) 2018 Samsung Electronics Co., Ltd. + * Modifications Copyright (C) 2018-2019 Samsung Electronics Co., Ltd. * ================================================================================ * 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. @@ -29,6 +29,7 @@ import org.onap.policy.common.endpoints.event.comm.TopicListener; import org.onap.policy.common.endpoints.event.comm.bus.BusTopicSource; import org.onap.policy.common.endpoints.event.comm.bus.internal.BusConsumer.FilterableBusConsumer; import org.onap.policy.common.utils.network.NetworkUtil; +import org.onap.policy.common.utils.slf4j.LoggerFactoryWrapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -44,7 +45,7 @@ public abstract class SingleThreadedBusTopicSource extends BusTopicBase * that in a single file in a concise format. */ private static Logger logger = LoggerFactory.getLogger(InlineBusTopicSink.class); - private static final Logger netLogger = LoggerFactory.getLogger(NETWORK_LOGGER); + private static final Logger netLogger = LoggerFactoryWrapper.getNetworkLogger(); /** * Bus consumer group. @@ -81,7 +82,7 @@ public abstract class SingleThreadedBusTopicSource extends BusTopicBase * Constructor. * * @param busTopicParams topic parameters - * + * * @throws IllegalArgumentException An invalid parameter passed in */ public SingleThreadedBusTopicSource(BusTopicParams busTopicParams) { @@ -183,7 +184,7 @@ public abstract class SingleThreadedBusTopicSource extends BusTopicBase /** * Makes a new thread to be used for polling. - * + * * @return a new Thread */ protected Thread makePollerThread() { -- cgit 1.2.3-korg