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
`static interface` `StreamMessage.Serializer<V extends StreamMessage>` StreamMessage serializer
`static class` `StreamMessage.Type` StreamMessage types

### Field Summary

Fields
`static int` `CURRENT_VERSION`
`StreamMessage.Type` `type`
`static int` `VERSION_20` Streaming protocol version
`static int` `VERSION_22`

### Constructor Summary

Constructors
`protected` `StreamMessage(StreamMessage.Type type)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static StreamMessage` `deserialize(java.nio.channels.ReadableByteChannel in, int version, StreamSession session)`
`int` `getPriority()`
`static void` `serialize(StreamMessage message, DataOutputStreamPlus 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

#### 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

#### 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`

#### getPriority

    public int getPriority()

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