| | |
| | | private Map<ServerProperty, Object> serverProperties = |
| | | new HashMap<ServerProperty, Object>(); |
| | | private TopologyCacheException lastException; |
| | | |
| | | /** |
| | | * Enumeration containing the different server properties that we can keep in |
| | | * the ServerProperty object. |
| | |
| | | * The instance key-pair public-key certificate. The associated value is a |
| | | * byte[] (ds-cfg-public-key-certificate;binary). |
| | | */ |
| | | INSTANCE_PUBLIC_KEY_CERTIFICATE |
| | | INSTANCE_PUBLIC_KEY_CERTIFICATE, |
| | | /** |
| | | * The schema generation ID. |
| | | */ |
| | | SCHEMA_GENERATION_ID |
| | | } |
| | | |
| | | private ServerDescriptor() |
| | |
| | | } |
| | | |
| | | /** |
| | | * Returns the schema generation ID of the server. |
| | | * @return the schema generation ID of the server. |
| | | */ |
| | | public String getSchemaReplicationID() |
| | | { |
| | | return (String)serverProperties.get(ServerProperty.SCHEMA_GENERATION_ID); |
| | | } |
| | | |
| | | /** |
| | | * Returns the last exception that was encountered reading the configuration |
| | | * of the server. Returns null if there was no problem loading the |
| | | * configuration of the server. |
| | |
| | | updateReplicas(desc, ctx); |
| | | updateReplication(desc, ctx); |
| | | updatePublicKeyCertificate(desc, ctx); |
| | | updateMiscellaneous(desc, ctx); |
| | | |
| | | desc.serverProperties.put(ServerProperty.HOST_NAME, |
| | | ConnectionUtils.getHostName(ctx)); |
| | |
| | | } |
| | | } |
| | | |
| | | private static void updateMiscellaneous(ServerDescriptor desc, |
| | | InitialLdapContext ctx) throws NamingException |
| | | { |
| | | SearchControls ctls = new SearchControls(); |
| | | ctls.setSearchScope(SearchControls.OBJECT_SCOPE); |
| | | ctls.setReturningAttributes( |
| | | new String[] { |
| | | "ds-sync-generation-id" |
| | | }); |
| | | String filter = "|(objectclass=*)(objectclass=ldapsubentry)"; |
| | | |
| | | LdapName jndiName = new LdapName("cn=schema"); |
| | | NamingEnumeration listeners = ctx.search(jndiName, filter, ctls); |
| | | |
| | | while(listeners.hasMore()) |
| | | { |
| | | SearchResult sr = (SearchResult)listeners.next(); |
| | | |
| | | desc.serverProperties.put(ServerProperty.SCHEMA_GENERATION_ID, |
| | | getFirstValue(sr, "ds-sync-generation-id")); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | Seeds the bound instance's local ads-truststore with a set of instance |
| | | key-pair public key certificates. The result is the instance will trust any |