mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

jvergara
20.21.2009 1d3ae65977091b65934337d186de02247edcd0a6
Fix for issue 4064 (references to old replication server exist after dsreplication disable)
Remove the references to the different server groups in the server that is being unregistered.
1 files modified
23 ■■■■■ changed files
opends/src/ads/org/opends/admin/ads/ADSContext.java 23 ●●●●● patch | view | raw | blame | history
opends/src/ads/org/opends/admin/ads/ADSContext.java
@@ -557,6 +557,29 @@
      {
        unregisterInstanceKeyCertificate(serverProperties, dn);
      }
      // Unregister the server from the server groups.
      String member = "cn="
        + Rdn.escapeValue(serverProperties.get(ServerProperty.ID));
      Set<Map<ServerGroupProperty, Object>> serverGroups =
        readServerGroupRegistry();
      for (Map<ServerGroupProperty, Object> serverGroup : serverGroups)
      {
        Set<?> memberList =
          (Set<?>)serverGroup.get(ServerGroupProperty.MEMBERS);
        if (memberList != null)
        {
          if (memberList.remove(member))
          {
            HashMap<ServerGroupProperty, Object> serverGroupProperties =
              new HashMap<ServerGroupProperty, Object>();
            serverGroupProperties.put(ServerGroupProperty.MEMBERS, memberList);
            String groupName = (String)serverGroup.get(ServerGroupProperty.UID);
            updateServerGroup(groupName, serverGroupProperties);
          }
        }
      }
      dirContext.destroySubcontext(dn);
    }
    catch (NameNotFoundException x)