private void doUpdateDomain(HttpServletRequest req, HttpServletResponse resp) throws IOException { final String domainName = req.getParameter("name"); final String storageEngineOptions = req.getParameter("storageEngineOptions"); final Domain domain = coordinator.getDomain(domainName); if (domain == null) { throw new IOException("Could not get Domain '" + domainName + "' from Configurator."); } else { coordinator.updateDomain( domainName, domain.getNumParts(), domain.getStorageEngineFactoryClass().getName(), storageEngineOptions, domain.getPartitioner().getClass().getName()); } resp.sendRedirect("/domains.jsp"); }
private void doDeleteDomain(HttpServletRequest req, HttpServletResponse resp) throws IOException { final Domain domain = coordinator.getDomain(req.getParameter("name")); boolean isInUse = false; // check if this domain is in use anywhere for (RingGroup rg : coordinator.getRingGroups()) { if (rg.getTargetVersion() == null) { continue; } DomainGroup dg = rg.getDomainGroup(); DomainGroupVersion dgv = rg.getTargetVersion(); if (DomainGroupVersions.containsDomain(dgv, domain)) { isInUse = true; break; } } if (!isInUse) { coordinator.deleteDomain(domain.getName()); } resp.sendRedirect("/domains.jsp"); }