From fbf94a6505d7c4b7c009446ca7dca93a9ce0db4d Mon Sep 17 00:00:00 2001 From: rameshiyer27 Date: Mon, 11 Dec 2023 18:50:14 +0000 Subject: Add kafka support on drools-pdp Issue-ID: POLICY-4201 Signed-off-by: zrrmmua Change-Id: I7f9ebec13cc41c214a400087f99e62bbc895abdd --- .../policy/drools/controller/IndexedDroolsControllerFactory.java | 6 ++++++ .../java/org/onap/policy/drools/server/restful/RestManager.java | 6 ++++++ 2 files changed, 12 insertions(+) (limited to 'policy-management/src') diff --git a/policy-management/src/main/java/org/onap/policy/drools/controller/IndexedDroolsControllerFactory.java b/policy-management/src/main/java/org/onap/policy/drools/controller/IndexedDroolsControllerFactory.java index 5491eac7..0c732246 100644 --- a/policy-management/src/main/java/org/onap/policy/drools/controller/IndexedDroolsControllerFactory.java +++ b/policy-management/src/main/java/org/onap/policy/drools/controller/IndexedDroolsControllerFactory.java @@ -271,6 +271,12 @@ class IndexedDroolsControllerFactory implements DroolsControllerFactory { } else { return PolicyEndPointProperties.PROPERTY_NOOP_SINK_TOPICS + "."; } + } else if (commInfra == CommInfrastructure.KAFKA) { + if (isSource) { + return PolicyEndPointProperties.PROPERTY_KAFKA_SOURCE_TOPICS + "."; + } else { + return PolicyEndPointProperties.PROPERTY_KAFKA_SINK_TOPICS + "."; + } } else { throw new IllegalArgumentException("Invalid Communication Infrastructure: " + commInfra); } diff --git a/policy-management/src/main/java/org/onap/policy/drools/server/restful/RestManager.java b/policy-management/src/main/java/org/onap/policy/drools/server/restful/RestManager.java index b5cf319e..ad23ff3a 100644 --- a/policy-management/src/main/java/org/onap/policy/drools/server/restful/RestManager.java +++ b/policy-management/src/main/java/org/onap/policy/drools/server/restful/RestManager.java @@ -1414,6 +1414,9 @@ public class RestManager implements SwaggerApi, DefaultApi, FeaturesApi, InputsA case NOOP: sources.addAll(TopicEndpointManager.getManager().getNoopTopicSources()); break; + case KAFKA: + sources.addAll(TopicEndpointManager.getManager().getKafkaTopicSources()); + break; default: status = Status.BAD_REQUEST; logger.debug("Invalid communication mechanism"); @@ -1449,6 +1452,9 @@ public class RestManager implements SwaggerApi, DefaultApi, FeaturesApi, InputsA case NOOP: sinks.addAll(TopicEndpointManager.getManager().getNoopTopicSinks()); break; + case KAFKA: + sinks.addAll(TopicEndpointManager.getManager().getKafkaTopicSinks()); + break; default: status = Status.BAD_REQUEST; logger.debug("Invalid communication mechanism"); -- cgit 1.2.3-korg