Fix for issue #2207 (setup/ADS does not add registered server in group"ALL")
| | |
| | | { |
| | | 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) |
| | | { |
| | |
| | | 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 |
| | |
| | | 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); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | 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 |
| | | // ----------------------- |