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

jvergara
20.21.2009 1d3ae65977091b65934337d186de02247edcd0a6
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)