Class ConnectResponseMessage

java.lang.Object
com.iohao.net.framework.protocol.ServerMessage
com.iohao.net.framework.protocol.ConnectResponseMessage

public final class ConnectResponseMessage extends ServerMessage
Response message sent when a server successfully connects (joins) the cluster.

Created from a ServerMessage via the of(ServerMessage) factory method, copying all server metadata and adding the joining server's id and a future correlation id.

Since:
25.1
Author:
渔民小镇
date:
2025-09-25
  • Constructor Details

    • ConnectResponseMessage

      public ConnectResponseMessage()
  • Method Details

    • of

      public static ConnectResponseMessage of(ServerMessage message)
      Create a ConnectResponseMessage by copying metadata from the given server message.
      Parameters:
      message - the source server message whose metadata is copied
      Returns:
      a new ConnectResponseMessage populated with the source metadata
    • getFutureId

      public long getFutureId()
      Correlation id used to match this response to its originating connect request.
    • getJoinServerId

      public int getJoinServerId()
      Identifier of the server that has joined the cluster.
    • setFutureId

      public void setFutureId(long futureId)
      Correlation id used to match this response to its originating connect request.
    • setJoinServerId

      public void setJoinServerId(int joinServerId)
      Identifier of the server that has joined the cluster.
    • toString

      public String toString()
      Overrides:
      toString in class ServerMessage