| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2007-2008 Sun Microsystems, Inc. |
| | | * Copyright 2007-2009 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.server.tools.dsreplication; |
| | |
| | | import javax.naming.directory.SearchControls; |
| | | import javax.naming.directory.SearchResult; |
| | | import javax.naming.ldap.InitialLdapContext; |
| | | import javax.naming.ldap.LdapName; |
| | | import javax.net.ssl.TrustManager; |
| | | |
| | | import org.opends.admin.ads.ADSContext; |
| | | import org.opends.admin.ads.ADSContextException; |
| | | import org.opends.admin.ads.ADSContextHelper; |
| | | import org.opends.admin.ads.ReplicaDescriptor; |
| | | import org.opends.admin.ads.ServerDescriptor; |
| | | import org.opends.admin.ads.SuffixDescriptor; |
| | |
| | | import org.opends.admin.ads.TopologyCacheFilter; |
| | | import org.opends.admin.ads.ADSContext.ADSPropertySyntax; |
| | | import org.opends.admin.ads.ADSContext.AdministratorProperty; |
| | | import org.opends.admin.ads.ADSContext.ServerProperty; |
| | | import org.opends.admin.ads.util.ApplicationTrustManager; |
| | | import org.opends.admin.ads.util.ConnectionUtils; |
| | | import org.opends.admin.ads.util.PreferredConnection; |
| | |
| | | } |
| | | } |
| | | |
| | | boolean recreateServerKey = false ; |
| | | Object keyId = null ; |
| | | Object certValue = null ; |
| | | if (disableAllBaseDns) |
| | | { |
| | | // Unregister the server from the ADS |
| | | server.updateAdsPropertiesWithServerProperties(); |
| | | recreateServerKey = true ; |
| | | keyId = server.getAdsProperties(). |
| | | get(ADSContext.ServerProperty.INSTANCE_KEY_ID); |
| | | certValue = server.getAdsProperties(). |
| | | get(ADSContext.ServerProperty.INSTANCE_PUBLIC_KEY_CERTIFICATE); |
| | | try |
| | | { |
| | | adsCtx.unregisterServer(server.getAdsProperties()); |
| | |
| | | catch (Throwable t) |
| | | { |
| | | } |
| | | recreateServerKey = true ; |
| | | } |
| | | catch (ADSContextException adce) |
| | | { |
| | |
| | | } |
| | | } |
| | | } |
| | | if (recreateServerKey) |
| | | { |
| | | Map<ServerProperty, Object> serverProperties = |
| | | new HashMap<ServerProperty, Object>(); |
| | | serverProperties.put(ServerProperty.INSTANCE_KEY_ID, keyId); |
| | | serverProperties.put(ServerProperty.INSTANCE_PUBLIC_KEY_CERTIFICATE, |
| | | certValue); |
| | | LdapName ldapName = null ; |
| | | ADSContextHelper helper = new ADSContextHelper(); |
| | | try |
| | | { |
| | | helper.registerInstanceKeyCertificate( |
| | | adsCtx.getDirContext(),serverProperties,ldapName); |
| | | } |
| | | catch (ADSContextException e) |
| | | { |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | /** |