private void processClientReconnectMessage(TcpDiscoveryClientReconnectMessage msg){
  UUID nodeId=msg.creatorNodeId();
  UUID locNodeId=getLocalNodeId();
  boolean isLocNodeRouter=locNodeId.equals(msg.routerNodeId());
  if (!msg.verified()) {
    TcpDiscoveryNode node=ring.node(nodeId);
    assert node == null || node.isClient();
    if (node != null) {
      node.clientRouterNodeId(msg.routerNodeId());
      node.aliveCheck(spi.maxMissedClientHbs);
    }
    if (isLocalNodeCoordinator()) {
      msg.verify(locNodeId);
      if (node != null) {
        Collection<TcpDiscoveryAbstractMessage> pending=msgHist.messages(msg.lastMessageId(),node);
        if (pending != null) {
          msg.pendingMessages(pending);
          msg.success(true);
          if (log.isDebugEnabled())           log.debug("Accept client reconnect, restored pending messages " + "[locNodeId=" + locNodeId + ", clientNodeId="+ nodeId+ ']');
        }
 else {
          if (log.isDebugEnabled())           log.debug("Failing reconnecting client node because failed to restore pending " + "messages [locNodeId=" + locNodeId + ", clientNodeId="+ nodeId+ ']');
          TcpDiscoveryNodeFailedMessage nodeFailedMsg=new TcpDiscoveryNodeFailedMessage(locNodeId,node.id(),node.internalOrder());
          processNodeFailedMessage(nodeFailedMsg);
          if (nodeFailedMsg.verified())           msgHist.add(nodeFailedMsg);
        }
      }
 else       if (log.isDebugEnabled())       log.debug("Reconnecting client node is already failed [nodeId=" + nodeId + ']');
      if (isLocNodeRouter) {
        ClientMessageWorker wrk=clientMsgWorkers.get(nodeId);
        if (wrk != null)         wrk.addMessage(msg);
 else         if (log.isDebugEnabled())         log.debug("Failed to reconnect client node (disconnected during the process) [locNodeId=" + locNodeId + ", clientNodeId="+ nodeId+ ']');
      }
 else {
        if (sendMessageToRemotes(msg))         sendMessageAcrossRing(msg);
      }
    }
 else {
      if (sendMessageToRemotes(msg))       sendMessageAcrossRing(msg);
    }
  }
 else {
    if (isLocalNodeCoordinator())     addMessage(new TcpDiscoveryDiscardMessage(locNodeId,msg.id(),false));
    if (isLocNodeRouter) {
      ClientMessageWorker wrk=clientMsgWorkers.get(nodeId);
      if (wrk != null)       wrk.addMessage(msg);
 else       if (log.isDebugEnabled())       log.debug("Failed to reconnect client node (disconnected during the process) [locNodeId=" + locNodeId + ", clientNodeId="+ nodeId+ ']');
    }
 else {
      if (ring.hasRemoteNodes() && !isLocalNodeCoordinator())       sendMessageAcrossRing(msg);
    }
  }
}

private void processClientReconnectMessage ( TcpDiscoveryClientReconnectMessage msg ) { UUID nodeId = msg . creatorNodeId ( ) ; UUID locNodeId = getLocalNodeId ( ) ; boolean isLocNodeRouter = locNodeId . equals ( msg . routerNodeId ( ) ) ; if ( ! msg . verified ( ) ) { TcpDiscoveryNode node = ring . node ( nodeId ) ; assert node == null || node . isClient ( ) ; if ( node != null ) { node . clientRouterNodeId ( msg . routerNodeId ( ) ) ; node . aliveCheck ( spi . maxMissedClientHbs ) ; } if ( isLocalNodeCoordinator ( ) ) { msg . verify ( locNodeId ) ; if ( node != null ) { Collection < TcpDiscoveryAbstractMessage > pending = msgHist . messages ( msg . lastMessageId ( ) , node ) ; if ( pending != null ) { msg . pendingMessages ( pending ) ; msg . success ( true ) ; if ( log . isDebugEnabled ( ) ) log . debug ( "Accept client reconnect, restored pending messages " + "[locNodeId=" + locNodeId + ", clientNodeId=" + nodeId + ']' ) ; } else { if ( log . isDebugEnabled ( ) ) log . debug ( "Failing reconnecting client node because failed to restore pending " + "messages [locNodeId=" + locNodeId + ", clientNodeId=" + nodeId + ']' ) ; TcpDiscoveryNodeFailedMessage nodeFailedMsg = new TcpDiscoveryNodeFailedMessage ( locNodeId , node . id ( ) , node . internalOrder ( ) ) ; processNodeFailedMessage ( nodeFailedMsg ) ; if ( nodeFailedMsg . verified ( ) ) msgHist . add ( nodeFailedMsg ) ; } } else if ( log . isDebugEnabled ( ) ) log . debug ( "Reconnecting client node is already failed [nodeId=" + nodeId + ']' ) ; if ( isLocNodeRouter ) { ClientMessageWorker wrk = clientMsgWorkers . get ( nodeId ) ; if ( wrk != null ) wrk . addMessage ( msg ) ; else if ( log . isDebugEnabled ( ) ) log . debug ( "Failed to reconnect client node (disconnected during the process) [locNodeId=" + locNodeId + ", clientNodeId=" + nodeId + ']' ) ; } else { if ( sendMessageToRemotes ( msg ) ) sendMessageAcrossRing ( msg ) ; } } else { if ( sendMessageToRemotes ( msg ) ) sendMessageAcrossRing ( msg ) ; } } else { if ( isLocalNodeCoordinator ( ) ) addMessage ( new TcpDiscoveryDiscardMessage ( locNodeId , msg . id ( ) , false ) ) ; if ( isLocNodeRouter ) { ClientMessageWorker wrk = clientMsgWorkers . get ( nodeId ) ; if ( wrk != null ) wrk . addMessage ( msg ) ; else if ( log . isDebugEnabled ( ) ) log . debug ( "Failed to reconnect client node (disconnected during the process) [locNodeId=" + locNodeId + ", clientNodeId=" + nodeId + ']' ) ; } else { if ( ring . hasRemoteNodes ( ) && ! isLocalNodeCoordinator ( ) ) sendMessageAcrossRing ( msg ) ; } } }
processes client reconnect message .
