Allow xacml-pdp to use kafka
[policy/xacml-pdp.git] / main / src / main / java / org / onap / policy / pdpx / main / startstop / XacmlPdpActivator.java
index 531374d..d62b6f4 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  * Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -42,7 +43,6 @@ import org.onap.policy.pdpx.main.comm.XacmlPdpHearbeatPublisher;
 import org.onap.policy.pdpx.main.comm.listeners.XacmlPdpStateChangeListener;
 import org.onap.policy.pdpx.main.comm.listeners.XacmlPdpUpdateListener;
 import org.onap.policy.pdpx.main.parameters.XacmlPdpParameterGroup;
-import org.onap.policy.pdpx.main.rest.XacmlPdpAafFilter;
 import org.onap.policy.pdpx.main.rest.XacmlPdpApplicationManager;
 import org.onap.policy.pdpx.main.rest.XacmlPdpRestController;
 import org.onap.policy.pdpx.main.rest.XacmlPdpServiceFilter;
@@ -60,12 +60,11 @@ public class XacmlPdpActivator extends ServiceManagerContainer {
     private static final Logger LOGGER = LoggerFactory.getLogger(XacmlPdpActivator.class);
 
     private static final String[] MSG_TYPE_NAMES = {"messageName"};
-    private static final String TOPIC = "POLICY-PDP-PAP";
+    private static final String TOPIC = "policy-pdp-pap";
 
     @Getter
     @Setter
     private static XacmlPdpActivator current = null;
-    private final XacmlPdpRestServer restServer;
 
     // The parameters of this policy xacml pdp activator
     private final XacmlPdpParameterGroup xacmlPdpParameterGroup;
@@ -73,7 +72,7 @@ public class XacmlPdpActivator extends ServiceManagerContainer {
     /**
      * POLICY-PDP-PAP client.
      */
-    private BidirectionalTopicClient topicClient;
+    private final BidirectionalTopicClient topicClient;
 
     /**
      * Listens for messages on the topic, decodes them into a {@link PdpStatus} message, and then
@@ -97,6 +96,7 @@ public class XacmlPdpActivator extends ServiceManagerContainer {
         final TopicSinkClient sinkClient;
         final XacmlState state;
 
+        XacmlPdpRestServer restServer;
         try {
             HttpClient apiClient = HttpClientFactoryInstance.getClientFactory().build(apiClientParams);
 
@@ -132,8 +132,7 @@ public class XacmlPdpActivator extends ServiceManagerContainer {
             XacmlPdpServiceFilter.disableApi();
 
             restServer = new XacmlPdpRestServer(xacmlPdpParameterGroup.getRestServerParameters(),
-                                List.of(XacmlPdpServiceFilter.class, XacmlPdpAafFilter.class),
-                                List.of(XacmlPdpRestController.class));
+                                List.of(XacmlPdpServiceFilter.class), List.of(XacmlPdpRestController.class));
 
         } catch (RuntimeException | HttpClientConfigException | BidirectionalTopicClientException e) {
             throw new PolicyXacmlPdpRuntimeException(e.getMessage(), e);