org.apache.cassandra.streaming.messages

## Class StreamMessage

- java.lang.Object
- - org.apache.cassandra.streaming.messages.StreamMessage

- Direct Known Subclasses:
    CompleteMessage, IncomingFileMessage, KeepAliveMessage, OutgoingFileMessage, PrepareMessage, ReceivedMessage, RetryMessage, SessionFailedMessage

      public abstract class StreamMessage
      extends java.lang.Object

  StreamMessage is an abstract base class that every messages in streaming protocol inherit. Every message carries message type(`StreamMessage.Type`) and streaming protocol version byte.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `StreamMessage.Serializer<V extends StreamMessage>` StreamMessage serializer
    `static class` | `StreamMessage.Type` StreamMessage types

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `CURRENT_VERSION`
    `StreamMessage.Type` | `type`
    `static int` | `VERSION_20` Streaming protocol version
    `static int` | `VERSION_22`
    `static int` | `VERSION_30`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `StreamMessage(StreamMessage.Type type)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static StreamMessage` | `deserialize(java.nio.channels.ReadableByteChannel in, int version, StreamSession session)`
    `int` | `getPriority()`
    `void` | `sent()`
    `static void` | `serialize(StreamMessage message, DataOutputStreamPlus out, int version, StreamSession session)`
    `boolean` | `wasSent()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### VERSION_20

          public static final int VERSION_20

      Streaming protocol version
      See Also:
        Constant Field Values

    - #### VERSION_22

          public static final int VERSION_22

      See Also:
        Constant Field Values

    - #### VERSION_30

          public static final int VERSION_30

      See Also:
        Constant Field Values

    - #### CURRENT_VERSION

          public static final int CURRENT_VERSION

      See Also:
        Constant Field Values

    - #### type

          public final StreamMessage.Type type

  - ### Constructor Detail

    - #### StreamMessage

          protected StreamMessage(StreamMessage.Type type)

  - ### Method Detail

    - #### serialize

          public static void serialize(StreamMessage message,
                                       DataOutputStreamPlus out,
                                       int version,
                                       StreamSession session)
                                throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### deserialize

          public static StreamMessage deserialize(java.nio.channels.ReadableByteChannel in,
                                                  int version,
                                                  StreamSession session)
                                           throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### sent

          public void sent()

    - #### wasSent

          public boolean wasSent()

    - #### getPriority

          public int getPriority()

      Returns:
        priority of this message. higher value, higher priority.

Copyright © 2018 The Apache Software Foundation