Fix apex-pdp due to sonar changes in common 42/91042/1
authorjrh3 <jrh3@att.com>
Mon, 8 Jul 2019 17:16:46 +0000 (13:16 -0400)
committerjrh3 <jrh3@att.com>
Mon, 8 Jul 2019 19:32:51 +0000 (15:32 -0400)
Fixed breakages due to changes made in policy/common to satisfy
sonar.

Issue-ID: POLICY-1791
Signed-off-by: jrh3 <jrh3@att.com>
Change-Id: I79ee847db2fc3c5af992af85b78ccaa587328463

pom.xml
services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/ApexStarterActivator.java
services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/rest/ApexStarterRestServer.java

diff --git a/pom.xml b/pom.xml
index 9662252..5f97443 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -2,6 +2,7 @@
   ============LICENSE_START=======================================================
    Copyright (C) 2018 Ericsson. All rights reserved.
    Copyright (C) 2019 Nordix Foundation.
+   Modifications Copyright (C) 2019 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.
@@ -45,7 +46,7 @@
         <version.jersey>2.26</version.jersey>
         <version.hibernate>5.3.7.Final</version.hibernate>
         <version.policy.common>1.5.1-SNAPSHOT</version.policy.common>
-        <version.policy.models>2.1.0</version.policy.models>
+        <version.policy.models>2.1.1-SNAPSHOT</version.policy.models>
         <!-- sonar/jacoco overrides -->
         <!-- Overriding oparent default sonar/jacoco settings Combine all our reports
             into one file shared across sub-modules -->
index e48d75e..968c54d 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2019 Nordix Foundation.
+ *  Modifications Copyright (C) 2019 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.
@@ -22,10 +23,8 @@ package org.onap.policy.apex.services.onappf;
 
 import java.util.List;
 import java.util.Properties;
-
 import lombok.Getter;
 import lombok.Setter;
-
 import org.onap.policy.apex.services.onappf.comm.PdpStateChangeListener;
 import org.onap.policy.apex.services.onappf.comm.PdpStatusPublisher;
 import org.onap.policy.apex.services.onappf.comm.PdpUpdateListener;
@@ -34,7 +33,7 @@ import org.onap.policy.apex.services.onappf.exception.ApexStarterRunTimeExceptio
 import org.onap.policy.apex.services.onappf.handler.PdpMessageHandler;
 import org.onap.policy.apex.services.onappf.parameters.ApexStarterParameterGroup;
 import org.onap.policy.apex.services.onappf.rest.ApexStarterRestServer;
-import org.onap.policy.common.endpoints.event.comm.TopicEndpoint;
+import org.onap.policy.common.endpoints.event.comm.TopicEndpointManager;
 import org.onap.policy.common.endpoints.event.comm.TopicSink;
 import org.onap.policy.common.endpoints.event.comm.TopicSource;
 import org.onap.policy.common.endpoints.listeners.MessageTypeDispatcher;
@@ -86,8 +85,8 @@ public class ApexStarterActivator {
     public ApexStarterActivator(final ApexStarterParameterGroup apexStarterParameterGroup,
             final Properties topicProperties) {
 
-        topicSinks = TopicEndpoint.manager.addTopicSinks(topicProperties);
-        topicSources = TopicEndpoint.manager.addTopicSources(topicProperties);
+        topicSinks = TopicEndpointManager.getManager().addTopicSinks(topicProperties);
+        topicSources = TopicEndpointManager.getManager().addTopicSources(topicProperties);
 
         // TODO: instanceId currently set as a random string, could be fetched from actual deployment
         final int random = (int) (Math.random() * 100);
@@ -105,8 +104,8 @@ public class ApexStarterActivator {
         // @formatter:off
         this.manager = new ServiceManager()
                 .addAction("topics",
-                    () -> TopicEndpoint.manager.start(),
-                    () -> TopicEndpoint.manager.shutdown())
+                    () -> TopicEndpointManager.getManager().start(),
+                    () -> TopicEndpointManager.getManager().shutdown())
                 .addAction("set alive",
                     () -> setAlive(true),
                     () -> setAlive(false))
index ba5585b..fe3b067 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2019 Nordix Foundation.
+ *  Modifications Copyright (C) 2019 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.
@@ -26,6 +27,7 @@ import java.util.Properties;
 
 import org.onap.policy.common.capabilities.Startable;
 import org.onap.policy.common.endpoints.http.server.HttpServletServer;
+import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInstance;
 import org.onap.policy.common.endpoints.parameters.RestServerParameters;
 import org.onap.policy.common.endpoints.properties.PolicyEndPointProperties;
 import org.onap.policy.common.gson.GsonMessageBodyHandler;
@@ -59,7 +61,7 @@ public class ApexStarterRestServer implements Startable {
     @Override
     public boolean start() {
         try {
-            servers = HttpServletServer.factory.build(getServerProperties());
+            servers = HttpServletServerFactoryInstance.getServerFactory().build(getServerProperties());
             for (final HttpServletServer server : servers) {
                 if (server.isAaf()) {
                     server.addFilterClass(null, ApexStarterAafFilter.class.getName());