@Override public void create(String name) throws Exception { // check if the group exists Group group = groupManager.findGroupByName(name); if (group != null) { throw new IllegalArgumentException("Cluster group " + name + " already exists"); } groupManager.createGroup(name); }
@Override public void create(String name) throws Exception { // check if the group exists Group group = groupManager.findGroupByName(name); if (group != null) { throw new IllegalArgumentException("Cluster group " + name + " already exists"); } groupManager.createGroup(name); }
@Override protected Object doExecute() throws Exception { // check if the group exists Group group = groupManager.findGroupByName(groupName); if (group != null) { System.err.println("Cluster group " + groupName + " already exists"); return null; } groupManager.createGroup(groupName); return null; }
@Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { boolean success = false; final String action = req.getParameter("action"); final String node = req.getParameter("node"); final String group = req.getParameter("group"); final String id = req.getParameter("id"); if (action == null) { success = true; } else if (action.equals("createGroup")) { groupManager.createGroup(group); success = true; } else if (action.equals("deleteGroup")) { groupManager.deleteGroup(group); success = true; } if (success) { // let's wait a little bit to give the framework time // to process our request try { Thread.sleep(800); } catch (InterruptedException e) { // ignore } this.renderJSON(resp, null); } else { super.doPost(req, resp); } }
if (setupConfigOk && group == null) { logger.error("Cluster group " + karafCellarGroupName + " doesn't exist, creating it..."); group = karafCellarGroupManager.createGroup(karafCellarGroupName); if (group != null) { setupConfigOk = true;
if (setupConfigOk && group == null) { logger.error("Cluster group " + karafCellarGroupName + " doesn't exist, creating it..."); group = karafCellarGroupManager.createGroup(karafCellarGroupName); if (group != null) { setupConfigOk = true;