diff options
author | Smokowski, Kevin (ks6305) <kevin.smokowski@att.com> | 2019-05-30 22:23:52 +0000 |
---|---|---|
committer | Kevin Smokowski <kevin.smokowski@att.com> | 2019-06-17 15:31:38 +0000 |
commit | d14bb405004176e72e8722438eb95819ed11f1c7 (patch) | |
tree | b99fb91f96bf55fa8d02823a3baae90bc3325797 /message-router/consumer/api | |
parent | faaa1a75d85a522847acf4c7250b8da5f076cfa0 (diff) |
implement message router consumer
implement message router consumer
Issue-ID: CCSDK-1373
Signed-off-by: Smokowski, Kevin (ks6305) <kevin.smokowski@att.com>
Change-Id: Iea4290c5b9e9bb63f152f0605dae1e715974f217
Diffstat (limited to 'message-router/consumer/api')
5 files changed, 52 insertions, 0 deletions
diff --git a/message-router/consumer/api/pom.xml b/message-router/consumer/api/pom.xml new file mode 100755 index 000000000..541b4cc0b --- /dev/null +++ b/message-router/consumer/api/pom.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.onap.ccsdk.sli.adaptors.messagerouter</groupId> + <artifactId>consumer.aggregate</artifactId> + <version>0.5.0-SNAPSHOT</version> + </parent> + + <artifactId>consumer.api</artifactId> + <packaging>bundle</packaging> + + <build> + <plugins> + <plugin> + <groupId>org.apache.felix</groupId> + <artifactId>maven-bundle-plugin</artifactId> + <configuration> + <instructions> + <Export-Package>org.onap.ccsdk.sli.adaptors.messagerouter.consumer.api</Export-Package> + </instructions> + </configuration> + </plugin> + </plugins> + </build> +</project> 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 000000000..41deade85 --- /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 000000000..29fc1c764 --- /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 000000000..1187aaceb --- /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 000000000..07a117843 --- /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); +} |