/** * Remove a {@link Node} from the target {@link Group}. * * @param targetGroupName the target group name where to remove the node. */ public void quitGroup(String targetGroupName) { Node node = clusterManager.getNode(); Map<String, Group> groups = groupManager.listGroups(); if (groups != null && !groups.isEmpty()) { Group targetGroup = groups.get(targetGroupName); if (targetGroup.getNodes().contains(node)) { targetGroup.getNodes().remove(node); groupManager.unRegisterGroup(targetGroup); } } }
/** * Remove a {@link Node} from the target {@link Group}. * * @param targetGroupName the target group name where to remove the node. */ public void quitGroup(String targetGroupName) { Node node = clusterManager.getNode(); Map<String, Group> groups = groupManager.listGroups(); if (groups != null && !groups.isEmpty()) { Group targetGroup = groups.get(targetGroupName); if (targetGroup.getNodes().contains(node)) { targetGroup.getNodes().remove(node); groupManager.unRegisterGroup(targetGroup); } } }