diff options
author | jrh3 <jrh3@att.com> | 2019-07-08 13:16:46 -0400 |
---|---|---|
committer | jrh3 <jrh3@att.com> | 2019-07-08 15:32:51 -0400 |
commit | a94cf1efa1dc3b4bb5f0d5f6b3655e6ae282c343 (patch) | |
tree | 81a6ef78326ff4835a403e1a581d26386ec3febb /services/services-onappf | |
parent | cad7cff7dc945eefaf27815742461d6db6ab8eac (diff) |
Fix apex-pdp due to sonar changes in common
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
Diffstat (limited to 'services/services-onappf')
2 files changed, 9 insertions, 8 deletions
diff --git a/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/ApexStarterActivator.java b/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/ApexStarterActivator.java index e48d75eb7..968c54d3d 100644 --- a/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/ApexStarterActivator.java +++ b/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/ApexStarterActivator.java @@ -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)) diff --git a/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/rest/ApexStarterRestServer.java b/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/rest/ApexStarterRestServer.java index ba5585b85..fe3b0671b 100644 --- a/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/rest/ApexStarterRestServer.java +++ b/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/rest/ApexStarterRestServer.java @@ -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()); |