StreamMessage (apache-cassandra API)
Date: 2014-10-21

org.apache.cassandra.streaming.messages

## Class StreamMessage

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

- Direct Known Subclasses:
    CompleteMessage, IncomingFileMessage, 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` Streaming protocol version
    `StreamMessage.Type` | `type`

  - ### Constructor Summary

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

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static StreamMessage` | `deserialize(java.nio.channels.ReadableByteChannel in, int version, StreamSession session)`
    `int` | `getPriority()`
    `static void` | `serialize(StreamMessage message, DataOutputStreamAndChannel out, int version, StreamSession session)`

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

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

- - ### Field Detail

    - #### CURRENT_VERSION

          public static final int CURRENT_VERSION

      Streaming protocol 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,
                       DataOutputStreamAndChannel 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`

    - #### getPriority

          public int getPriority()

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

Copyright © 2014 The Apache Software Foundation