private void enablePartition() {
   if ("LEADER".equals(getNodeStatus())) {
     return;
   }
   participantManager
       .getClusterManagmentTool()
       .enablePartition(
           true, clusterName, instanceName, resourceName, asList(resourceName + "_0"));
   while (!"LEADER".equals(getNodeStatus())) {
     try {
       Thread.sleep(10);
     } catch (InterruptedException e) {
     }
   }
 }
  private void disablePartition() {
    String nodeStatus = getNodeStatus();
    if ("STANDBY".equals(nodeStatus) || "OFFLINE".equals(nodeStatus)) {
      return;
    }
    participantManager
        .getClusterManagmentTool()
        .enablePartition(
            false, clusterName, instanceName, resourceName, asList(resourceName + "_0"));

    while (!("STANDBY".equals(nodeStatus) || "OFFLINE".equals(nodeStatus))) {
      try {
        Thread.sleep(10);
        nodeStatus = getNodeStatus();
      } catch (InterruptedException e) {
      }
    }
  }