From d14bb405004176e72e8722438eb95819ed11f1c7 Mon Sep 17 00:00:00 2001 From: "Smokowski, Kevin (ks6305)" Date: Thu, 30 May 2019 22:23:52 +0000 Subject: implement message router consumer implement message router consumer Issue-ID: CCSDK-1373 Signed-off-by: Smokowski, Kevin (ks6305) Change-Id: Iea4290c5b9e9bb63f152f0605dae1e715974f217 --- .../ccsdk/sli/adaptors/messagerouter/consumer/api/ConsumerApi.java | 6 ++++++ .../sli/adaptors/messagerouter/consumer/api/PollingConsumer.java | 7 +++++++ .../sli/adaptors/messagerouter/consumer/api/PullingConsumer.java | 7 +++++++ .../sli/adaptors/messagerouter/consumer/api/RequestHandler.java | 5 +++++ 4 files changed, 25 insertions(+) create mode 100755 message-router/consumer/api/src/main/java/org/onap/ccsdk/sli/adaptors/messagerouter/consumer/api/ConsumerApi.java create mode 100755 message-router/consumer/api/src/main/java/org/onap/ccsdk/sli/adaptors/messagerouter/consumer/api/PollingConsumer.java create mode 100755 message-router/consumer/api/src/main/java/org/onap/ccsdk/sli/adaptors/messagerouter/consumer/api/PullingConsumer.java create mode 100755 message-router/consumer/api/src/main/java/org/onap/ccsdk/sli/adaptors/messagerouter/consumer/api/RequestHandler.java (limited to 'message-router/consumer/api/src') diff --git a/message-router/consumer/api/src/main/java/org/onap/ccsdk/sli/adaptors/messagerouter/consumer/api/ConsumerApi.java b/message-router/consumer/api/src/main/java/org/onap/ccsdk/sli/adaptors/messagerouter/consumer/api/ConsumerApi.java new file mode 100755 index 00000000..41deade8 --- /dev/null +++ b/message-router/consumer/api/src/main/java/org/onap/ccsdk/sli/adaptors/messagerouter/consumer/api/ConsumerApi.java @@ -0,0 +1,6 @@ +package org.onap.ccsdk.sli.adaptors.messagerouter.consumer.api; + +public interface ConsumerApi extends AutoCloseable { + //registers a handler to handle a specific topic, should be called only once per client + public void registerHandler(String topic, RequestHandler requestHandler); +} diff --git a/message-router/consumer/api/src/main/java/org/onap/ccsdk/sli/adaptors/messagerouter/consumer/api/PollingConsumer.java b/message-router/consumer/api/src/main/java/org/onap/ccsdk/sli/adaptors/messagerouter/consumer/api/PollingConsumer.java new file mode 100755 index 00000000..29fc1c76 --- /dev/null +++ b/message-router/consumer/api/src/main/java/org/onap/ccsdk/sli/adaptors/messagerouter/consumer/api/PollingConsumer.java @@ -0,0 +1,7 @@ +package org.onap.ccsdk.sli.adaptors.messagerouter.consumer.api; + +public interface PollingConsumer extends ConsumerApi { + + // Starts polling message router for messages, won't stop until close it called + void start(); +} diff --git a/message-router/consumer/api/src/main/java/org/onap/ccsdk/sli/adaptors/messagerouter/consumer/api/PullingConsumer.java b/message-router/consumer/api/src/main/java/org/onap/ccsdk/sli/adaptors/messagerouter/consumer/api/PullingConsumer.java new file mode 100755 index 00000000..1187aace --- /dev/null +++ b/message-router/consumer/api/src/main/java/org/onap/ccsdk/sli/adaptors/messagerouter/consumer/api/PullingConsumer.java @@ -0,0 +1,7 @@ +package org.onap.ccsdk.sli.adaptors.messagerouter.consumer.api; + +public interface PullingConsumer extends ConsumerApi { + + //Pulls a single batch of messages + void pull(); +} diff --git a/message-router/consumer/api/src/main/java/org/onap/ccsdk/sli/adaptors/messagerouter/consumer/api/RequestHandler.java b/message-router/consumer/api/src/main/java/org/onap/ccsdk/sli/adaptors/messagerouter/consumer/api/RequestHandler.java new file mode 100755 index 00000000..07a11784 --- /dev/null +++ b/message-router/consumer/api/src/main/java/org/onap/ccsdk/sli/adaptors/messagerouter/consumer/api/RequestHandler.java @@ -0,0 +1,5 @@ +package org.onap.ccsdk.sli.adaptors.messagerouter.consumer.api; + +public interface RequestHandler { + public void handleRequest(String topic, String requestBody); +} -- cgit 1.2.3-korg