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

jvergara
26.16.2007 59b4905a66a5db370e6d0de5f7cb6dcd314ef443
opends/src/ads/org/opends/admin/ads/TopologyCache.java
@@ -36,12 +36,11 @@
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.naming.Context;
import javax.naming.NamingException;
import javax.naming.ldap.LdapName;
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.ServerLoader;
/**
@@ -72,27 +71,14 @@
   * @param trustManager the ApplicationTrustManager that must be used to trust
   * certificates when we create connections to the registered servers to read
   * their configuration.
   * @throws TopologyCacheException if an error occurred reading the
   * authentication data in the DirContext associated with the provided
   * ADSContext.
   */
  public TopologyCache(ADSContext adsContext,
      ApplicationTrustManager trustManager)
  throws TopologyCacheException
  {
    this.adsContext = adsContext;
    this.trustManager = trustManager;
    try
    {
      dn = (String)adsContext.getDirContext().getEnvironment().get(
          Context.SECURITY_PRINCIPAL);
      pwd = (String)adsContext.getDirContext().getEnvironment().get(
          Context.SECURITY_CREDENTIALS);
    }
    catch (NamingException ne)
    {
      throw new TopologyCacheException(TopologyCacheException.Type.BUG, ne);
    }
    dn = ConnectionUtils.getBindDN(adsContext.getDirContext());
    pwd = ConnectionUtils.getBindPassword(adsContext.getDirContext());
  }
  /**
@@ -256,4 +242,13 @@
    return new ServerLoader(serverProperties, dn, pwd,
        trustManager.createCopy());
  }
  /**
   * Returns the adsContext used by this TopologyCache.
   * @return the adsContext used by this TopologyCache.
   */
  public ADSContext getAdsContext()
  {
    return adsContext;
  }
}