| | |
| | | filter.addBaseDNsToSearch(uData.getBaseDNs()); |
| | | } |
| | | ServerDescriptor server = createStandalone(conn, filter); |
| | | Set<DN> suffixesToDisable = uData.disableAll() |
| | | ? getConfiguredReplicationBaseDNs(conn) |
| | | : new HashSet<>(uData.getBaseDNs()); |
| | | |
| | | ADSContext adsCtx = new ADSContext(conn); |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | Set<DN> suffixesToDisable; |
| | | if (uData.disableAll()) |
| | | if (!uData.disableAll()) |
| | | { |
| | | suffixesToDisable = findAllReplicatedSuffixDNs(server.getReplicas()); |
| | | } |
| | | else |
| | | { |
| | | suffixesToDisable = new HashSet<>(uData.getBaseDNs()); |
| | | |
| | | if (disableAllBaseDns && |
| | | (disableReplicationServer || !server.isReplicationServer())) |
| | | { |
| | |
| | | } |
| | | |
| | | /** |
| | | * Reads configured domains directly: a domain base DN can be below a backend's base DN |
| | | * and will not appear in the server descriptor's replicas. |
| | | */ |
| | | private Set<DN> getConfiguredReplicationBaseDNs(ConnectionWrapper conn) throws ReplicationCliException |
| | | { |
| | | try |
| | | { |
| | | final ReplicationSynchronizationProviderCfgClient sync; |
| | | try |
| | | { |
| | | sync = getMultimasterSynchronization(conn); |
| | | } |
| | | catch (ManagedObjectNotFoundException e) |
| | | { |
| | | return Collections.emptySet(); |
| | | } |
| | | |
| | | final Set<DN> baseDNs = new LinkedHashSet<>(); |
| | | final String[] domainNames = sync.listReplicationDomains(); |
| | | if (domainNames != null) |
| | | { |
| | | for (String domainName : domainNames) |
| | | { |
| | | baseDNs.add(sync.getReplicationDomain(domainName).getBaseDN()); |
| | | } |
| | | } |
| | | return baseDNs; |
| | | } |
| | | catch (OperationsException | LdapException e) |
| | | { |
| | | throw new ReplicationCliException( |
| | | ERR_REPLICATION_ERROR_READING_CONFIGURATION.get(conn.getHostPort(), e.getMessage()), |
| | | ERROR_READING_CONFIGURATION, e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Deletes a replication domain in a server for a given base DN (disable |
| | | * replication of the base DN). |
| | | * @param conn the connection to the server. |