Fixing sonar issues in policy-common 24/116124/2
authora.sreekumar <ajith.sreekumar@bell.ca>
Fri, 4 Dec 2020 11:04:10 +0000 (11:04 +0000)
committera.sreekumar <ajith.sreekumar@bell.ca>
Fri, 4 Dec 2020 11:22:21 +0000 (11:22 +0000)
Change-Id: I4dce0dbdf71d01fbb59e9bf861d1af1ab49e5ae7
Issue-ID: POLICY-2914
Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
13 files changed:
common-parameters/src/main/java/org/onap/policy/common/parameters/CommonGroupValidationResult.java
common-parameters/src/main/java/org/onap/policy/common/parameters/ValidationResultImpl.java
integrity-monitor/src/test/java/org/onap/policy/common/im/StateManagementTest.java
policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/NoopTopicEndpoint.java
policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/BusConsumer.java
policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/BusPublisher.java
policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/BusTopicBase.java
policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/InlineBusTopicSink.java
policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/SingleThreadedBusTopicSource.java
policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/TopicBase.java
policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/internal/JettyServletServer.java
policy-endpoints/src/main/java/org/onap/policy/common/endpoints/listeners/JsonListener.java
policy-endpoints/src/main/java/org/onap/policy/common/endpoints/listeners/ScoListener.java

index f35d197..ba31698 100644 (file)
@@ -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();
     }
index 1d8aa23..0fda51a 100644 (file)
@@ -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;
index 12671ec..fb1df8c 100644 (file)
@@ -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()
index 833574a..73ff6ed 100644 (file)
@@ -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);
     }
 
index 60ab2e9..5fb3aed 100644 (file)
@@ -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();
 
index 09d5294..0c058ad 100644 (file)
@@ -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) {
 
 
index ccf2575..6dd6a3e 100644 (file)
@@ -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() {
index 00bd9e3..d586f88 100644 (file)
@@ -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);
 
index 6e74694..376a62d 100644 (file)
@@ -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);
 
index 2e0a9a4..efa06e2 100644 (file)
@@ -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");
index 699d5d4..29e7bbf 100644 (file)
@@ -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);
     }
 
index ff8cbc5..ce60f59 100644 (file)
@@ -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();
     }
 
index a3d3396..117071c 100644 (file)
@@ -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;
     }