diff options
author | a.sreekumar <ajith.sreekumar@bell.ca> | 2020-12-04 11:04:10 +0000 |
---|---|---|
committer | a.sreekumar <ajith.sreekumar@bell.ca> | 2020-12-04 11:22:21 +0000 |
commit | dd2aef555893e48ca8fcdc0cfb0a54538e49cfad (patch) | |
tree | fc994378a4db65415daaea16679575d8b07c93a1 | |
parent | 371821c3191999dfc90f77569b184172e598f431 (diff) |
Fixing sonar issues in policy-common
Change-Id: I4dce0dbdf71d01fbb59e9bf861d1af1ab49e5ae7
Issue-ID: POLICY-2914
Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
13 files changed, 167 insertions, 153 deletions
diff --git a/common-parameters/src/main/java/org/onap/policy/common/parameters/CommonGroupValidationResult.java b/common-parameters/src/main/java/org/onap/policy/common/parameters/CommonGroupValidationResult.java index f35d1970..ba31698a 100644 --- a/common-parameters/src/main/java/org/onap/policy/common/parameters/CommonGroupValidationResult.java +++ b/common-parameters/src/main/java/org/onap/policy/common/parameters/CommonGroupValidationResult.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2020 Bell Canada. 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. @@ -52,7 +53,7 @@ public abstract class CommonGroupValidationResult implements ValidationResult { * * @param messagePrefix status message prefix */ - public CommonGroupValidationResult(String messagePrefix) { + protected CommonGroupValidationResult(String messagePrefix) { this.messagePrefix = messagePrefix; this.message = messagePrefix + status.toString(); } diff --git a/common-parameters/src/main/java/org/onap/policy/common/parameters/ValidationResultImpl.java b/common-parameters/src/main/java/org/onap/policy/common/parameters/ValidationResultImpl.java index 1d8aa239..0fda51ad 100644 --- a/common-parameters/src/main/java/org/onap/policy/common/parameters/ValidationResultImpl.java +++ b/common-parameters/src/main/java/org/onap/policy/common/parameters/ValidationResultImpl.java @@ -1,6 +1,7 @@ /* * ============LICENSE_START======================================================= * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2020 Bell Canada. 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. @@ -56,7 +57,7 @@ public abstract class ValidationResultImpl implements ValidationResult { * @param name name of the object of this result * @param object object being validated */ - public ValidationResultImpl(String name, Object object) { + protected ValidationResultImpl(String name, Object object) { this.name = name; this.object = object; } @@ -69,7 +70,7 @@ public abstract class ValidationResultImpl implements ValidationResult { * @param status the validation status * @param message the validation message explaining the validation status */ - public ValidationResultImpl(String name, Object object, ValidationStatus status, String message) { + protected ValidationResultImpl(String name, Object object, ValidationStatus status, String message) { this.name = name; this.object = object; this.status = status; diff --git a/integrity-monitor/src/test/java/org/onap/policy/common/im/StateManagementTest.java b/integrity-monitor/src/test/java/org/onap/policy/common/im/StateManagementTest.java index 12671ec3..fb1df8c7 100644 --- a/integrity-monitor/src/test/java/org/onap/policy/common/im/StateManagementTest.java +++ b/integrity-monitor/src/test/java/org/onap/policy/common/im/StateManagementTest.java @@ -3,6 +3,7 @@ * Integrity Monitor * ================================================================================ * Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2020 Bell Canada. 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. @@ -83,141 +84,12 @@ public class StateManagementTest extends IntegrityMonitorTestBase { @Test public void test() throws Exception { logger.info("\n\nlogger.infor StateManagementTest: Entering\n\n"); - String resourceName = TEST_RESOURCE_NAME; // These parameters are in a properties file try { - final StateManagement sm = new StateManagement(emf, resourceName); - - logger.info("\n??? initial state"); - assertEquals(UNLOCKED_ENABLED_NULL_NULL, makeString(sm)); - - logger.info("\n??? test lock()"); - sm.lock(); - assertEquals("locked,enabled,null,null", makeString(sm)); - - logger.info("\n??? test unlock()"); - sm.unlock(); - assertEquals(UNLOCKED_ENABLED_NULL_NULL, makeString(sm)); - - logger.info("\n??? test enableNotFailed()"); - sm.enableNotFailed(); - assertEquals(UNLOCKED_ENABLED_NULL_NULL, makeString(sm)); - - logger.info("\n??? test disableFailed()"); - sm.disableFailed(); - assertEquals("unlocked,disabled,failed,null", makeString(sm)); - - // P4 If promote() is called while either the opState is disabled or - // the adminState is locked, - // the standbystatus shall transition to coldstandby and a - // StandbyStatusException shall be thrown - logger.info("\n??? promote() test case P4"); - sm.disableFailed(); - sm.lock(); - assertThatThrownBy(sm::promote).isInstanceOf(IntegrityMonitorException.class); - - assertEquals(LOCKED_DISABLED_FAILED_COLDSTANDBY, makeString(sm)); - - // P3 If promote() is called while standbyStatus is coldstandby, the - // state shall not transition - // and a StandbyStatusException shall be thrown - logger.info("\n??? promote() test case P3"); - assertThatThrownBy(sm::promote).isInstanceOf(IntegrityMonitorException.class); - assertEquals(LOCKED_DISABLED_FAILED_COLDSTANDBY, makeString(sm)); - - // P2 If promote() is called while the standbyStatus is null and the - // opState is enabled and adminState is unlocked, - // the state shall transition to providingservice - logger.info("\n??? promote() test case P2"); - resourceName = "test_resource2"; - final StateManagement sm2 = new StateManagement(emf, resourceName); - sm2.enableNotFailed(); - sm2.unlock(); - assertEquals(UNLOCKED_ENABLED_NULL_NULL, makeString(sm2)); - sm2.promote(); - assertEquals(UNLOCKED_ENABLED_NULL_PROVIDINGSERVICE, makeString(sm2)); - - // P5 If promote() is called while standbyStatus is - // providingservice, no action is taken - logger.info("\n??? promote() test case P5"); - sm2.promote(); - assertEquals(UNLOCKED_ENABLED_NULL_PROVIDINGSERVICE, makeString(sm2)); - - // D1 If demote() is called while standbyStatus is providingservice, - // the state shall transition to hotstandby - logger.info("\n??? demote() test case D1"); - sm2.demote(); - assertEquals(UNLOCKED_ENABLED_NULL_HOTSTANDBY, makeString(sm2)); - - // D4 If demote() is called while standbyStatus is hotstandby, no - // action is taken - logger.info("\n??? demote() test case D4"); - sm2.demote(); - assertEquals(UNLOCKED_ENABLED_NULL_HOTSTANDBY, makeString(sm2)); - - // D3 If demote() is called while standbyStatus is null and - // adminState is locked or opState is disabled, - // the state shall transition to coldstandby - logger.info("\n??? demote() test case D3"); - resourceName = "test_resource3"; - final StateManagement sm3 = new StateManagement(emf, resourceName); - sm3.lock(); - sm3.disableFailed(); - sm3.demote(); - assertEquals(LOCKED_DISABLED_FAILED_COLDSTANDBY, makeString(sm3)); - - // D5 If demote() is called while standbyStatus is coldstandby, no - // action is taken - logger.info("\n??? demote() test case D5"); - sm3.demote(); - assertEquals(LOCKED_DISABLED_FAILED_COLDSTANDBY, makeString(sm3)); - - // D2 If demote() is called while standbyStatus is null and - // adminState is unlocked and opState is enabled, - // the state shall transition to hotstandby - logger.info("\n??? demote() test case D2"); - resourceName = "test_resource4"; - final StateManagement sm4 = new StateManagement(emf, resourceName); - sm4.unlock(); - sm4.enableNotFailed(); - assertEquals(UNLOCKED_ENABLED_NULL_NULL, makeString(sm4)); - sm4.demote(); - assertEquals(UNLOCKED_ENABLED_NULL_HOTSTANDBY, makeString(sm4)); - - // P1 If promote() is called while standbyStatus is hotstandby, the - // state shall transition to providingservice. - logger.info("\n??? promote() test case P1"); - sm4.promote(); - assertEquals(UNLOCKED_ENABLED_NULL_PROVIDINGSERVICE, makeString(sm4)); - - // State change notification - logger.info("\n??? State change notification test case 1 - lock()"); - final StateChangeNotifier stateChangeNotifier = new StateChangeNotifier(); - sm.addObserver(stateChangeNotifier); - sm.lock(); - assertEquals(LOCKED_DISABLED_FAILED_COLDSTANDBY, makeString(stateChangeNotifier.getStateManagement())); - - logger.info("\n??? State change notification test case 2 - unlock()"); - sm.unlock(); - assertEquals(UNLOCKED_DISABLED_FAILED_COLDSTANDBY, makeString(stateChangeNotifier.getStateManagement())); - - logger.info("\n??? State change notification test case 3 - enabled()"); - sm.enableNotFailed(); - assertEquals(UNLOCKED_ENABLED_NULL_HOTSTANDBY, makeString(stateChangeNotifier.getStateManagement())); - - logger.info("\n??? State change notification test case 4 - disableFailed()"); - sm.disableFailed(); - assertEquals(UNLOCKED_DISABLED_FAILED_COLDSTANDBY, makeString(stateChangeNotifier.getStateManagement())); - - logger.info("\n??? State change notification test case 5 - demote()"); - sm.demote(); - assertEquals(UNLOCKED_DISABLED_FAILED_COLDSTANDBY, makeString(stateChangeNotifier.getStateManagement())); - - logger.info("\n??? State change notification test case 6 - promote()"); - assertThatThrownBy(sm::promote).isInstanceOf(IntegrityMonitorException.class); - assertEquals(UNLOCKED_DISABLED_FAILED_COLDSTANDBY, makeString(sm)); - + final StateManagement sm = new StateManagement(emf, TEST_RESOURCE_NAME); + test_1(sm); + test_2(sm); } catch (final Exception ex) { logger.error("Exception: {}", ex.toString()); throw ex; @@ -226,6 +98,136 @@ public class StateManagementTest extends IntegrityMonitorTestBase { logger.info("\n\nStateManagementTest: Exit\n\n"); } + private void test_1(final StateManagement sm) throws StateManagementException, IntegrityMonitorException { + logger.info("\n??? initial state"); + assertEquals(UNLOCKED_ENABLED_NULL_NULL, makeString(sm)); + + logger.info("\n??? test lock()"); + sm.lock(); + assertEquals("locked,enabled,null,null", makeString(sm)); + + logger.info("\n??? test unlock()"); + sm.unlock(); + assertEquals(UNLOCKED_ENABLED_NULL_NULL, makeString(sm)); + + logger.info("\n??? test enableNotFailed()"); + sm.enableNotFailed(); + assertEquals(UNLOCKED_ENABLED_NULL_NULL, makeString(sm)); + + logger.info("\n??? test disableFailed()"); + sm.disableFailed(); + assertEquals("unlocked,disabled,failed,null", makeString(sm)); + + // P4 If promote() is called while either the opState is disabled or + // the adminState is locked, + // the standbystatus shall transition to coldstandby and a + // StandbyStatusException shall be thrown + logger.info("\n??? promote() test case P4"); + sm.disableFailed(); + sm.lock(); + assertThatThrownBy(sm::promote).isInstanceOf(IntegrityMonitorException.class); + + assertEquals(LOCKED_DISABLED_FAILED_COLDSTANDBY, makeString(sm)); + + // P3 If promote() is called while standbyStatus is coldstandby, the + // state shall not transition + // and a StandbyStatusException shall be thrown + logger.info("\n??? promote() test case P3"); + assertThatThrownBy(sm::promote).isInstanceOf(IntegrityMonitorException.class); + assertEquals(LOCKED_DISABLED_FAILED_COLDSTANDBY, makeString(sm)); + + // P2 If promote() is called while the standbyStatus is null and the + // opState is enabled and adminState is unlocked, + // the state shall transition to providingservice + logger.info("\n??? promote() test case P2"); + final StateManagement sm2 = new StateManagement(emf, "test_resource2"); + sm2.enableNotFailed(); + sm2.unlock(); + assertEquals(UNLOCKED_ENABLED_NULL_NULL, makeString(sm2)); + sm2.promote(); + assertEquals(UNLOCKED_ENABLED_NULL_PROVIDINGSERVICE, makeString(sm2)); + + // P5 If promote() is called while standbyStatus is + // providingservice, no action is taken + logger.info("\n??? promote() test case P5"); + sm2.promote(); + assertEquals(UNLOCKED_ENABLED_NULL_PROVIDINGSERVICE, makeString(sm2)); + + // D1 If demote() is called while standbyStatus is providingservice, + // the state shall transition to hotstandby + logger.info("\n??? demote() test case D1"); + sm2.demote(); + assertEquals(UNLOCKED_ENABLED_NULL_HOTSTANDBY, makeString(sm2)); + + // D4 If demote() is called while standbyStatus is hotstandby, no + // action is taken + logger.info("\n??? demote() test case D4"); + sm2.demote(); + assertEquals(UNLOCKED_ENABLED_NULL_HOTSTANDBY, makeString(sm2)); + } + + private void test_2(final StateManagement sm) throws StateManagementException, IntegrityMonitorException { + // D3 If demote() is called while standbyStatus is null and + // adminState is locked or opState is disabled, + // the state shall transition to coldstandby + logger.info("\n??? demote() test case D3"); + final StateManagement sm3 = new StateManagement(emf, "test_resource3"); + sm3.lock(); + sm3.disableFailed(); + sm3.demote(); + assertEquals(LOCKED_DISABLED_FAILED_COLDSTANDBY, makeString(sm3)); + + // D5 If demote() is called while standbyStatus is coldstandby, no + // action is taken + logger.info("\n??? demote() test case D5"); + sm3.demote(); + assertEquals(LOCKED_DISABLED_FAILED_COLDSTANDBY, makeString(sm3)); + + // D2 If demote() is called while standbyStatus is null and + // adminState is unlocked and opState is enabled, + // the state shall transition to hotstandby + logger.info("\n??? demote() test case D2"); + final StateManagement sm4 = new StateManagement(emf, "test_resource4"); + sm4.unlock(); + sm4.enableNotFailed(); + assertEquals(UNLOCKED_ENABLED_NULL_NULL, makeString(sm4)); + sm4.demote(); + assertEquals(UNLOCKED_ENABLED_NULL_HOTSTANDBY, makeString(sm4)); + + // P1 If promote() is called while standbyStatus is hotstandby, the + // state shall transition to providingservice. + logger.info("\n??? promote() test case P1"); + sm4.promote(); + assertEquals(UNLOCKED_ENABLED_NULL_PROVIDINGSERVICE, makeString(sm4)); + + // State change notification + logger.info("\n??? State change notification test case 1 - lock()"); + final StateChangeNotifier stateChangeNotifier = new StateChangeNotifier(); + sm.addObserver(stateChangeNotifier); + sm.lock(); + assertEquals(LOCKED_DISABLED_FAILED_COLDSTANDBY, makeString(stateChangeNotifier.getStateManagement())); + + logger.info("\n??? State change notification test case 2 - unlock()"); + sm.unlock(); + assertEquals(UNLOCKED_DISABLED_FAILED_COLDSTANDBY, makeString(stateChangeNotifier.getStateManagement())); + + logger.info("\n??? State change notification test case 3 - enabled()"); + sm.enableNotFailed(); + assertEquals(UNLOCKED_ENABLED_NULL_HOTSTANDBY, makeString(stateChangeNotifier.getStateManagement())); + + logger.info("\n??? State change notification test case 4 - disableFailed()"); + sm.disableFailed(); + assertEquals(UNLOCKED_DISABLED_FAILED_COLDSTANDBY, makeString(stateChangeNotifier.getStateManagement())); + + logger.info("\n??? State change notification test case 5 - demote()"); + sm.demote(); + assertEquals(UNLOCKED_DISABLED_FAILED_COLDSTANDBY, makeString(stateChangeNotifier.getStateManagement())); + + logger.info("\n??? State change notification test case 6 - promote()"); + assertThatThrownBy(sm::promote).isInstanceOf(IntegrityMonitorException.class); + assertEquals(UNLOCKED_DISABLED_FAILED_COLDSTANDBY, makeString(sm)); + } + @Test(expected = StateManagementException.class) @SuppressWarnings("unchecked") public void test_StateManagementInitialization_ThrowException_ifEntityManagerCreateQuerythrowsAnyException() 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 833574a3..73ff6ed6 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 @@ -4,6 +4,7 @@ * ================================================================================ * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved. * Modifications Copyright (C) 2019 Samsung Electronics Co., Ltd. + * Modifications Copyright (C) 2020 Bell Canada. 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. @@ -41,7 +42,7 @@ public abstract class NoopTopicEndpoint extends TopicBase { /** * Constructs the object. */ - public NoopTopicEndpoint(List<String> servers, String topic) { + protected NoopTopicEndpoint(List<String> servers, String topic) { super(servers, topic); } diff --git a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/BusConsumer.java b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/BusConsumer.java index 60ab2e9e..5fb3aedb 100644 --- a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/BusConsumer.java +++ b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/BusConsumer.java @@ -4,6 +4,7 @@ * ================================================================================ * Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved. * Modifications Copyright (C) 2018 Samsung Electronics Co., Ltd. + * Modifications Copyright (C) 2020 Bell Canada. 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. @@ -223,7 +224,7 @@ public interface BusConsumer { * @param busTopicParams contains above listed attributes * @throws MalformedURLException URL should be valid */ - public DmaapConsumerWrapper(BusTopicParams busTopicParams) throws MalformedURLException { + protected DmaapConsumerWrapper(BusTopicParams busTopicParams) throws MalformedURLException { this.fetchTimeout = busTopicParams.getFetchTimeout(); diff --git a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/BusPublisher.java b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/BusPublisher.java index 09d52946..0c058adb 100644 --- a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/BusPublisher.java +++ b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/BusPublisher.java @@ -4,6 +4,7 @@ * ================================================================================ * Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved. * Modifications Copyright (C) 2018 Samsung Electronics Co., Ltd. + * Modifications Copyright (C) 2020 Bell Canada. 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. @@ -164,7 +165,7 @@ public interface BusPublisher { * @param username AAF or DME2 Login * @param password AAF or DME2 Password */ - public DmaapPublisherWrapper(ProtocolTypeConstants protocol, List<String> servers, String topic, + protected DmaapPublisherWrapper(ProtocolTypeConstants protocol, List<String> servers, String topic, String username, String password, boolean useHttps) { diff --git a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/BusTopicBase.java b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/BusTopicBase.java index ccf25753..6dd6a3eb 100644 --- a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/BusTopicBase.java +++ b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/BusTopicBase.java @@ -3,13 +3,14 @@ * ONAP * ================================================================================ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2020 Bell Canada. 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. @@ -49,7 +50,7 @@ public abstract class BusTopicBase extends TopicBase implements ApiKeyEnabled { /** * Instantiates a new Bus Topic Base. - * + * * <p>servers list of servers * topic topic name * apiKey API Key @@ -59,7 +60,7 @@ public abstract class BusTopicBase extends TopicBase implements ApiKeyEnabled { * @param busTopicParams holds all our parameters * @throws IllegalArgumentException if invalid parameters are present */ - public BusTopicBase(BusTopicParams busTopicParams) { + protected BusTopicBase(BusTopicParams busTopicParams) { super(busTopicParams.getServers(), busTopicParams.getTopic(), busTopicParams.getEffectiveTopic()); this.apiKey = busTopicParams.getApiKey(); this.apiSecret = busTopicParams.getApiSecret(); @@ -79,7 +80,7 @@ public abstract class BusTopicBase extends TopicBase implements ApiKeyEnabled { /** * Is using HTTPS. - * + * * @return if using https */ public boolean isUseHttps() { @@ -88,7 +89,7 @@ public abstract class BusTopicBase extends TopicBase implements ApiKeyEnabled { /** * Is self signed certificates allowed. - * + * * @return if self signed certificates are allowed */ public boolean isAllowSelfSignedCerts() { 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 00bd9e3a..d586f887 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 @@ -4,6 +4,7 @@ * ================================================================================ * Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved. * Modifications Copyright (C) 2018-2019 Samsung Electronics Co., Ltd. + * Modifications Copyright (C) 2020 Bell Canada. 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. @@ -60,9 +61,9 @@ public abstract class InlineBusTopicSink extends BusTopicBase implements BusTopi * partitionId partition id * useHttps does connection use HTTPS? * allowSelfSignedCerts are self-signed certificates allow * - * @throws IllegalArgumentException in invalid parameters are passed in + * @throws IllegalArgumentException if invalid parameters are passed in */ - public InlineBusTopicSink(BusTopicParams busTopicParams) { + protected InlineBusTopicSink(BusTopicParams busTopicParams) { super(busTopicParams); 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 6e746948..376a62d1 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 @@ -4,6 +4,7 @@ * ================================================================================ * Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved. * Modifications Copyright (C) 2018-2019 Samsung Electronics Co., Ltd. + * Modifications Copyright (C) 2020 Bell Canada. 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. @@ -84,7 +85,7 @@ public abstract class SingleThreadedBusTopicSource extends BusTopicBase * * @throws IllegalArgumentException An invalid parameter passed in */ - public SingleThreadedBusTopicSource(BusTopicParams busTopicParams) { + protected SingleThreadedBusTopicSource(BusTopicParams busTopicParams) { super(busTopicParams); diff --git a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/TopicBase.java b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/TopicBase.java index 2e0a9a46..efa06e22 100644 --- a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/TopicBase.java +++ b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/TopicBase.java @@ -3,6 +3,7 @@ * ONAP * ================================================================================ * Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2020 Bell Canada. 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. @@ -81,7 +82,7 @@ public abstract class TopicBase implements Topic { * * @throws IllegalArgumentException if invalid parameters are present */ - public TopicBase(List<String> servers, String topic) { + protected TopicBase(List<String> servers, String topic) { this(servers, topic, topic); } @@ -93,7 +94,7 @@ public abstract class TopicBase implements Topic { * * @throws IllegalArgumentException if invalid parameters are present */ - public TopicBase(List<String> servers, String topic, String effectiveTopic) { + protected TopicBase(List<String> servers, String topic, String effectiveTopic) { if (servers == null || servers.isEmpty()) { throw new IllegalArgumentException("Server(s) must be provided"); diff --git a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/internal/JettyServletServer.java b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/internal/JettyServletServer.java index 699d5d43..29e7bbfd 100644 --- a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/internal/JettyServletServer.java +++ b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/internal/JettyServletServer.java @@ -4,6 +4,7 @@ * ================================================================================ * Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved. * Modifications Copyright (C) 2019-2020 Nordix Foundation. + * Modifications Copyright (C) 2020 Bell Canada. 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. @@ -131,7 +132,7 @@ public abstract class JettyServletServer implements HttpServletServer, Runnable * * @throws IllegalArgumentException if invalid parameters are passed in */ - public JettyServletServer(String name, boolean https, String host, int port, String contextPath) { + protected JettyServletServer(String name, boolean https, String host, int port, String contextPath) { String srvName = name; if (srvName == null || srvName.isEmpty()) { @@ -183,7 +184,7 @@ public abstract class JettyServletServer implements HttpServletServer, Runnable this.jettyServer.setHandler(context); } - public JettyServletServer(String name, String host, int port, String contextPath) { + protected JettyServletServer(String name, String host, int port, String contextPath) { this(name, false, host, port, contextPath); } diff --git a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/listeners/JsonListener.java b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/listeners/JsonListener.java index ff8cbc5b..ce60f59c 100644 --- a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/listeners/JsonListener.java +++ b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/listeners/JsonListener.java @@ -3,6 +3,7 @@ * ONAP * ================================================================================ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2020 Bell Canada. 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. @@ -44,7 +45,7 @@ public abstract class JsonListener implements TopicListener { /** * Constructs the object. */ - public JsonListener() { + protected JsonListener() { super(); } diff --git a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/listeners/ScoListener.java b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/listeners/ScoListener.java index a3d33965..117071c3 100644 --- a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/listeners/ScoListener.java +++ b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/listeners/ScoListener.java @@ -3,6 +3,7 @@ * ONAP * ================================================================================ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2020 Bell Canada. 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. @@ -53,7 +54,7 @@ public abstract class ScoListener<T> { * * @param clazz class of message this handles */ - public ScoListener(Class<T> clazz) { + protected ScoListener(Class<T> clazz) { this.clazz = clazz; } |