aries-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] cschneider closed pull request #12: Fix/extend documentation for the request builder
Date Sat, 05 Jan 2019 10:15:34 GMT
cschneider closed pull request #12: Fix/extend documentation for the request builder
URL: https://github.com/apache/aries-journaled-events/pull/12
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/org.apache.aries.events.api/src/main/java/org/apache/aries/events/api/Messaging.java
b/org.apache.aries.events.api/src/main/java/org/apache/aries/events/api/Messaging.java
index a66279d..0d9da2d 100644
--- a/org.apache.aries.events.api/src/main/java/org/apache/aries/events/api/Messaging.java
+++ b/org.apache.aries.events.api/src/main/java/org/apache/aries/events/api/Messaging.java
@@ -30,13 +30,10 @@
     void send(String topic, Message message);
 
     /**
-     * Subscribe to a topic. The callback is called for each message received.
-     * 
-     * @param topic to consume from. TODO Do we allow wild cards? 
-     * @param position in the topic to start consuming from 
-     * @param seek where to start from when position is not valid or null
-     * @param callback will be called for each message received
-     * @return Returned subscription must be closed by the caller to unsubscribe
+     * Subscribe to a topic.
+     * The returned subscription must be closed by the caller to unsubscribe.
+     *
+     * @param request to subscribe
      */
     Subscription subscribe(SubscribeRequest request);
 
diff --git a/org.apache.aries.events.api/src/main/java/org/apache/aries/events/api/SubscribeRequest.java
b/org.apache.aries.events.api/src/main/java/org/apache/aries/events/api/SubscribeRequest.java
index 34d8cdb..a86fdeb 100644
--- a/org.apache.aries.events.api/src/main/java/org/apache/aries/events/api/SubscribeRequest.java
+++ b/org.apache.aries.events.api/src/main/java/org/apache/aries/events/api/SubscribeRequest.java
@@ -23,6 +23,9 @@
 
 import javax.annotation.ParametersAreNonnullByDefault;
 
+/**
+ * A Subscription request to consume messages from a topic.
+ */
 @ParametersAreNonnullByDefault
 public final class SubscribeRequest {
     private final String topic;
@@ -35,15 +38,36 @@ private SubscribeRequest(String topic, Consumer<Received> callback)
{
         this.callback = callback;
     }
 
+    /**
+     * Build a subscription request for the given topic and {@code Consumer} callback.
+     *
+     * @param topic to consume from
+     * @param callback to be invoked for each message consumed
+     * @return a new subscription request
+     */
     public static SubscribeRequest to(String topic, Consumer<Received> callback) {
         return new SubscribeRequest(topic, callback);
     }
-    
+
+    /**
+     * Set the {@code Position} position to start consuming from.
+     *
+     * @param position in the topic to start consuming from
+     * @return the updated subscribe request
+     */
     public SubscribeRequest startAt(Position position) {
         this.position = position;
         return this;
     }
-    
+
+    /**
+     * Set the earliest or latest position to start consuming from
+     * when the position is {@code null} or not valid. By default,
+     * seek is set to {@link Seek#latest}.
+     *
+     * @param seek where to start consuming when no valid position is specified
+     * @return the updated subscribe request
+     */
     public SubscribeRequest seek(Seek seek) {
         this.seek = requireNonNull(seek, "Seek must not be null");
         return this;


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message