| | |
| | | for (TreePath path : paths) |
| | | { |
| | | BasicNode node = (BasicNode)path.getLastPathComponent(); |
| | | entries.add(DN.valueOf(node.getDN())); |
| | | entries.add(node.getDN()); |
| | | } |
| | | for (BackendDescriptor backend : info.getServerDescriptor().getBackends()) |
| | | { |
| | |
| | | for (TreePath path : paths) |
| | | { |
| | | BasicNode node = (BasicNode)path.getLastPathComponent(); |
| | | try |
| | | DN dn = node.getDN(); |
| | | if (!isAlreadyDeleted(alreadyDeleted, dn)) |
| | | { |
| | | DN dn = DN.valueOf(node.getDN()); |
| | | boolean isDnDeleted = false; |
| | | for (DN deletedDn : alreadyDeleted) |
| | | ConnectionWrapper conn = controller.findConnectionForDisplayedEntry(node); |
| | | useAdminCtx = controller.isConfigurationNode(node); |
| | | if (node.hasSubOrdinates()) |
| | | { |
| | | if (dn.isSubordinateOrEqualTo(deletedDn)) |
| | | { |
| | | isDnDeleted = true; |
| | | break; |
| | | } |
| | | deleteSubtreeWithControl(conn, dn, path, toNotify); |
| | | } |
| | | if (!isDnDeleted) |
| | | else |
| | | { |
| | | ConnectionWrapper conn = controller.findConnectionForDisplayedEntry(node); |
| | | useAdminCtx = controller.isConfigurationNode(node); |
| | | if (node.hasSubOrdinates()) |
| | | { |
| | | deleteSubtreeWithControl(conn, dn, path, toNotify); |
| | | } |
| | | else |
| | | { |
| | | deleteSubtreeRecursively(conn, dn, path, toNotify); |
| | | } |
| | | alreadyDeleted.add(dn); |
| | | deleteSubtreeRecursively(conn, dn, path, toNotify); |
| | | } |
| | | } |
| | | catch (DirectoryException de) |
| | | { |
| | | throw new RuntimeException("Unexpected error parsing dn: "+ |
| | | node.getDN(), de); |
| | | alreadyDeleted.add(dn); |
| | | } |
| | | } |
| | | if (!toNotify.isEmpty()) |
| | |
| | | } |
| | | } |
| | | |
| | | private boolean isAlreadyDeleted(ArrayList<DN> dns, DN dnToFind) |
| | | { |
| | | for (DN dn : dns) |
| | | { |
| | | if (dnToFind.isSubordinateOrEqualTo(dn)) |
| | | { |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * Notifies that some entries have been deleted. This will basically update |
| | | * the browser controller so that the tree reflects the changes that have |