summaryrefslogtreecommitdiff
path: root/src/mining/Stream.java
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2014-04-30 13:57:39 +0200
committerPeter Wu <peter@lekensteyn.nl>2014-04-30 13:57:39 +0200
commit7ed1ad840e57ebe84772a60cdde29cadc7506db2 (patch)
tree04c553c9f25f850fab22a67834d5df760293a105 /src/mining/Stream.java
parentb47e834f62684fc0d1af4470ba10f6f5d26926c8 (diff)
downloadTwitterDataAnalytics-7ed1ad840e57ebe84772a60cdde29cadc7506db2.tar.gz
Stream interface
Diffstat (limited to 'src/mining/Stream.java')
-rw-r--r--src/mining/Stream.java29
1 files changed, 21 insertions, 8 deletions
diff --git a/src/mining/Stream.java b/src/mining/Stream.java
index 283b4ea..456a405 100644
--- a/src/mining/Stream.java
+++ b/src/mining/Stream.java
@@ -1,23 +1,36 @@
package mining;
+import java.io.IOException;
+
/**
- * interface for all streaming classes.
- *
- * @author Maurice Laveaux
+ * Provides access to a stream. The implementor is supposed to provide means
+ * that allows a client to be notified of new tweets.
*/
public interface Stream {
/**
- * Open the connection to the server.
+ * Add the keyword (or phrase) to the list of keywords to be watched in a
+ * stream.
+ *
+ * @param keyword
+ */
+ public void watchKeyword(String keyword);
+
+ /**
+ * Removes the keyword (or phrase) from the list of keywords to watch for in
+ * a stream.
+ *
+ * @param keyword
*/
- public void open();
+ public void unwatchKeyword(String keyword);
/**
- * Set a single listener for this stream.
+ * Starts streaming tweets. If a connection is already open, then it may be
+ * re-opened to use new keywords.
*
- * @param listener The object that is listening.
+ * @throws IOException on failure to open a streaming connection.
*/
- public void setListener(StreamListener listener);
+ public void commit() throws IOException;
/**
* Test whether the stream is ready for streaming