Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docs/TCF Service - Streams.html17
-rw-r--r--plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/internal/tcf/services/remote/StreamsProxy.java13
-rw-r--r--plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/services/IStreams.java24
3 files changed, 54 insertions, 0 deletions
diff --git a/docs/TCF Service - Streams.html b/docs/TCF Service - Streams.html
index 1bcc7b7d7..f2ebb1f9e 100644
--- a/docs/TCF Service - Streams.html
+++ b/docs/TCF Service - Streams.html
@@ -16,6 +16,7 @@
<li><a href='#CmdRead'>Read</a>
<li><a href='#CmdWrite'>Write</a>
<li><a href='#CmdEOS'>End of Stream</a>
+ <li><a href='#CmdConnect'>Connect</a>
<li><a href='#CmdDisconnect'>Disconnect</a>
</ul>
<li><a href='#Events'>Events</a>
@@ -154,6 +155,22 @@ C &bull; <i>&lt;token&gt;</i> &bull; Streams &bull; eos &bull; <i>&lt;string: st
R &bull; <i>&lt;token&gt;</i> &bull; <i>&lt;error report&gt;</i> &bull;
</font></b></pre>
+<h3><a name='CmdConnect'>Connect</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C &bull; <i>&lt;token&gt;</i> &bull; Streams &bull; connect &bull; <i>&lt;string: stream ID&gt;</i> &bull;
+</font></b></pre>
+
+<p>The command connects client to a stream. Some data might be dropped from the stream by the time "connect" command is executed.
+Client should be able to re-sync with stream data if it wants to read from such stream.
+If a client wants to read a stream from the beginning it should use "subscribe" command instead of "connect"</p>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R &bull; <i>&lt;token&gt;</i> &bull; <i>&lt;error report&gt;</i> &bull;
+</font></b></pre>
+
<h3><a name='CmdDisconnect'>Disconnect</a></h3>
<pre><b><font face="Courier New" size=2 color=#333399>
diff --git a/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/internal/tcf/services/remote/StreamsProxy.java b/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/internal/tcf/services/remote/StreamsProxy.java
index 4dfd93424..f785def30 100644
--- a/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/internal/tcf/services/remote/StreamsProxy.java
+++ b/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/internal/tcf/services/remote/StreamsProxy.java
@@ -31,6 +31,19 @@ public class StreamsProxy implements IStreams {
this.channel = channel;
}
+ public IToken connect(String stream_id, final DoneConnect done) {
+ return new Command(channel, this, "connect", new Object[]{ stream_id }) {
+ @Override
+ public void done(Exception error, Object[] args) {
+ if (error == null) {
+ assert args.length == 1;
+ error = toError(args[0]);
+ }
+ done.doneConnect(token, error);
+ }
+ }.token;
+ }
+
public IToken disconnect(String stream_id, final DoneDisconnect done) {
return new Command(channel, this, "disconnect", new Object[]{ stream_id }) {
@Override
diff --git a/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/services/IStreams.java b/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/services/IStreams.java
index ded45744c..0b0d03104 100644
--- a/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/services/IStreams.java
+++ b/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/services/IStreams.java
@@ -170,6 +170,30 @@ public interface IStreams extends IService {
}
/**
+ * Connect client to a stream.
+ * Some data might be dropped from the stream by the time "connect" command is executed.
+ * Client should be able to re-sync with stream data if it wants to read from such stream.
+ * If a client wants to read a stream from the beginning it should use "subscribe" command
+ * instead of "connect".
+ * @param stream_id - ID of the stream.
+ * @param done - command result call back object.
+ * @return - pending command handle.
+ */
+ IToken connect(String stream_id, DoneConnect done);
+
+ /**
+ * Call back interface for 'connect' command.
+ */
+ interface DoneConnect {
+ /**
+ * Called when 'connect' command is done.
+ * @param token - command handle.
+ * @param error - error object or null.
+ */
+ void doneConnect(IToken token, Exception error);
+ }
+
+ /**
* Disconnect client from a stream.
* @param stream_id - ID of the stream.
* @param done - command result call back object.

Back to the top