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

lutoff
12.48.2007 6bd13ae6e0e4cea50b69c22526822de99bf4ac3f
Fix for issue #2207 (setup/ADS does not add registered server in group"ALL")
3 files modified
55 ■■■■■ changed files
opends/src/ads/org/opends/admin/ads/ADSContext.java 28 ●●●●● patch | view | raw | blame | history
opends/src/messages/messages/admin.properties 2 ●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/admin/client/cli/DsFrameworkCliServer.java 25 ●●●● patch | view | raw | blame | history
opends/src/ads/org/opends/admin/ads/ADSContext.java
@@ -426,6 +426,34 @@
      {
        registerInstanceKeyCertificate(serverProperties, dn);
      }
      // register this server into "all" groups
      HashMap<ServerGroupProperty, Object> serverGroupProperties =
        new HashMap<ServerGroupProperty, Object>();
      Set<String> memberList = getServerGroupMemberList(ALL_SERVERGROUP_NAME);
      if (memberList == null) {
        memberList = new HashSet<String>();
      }
      String newMember = "cn="
          + Rdn.escapeValue(serverProperties.get(ServerProperty.ID));
      memberList.add(newMember);
      serverGroupProperties.put(ServerGroupProperty.MEMBERS, memberList);
      updateServerGroup(ALL_SERVERGROUP_NAME, serverGroupProperties);
      // Update the server property "GROUPS"
      Set rawGroupList = (Set) serverProperties.get(ServerProperty.GROUPS);
      Set<String> groupList = new HashSet<String>();
      if (rawGroupList != null) {
        for (Object elm : rawGroupList.toArray()) {
          groupList.add(elm.toString());
        }
      }
      groupList.add(ALL_SERVERGROUP_NAME);
      serverProperties.put(ServerProperty.GROUPS, groupList);
    updateServer(serverProperties, null);
    }
    catch (ADSContextException ace)
    {
opends/src/messages/messages/admin.properties
@@ -150,7 +150,7 @@
INFO_ADMIN_ARG_MEMBERNAME_DESCRIPTION_55=The member's identifier. This is a \
 required argument
INFO_ADMIN_ARG_BACKENDNAME_DESCRIPTION_56=The name of the backend in which \
 the admin data will be stored. This is a required argument
 the admin data will be stored
SEVERE_ERR_ADMIN_UNABLE_TO_REGISTER_LISTENER_57=Unable to register an \
 add/delete listener against the entry "%s" because it does not exist in the \
 configuration
opends/src/server/org/opends/server/admin/client/cli/DsFrameworkCliServer.java
@@ -550,6 +550,27 @@
      serverProperties.put(prop, arg);
    }
   /**
    * The INSTANCE_KEY_ID used to identify the server key ID.
    */
    {
      ServerProperty prop = ServerProperty.INSTANCE_KEY_ID;
      String attName = prop.getAttributeName();
      StringArgument arg = new StringArgument(attName, null, prop
          .getAttributeName(), false, false, true, "", null, null, null);
      serverProperties.put(prop, arg);
    }
    /**
     * The INSTANCE_PUBLIC_KEY_CERTIFICATE associated to the server.
     */
    {
      ServerProperty prop = ServerProperty.INSTANCE_PUBLIC_KEY_CERTIFICATE;
      String attName = prop.getAttributeName();
      StringArgument arg = new StringArgument(attName, null, prop
          .getAttributeName(), false, false, true, "", null, null, null);
      serverProperties.put(prop, arg);
    }
  }
  /**
@@ -600,9 +621,7 @@
        adsCtx = new ADSContext(ctx);
        adsCtx.registerServer(map);
        // Add this server in the default "all-servers" group.
        returnCode = DsFrameworkCliServerGroup.addServerTogroup(adsCtx,
            ADSContext.ALL_SERVERGROUP_NAME, map);
        returnCode = SUCCESSFUL;
      }
      else
      // -----------------------