Skip to content

Commit 2f07fdb

Browse files
simonbasleyschimke
authored andcommitted
add documentation to flag constants, mark STRICT as deprecated (#454)
1 parent fef9a79 commit 2f07fdb

File tree

5 files changed

+32
-4
lines changed

5 files changed

+32
-4
lines changed

rsocket-core/src/main/java/io/rsocket/AbstractRSocket.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
* An abstract implementation of {@link RSocket}. All request handling methods emit {@link
2626
* UnsupportedOperationException} and hence must be overridden to provide a valid implementation.
2727
*
28-
* <p>{@link #close()} and {@link #onClose()} returns a {@code Publisher} that never terminates.
28+
* <p>{@link #close()} returns a {@code Publisher} that immediately terminates. That same Publisher
29+
* is returned by the {@link #onClose()} method.
2930
*/
3031
public abstract class AbstractRSocket implements RSocket {
3132

rsocket-core/src/main/java/io/rsocket/Closeable.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ public interface Closeable {
2626
* <p><em>This method is idempotent and hence can be called as many times at any point with same
2727
* outcome.</em>
2828
*
29-
* @return A {@code Publisher} that completes when this {@code RSocket} close is complete.
29+
* @return A {@code Publisher} that triggers the close when subscribed to and that completes when
30+
* this {@code RSocket} close is complete.
3031
*/
3132
Mono<Void> close();
3233

rsocket-core/src/main/java/io/rsocket/frame/FrameHeaderFlyweight.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
*/
1616
package io.rsocket.frame;
1717

18-
import static io.rsocket.frame.FrameHeaderFlyweight.decodeMetadataLength;
19-
2018
import io.netty.buffer.ByteBuf;
2119
import io.netty.buffer.Unpooled;
2220
import io.rsocket.Frame;
2321
import io.rsocket.FrameType;
22+
import org.reactivestreams.Subscriber;
23+
2424
import javax.annotation.Nullable;
2525

2626
/**
@@ -49,11 +49,21 @@ private FrameHeaderFlyweight() {}
4949
private static final int STREAM_ID_FIELD_OFFSET;
5050
private static final int PAYLOAD_OFFSET;
5151

52+
/** (I)gnore flag: a value of 0 indicates the protocol can't ignore this frame */
5253
public static final int FLAGS_I = 0b10_0000_0000;
54+
/** (M)etadata flag: a value of 1 indicates the frame contains metadata */
5355
public static final int FLAGS_M = 0b01_0000_0000;
5456

57+
/**
58+
* (F)ollows: More fragments follow this fragment (in case of fragmented REQUEST_x or PAYLOAD
59+
* frames)
60+
*/
5561
public static final int FLAGS_F = 0b00_1000_0000;
62+
/** (C)omplete: bit to indicate stream completion ({@link Subscriber#onComplete()}) */
5663
public static final int FLAGS_C = 0b00_0100_0000;
64+
/**
65+
* (N)ext: bit to indicate payload or metadata present ({@link Subscriber#onNext(Object)})
66+
*/
5767
public static final int FLAGS_N = 0b00_0010_0000;
5868

5969
static {

rsocket-core/src/main/java/io/rsocket/frame/KeepaliveFrameFlyweight.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
import io.rsocket.FrameType;
2020

2121
public class KeepaliveFrameFlyweight {
22+
/**
23+
* (R)espond: Set by the sender of the KEEPALIVE, to which the responder MUST reply with a
24+
* KEEPALIVE without the R flag set
25+
*/
2226
public static final int FLAGS_KEEPALIVE_R = 0b00_1000_0000;
2327

2428
private KeepaliveFrameFlyweight() {}

rsocket-core/src/main/java/io/rsocket/frame/SetupFrameFlyweight.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,20 @@
2525
public class SetupFrameFlyweight {
2626
private SetupFrameFlyweight() {}
2727

28+
/**
29+
* A flag used to indicate that the client requires connection resumption, if possible (the frame
30+
* contains a Resume Identification Token)
31+
*/
2832
public static final int FLAGS_RESUME_ENABLE = 0b00_1000_0000;
33+
/** A flag used to indicate that the client will honor LEASE sent by the server */
2934
public static final int FLAGS_WILL_HONOR_LEASE = 0b00_0100_0000;
35+
/**
36+
* (obsolete) flag indicating that the server should reject the SETUP if it finds anything
37+
* in the data or metadata that it doesn't understand
38+
*
39+
* @deprecated removed between protocol version 0.2 and 1.0RC
40+
*/
41+
@Deprecated
3042
public static final int FLAGS_STRICT_INTERPRETATION = 0b00_0010_0000;
3143

3244
public static final int VALID_FLAGS =

0 commit comments

Comments
 (0)