Some minor cleanup on the transport API (documentation and such).
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=70109458
diff --git a/core/src/main/java/com/google/net/stubby/newtransport/Stream.java b/core/src/main/java/com/google/net/stubby/newtransport/Stream.java
index ea97999..a2faf1e 100644
--- a/core/src/main/java/com/google/net/stubby/newtransport/Stream.java
+++ b/core/src/main/java/com/google/net/stubby/newtransport/Stream.java
@@ -37,7 +37,6 @@
* @param value the value of the context property.
* @param length the length of the {@link InputStream}.
* @param accepted an optional callback for when the transport has accepted the write.
- * @return this stream instance.
*/
void writeContext(String name, InputStream value, int length, @Nullable Runnable accepted);
@@ -56,7 +55,6 @@
* @param message stream containing the serialized message to be sent
* @param length the length of the {@link InputStream}.
* @param accepted an optional callback for when the transport has accepted the write.
- * @return this stream instance.
*/
void writeMessage(InputStream message, int length, @Nullable Runnable accepted);
diff --git a/core/src/main/java/com/google/net/stubby/newtransport/StreamListener.java b/core/src/main/java/com/google/net/stubby/newtransport/StreamListener.java
index 1efc441..4b3cba0 100644
--- a/core/src/main/java/com/google/net/stubby/newtransport/StreamListener.java
+++ b/core/src/main/java/com/google/net/stubby/newtransport/StreamListener.java
@@ -5,6 +5,8 @@
import java.io.InputStream;
+import javax.annotation.Nullable;
+
/**
* An observer of {@link Stream} events. It is guaranteed to only have one concurrent callback at a
* time.
@@ -24,6 +26,7 @@
* processed by the application. If {@code null}, processing of this context is assumed to
* be complete upon returning from this method.
*/
+ @Nullable
ListenableFuture<Void> contextRead(String name, InputStream value, int length);
/**
@@ -38,6 +41,7 @@
* processed by the application. If {@code null}, processing of this message is assumed to
* be complete upon returning from this method.
*/
+ @Nullable
ListenableFuture<Void> messageRead(InputStream message, int length);
/**
diff --git a/core/src/main/java/com/google/net/stubby/newtransport/StreamState.java b/core/src/main/java/com/google/net/stubby/newtransport/StreamState.java
index 163680b..5d5e967 100644
--- a/core/src/main/java/com/google/net/stubby/newtransport/StreamState.java
+++ b/core/src/main/java/com/google/net/stubby/newtransport/StreamState.java
@@ -2,8 +2,18 @@
/**
* The state of a single {@link Stream} within a transport.
+ *
+ * <p>Client state transitions:<br>
+ * OPEN->READ_ONLY->CLOSED (no-error case)<br>
+ * OPEN->CLOSED (error) <br>
+ * STARTING->CLOSED (Failed creation) <br>
+ *
+ * <p>Server state transitions:<br>
+ * OPEN->WRITE_ONLY->CLOSED (no-error case) <br>
+ * OPEN->CLOSED (error case) <br>
*/
public enum StreamState {
+
/**
* The stream is open for write by both endpoints.
*/