org.apache.ignite.spi.communication.tcp.messages

## Class HandshakeMessage

- java.lang.Object
- - org.apache.ignite.spi.communication.tcp.messages.HandshakeMessage

- All Implemented Interfaces:
    Serializable, Message
  Direct Known Subclasses:
    HandshakeMessage2

      public class HandshakeMessage
      extends Object
      implements Message

  Handshake message.
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `MESSAGE_FULL_SIZE` Full message size (with message type) in bytes.

    - ### Fields inherited from interface org.apache.ignite.plugin.extensions.communication.Message

      `DIRECT_TYPE_SIZE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HandshakeMessage()` Default constructor required by `Message`.
    `HandshakeMessage(UUID nodeId, long connectCnt, long rcvCnt)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `connectCount()`
    `int` | `connectionIndex()`
    `short` | `directType()` Gets message type.
    `byte` | `fieldsCount()` Gets fields count.
    `int` | `getMessageSize()`
    `UUID` | `nodeId()`
    `void` | `onAckReceived()` Method called when ack message received.
    `boolean` | `readFrom(ByteBuffer buf, MessageReader reader)` Reads this message from provided byte buffer.
    `long` | `received()`
    `String` | `toString()`
    `boolean` | `writeTo(ByteBuffer buf, MessageWriter writer)` Writes this message to provided byte buffer.

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

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

- - ### Field Detail

    - #### MESSAGE_FULL_SIZE

          public static final int MESSAGE_FULL_SIZE

      Full message size (with message type) in bytes.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### HandshakeMessage

          public HandshakeMessage()

      Default constructor required by `Message`.

    - #### HandshakeMessage

          public HandshakeMessage(UUID nodeId,
                                  long connectCnt,
                                  long rcvCnt)

      Parameters:
        `nodeId` - Node ID.
        `connectCnt` - Connect count.
        `rcvCnt` - Number of received messages.

  - ### Method Detail

    - #### connectionIndex

          public int connectionIndex()

      Returns:
        Connection index.

    - #### connectCount

          public long connectCount()

      Returns:
        Connect count.

    - #### received

          public long received()

      Returns:
        Number of received messages.

    - #### nodeId

          public UUID nodeId()

      Returns:
        Node ID.

    - #### getMessageSize

          public int getMessageSize()

      Returns:
        Message size in bytes.

    - #### onAckReceived

          public void onAckReceived()

      Method called when ack message received.
      Specified by:
        `onAckReceived` in interface `Message`

    - #### writeTo

          public boolean writeTo(ByteBuffer buf,
                                 MessageWriter writer)

      Writes this message to provided byte buffer.
      Specified by:
        `writeTo` in interface `Message`
      Parameters:
        `buf` - Byte buffer.
        `writer` - Writer.
      Returns:
        Whether message was fully written.

    - #### readFrom

          public boolean readFrom(ByteBuffer buf,
                                  MessageReader reader)

      Reads this message from provided byte buffer.
      Specified by:
        `readFrom` in interface `Message`
      Parameters:
        `buf` - Byte buffer.
        `reader` - Reader.
      Returns:
        Whether message was fully read.

    - #### directType

          public short directType()

      Gets message type.
      Specified by:
        `directType` in interface `Message`
      Returns:
        Message type.

    - #### fieldsCount

          public byte fieldsCount()

      Gets fields count.
      Specified by:
        `fieldsCount` in interface `Message`
      Returns:
        Fields count.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

2021 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.11.0
Release Date | : September 11 2021