if (action == null) {
success = true;
} else if (action.equals("createGroup")) {
// check if the group exists
Group g = groupManager.findGroupByName(group);
if (g != null) {
LOGGER.error("Cluster group " + group + " already exists");
success = false;
} else {
groupManager.createGroup(group);
success = true;
}
} else if (action.equals("deleteGroup")) {
Group g = groupManager.findGroupByName(group);
List<String> nodes = new ArrayList<String>();
if (g.getNodes() != null && !g.getNodes().isEmpty()) {
for (Node n : g.getNodes()) {
nodes.add(n.getId());
}
ManageGroupCommand command = new ManageGroupCommand(clusterManager.generateId());
command.setAction(ManageGroupAction.QUIT);
command.setGroupName(group);