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

Jean-Noël Rouvignac
25.23.2016 d0b900f0c9b7b90114c4de922ca273c77fc498c1
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/DeleteBaseDNAndBackendTask.java
@@ -426,7 +426,7 @@
  private void updateConfigEntryWithAttribute(DN entryDn, String attrName, List<DN> newBaseDNs)
      throws DirectoryException, ConfigException
  {
    ConfigurationHandler configHandler = DirectoryServer.getConfigurationHandler();
    ConfigurationHandler configHandler = DirectoryServer.getInstance().getServerContext().getConfigurationHandler();
    final Entry configEntry = configHandler.getEntry(entryDn);
    final Entry newEntry = LinkedHashMapEntry.deepCopyOfEntry(configEntry);
    AttributeType attrType = Schema.getDefaultSchema().getAttributeType(
@@ -470,7 +470,7 @@
  private void deleteBackend(BackendDescriptor backend) throws OpenDsException, ConfigException
  {
    DN dn = DN.valueOf("ds-cfg-backend-id" + "=" + backend.getBackendID() + ",cn=Backends,cn=config");
    Utilities.deleteConfigSubtree(DirectoryServer.getConfigurationHandler(), dn);
    Utilities.deleteConfigSubtree(DirectoryServer.getInstance().getServerContext().getConfigurationHandler(), dn);
  }
  /**
@@ -649,7 +649,7 @@
                {
                  domainName.set(dName);
                  DN entryDN = domain.dn();
                  Utilities.deleteConfigSubtree(DirectoryServer.getConfigurationHandler(), entryDN);
                  Utilities.deleteConfigSubtree(DirectoryServer.getInstance().getServerContext().getConfigurationHandler(), entryDN);
                  break;
                }
              }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/DeleteIndexTask.java
@@ -249,7 +249,7 @@
    {
      dn = "ds-cfg-attribute" + "=" + index.getName() + ",cn=Index," + backendId + ",cn=Backends,cn=config";
    }
    DirectoryServer.getConfigurationHandler().deleteEntry(DN.valueOf(dn));
    DirectoryServer.getInstance().getServerContext().getConfigurationHandler().deleteEntry(DN.valueOf(dn));
  }
  /**
opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/InstallerHelper.java
@@ -312,7 +312,7 @@
    {
      // Read the configuration file.
      DN dn = DN.valueOf("ds-cfg-backend-id" + "=" + backendName + ",cn=Backends,cn=config");
      Utilities.deleteConfigSubtree(DirectoryServer.getConfigurationHandler(), dn);
      Utilities.deleteConfigSubtree(DirectoryServer.getInstance().getServerContext().getConfigurationHandler(), dn);
    }
    catch (OpenDsException | ConfigException ode)
    {
opendj-server-legacy/src/main/java/org/opends/server/core/BackendConfigManager.java
@@ -130,7 +130,7 @@
         throws ConfigException, InitializationException
  {
    final ConfigurationBackend configBackend =
        new ConfigurationBackend(serverContext, DirectoryServer.getConfigurationHandler());
        new ConfigurationBackend(serverContext, DirectoryServer.getInstance().getServerContext().getConfigurationHandler());
    initializeBackend(configBackend, configBackend.getBackendCfg());
    // Register add and delete listeners.
opendj-server-legacy/src/main/java/org/opends/server/core/DirectoryServer.java
@@ -881,13 +881,13 @@
    @Override
    public String getInstanceRoot()
    {
      return DirectoryServer.getInstanceRoot();
      return directoryServer.environmentConfig.getInstanceRootAsString();
    }
    @Override
    public String getServerRoot()
    {
      return DirectoryServer.getServerRoot();
      return directoryServer.environmentConfig.getServerRootAsString();
    }
    @Override
@@ -903,6 +903,12 @@
    }
    @Override
    public ConfigurationHandler getConfigurationHandler()
    {
      return directoryServer.configurationHandler;
    }
    @Override
    public DirectoryEnvironmentConfig getEnvironment()
    {
      return directoryServer.environmentConfig;
@@ -1817,16 +1823,6 @@
    return directoryServer.operatingSystem;
  }
  /**
   * Retrieves a reference to the Directory Server configuration handler.
   *
   * @return  A reference to the Directory Server configuration handler.
   */
  public static ConfigurationHandler getConfigurationHandler()
  {
    return directoryServer.configurationHandler;
  }
  private void initializePlugins(Set<PluginType> pluginTypes)
         throws ConfigException, InitializationException
  {
@@ -1912,7 +1908,7 @@
  */
  public static String getServerRoot()
  {
    return directoryServer.environmentConfig.getServerRootAsString();
    return getInstance().getServerContext().getServerRoot();
  }
  /**
@@ -1924,7 +1920,7 @@
   */
  public static String getInstanceRoot()
  {
    return directoryServer.environmentConfig.getInstanceRootAsString();
    return getInstance().getServerContext().getInstanceRoot();
  }
  /**
opendj-server-legacy/src/main/java/org/opends/server/core/ServerContext.java
@@ -24,6 +24,7 @@
import org.forgerock.opendj.server.config.server.RootCfg;
import org.opends.server.api.KeyManagerProvider;
import org.opends.server.api.TrustManagerProvider;
import org.opends.server.config.ConfigurationHandler;
import org.opends.server.discovery.ServiceDiscoveryMechanismConfigManager;
import org.opends.server.extensions.DiskSpaceMonitor;
import org.opends.server.loggers.CommonAudit;
@@ -66,6 +67,13 @@
  SchemaHandler getSchemaHandler();
  /**
   * Returns the configuration handler, which provides operations to the configuration.
   *
   * @return the configuration handler
   */
  ConfigurationHandler getConfigurationHandler();
  /**
   * Returns the environment of the server.
   *
   * @return the environment
opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/LDAPReplicationDomain.java
@@ -3876,9 +3876,9 @@
    try
    {
      DN eclConfigEntryDN = DN.valueOf("cn=external changeLog," + config.dn());
      if (DirectoryServer.getConfigurationHandler().hasEntry(eclConfigEntryDN))
      if (DirectoryServer.getInstance().getServerContext().getConfigurationHandler().hasEntry(eclConfigEntryDN))
      {
        DirectoryServer.getConfigurationHandler().deleteEntry(eclConfigEntryDN);
        DirectoryServer.getInstance().getServerContext().getConfigurationHandler().deleteEntry(eclConfigEntryDN);
      }
    }
    catch(Exception e)
@@ -3903,7 +3903,7 @@
    try
    {
      DN configDn = config.dn();
      ConfigurationHandler configHandler = DirectoryServer.getConfigurationHandler();
      ConfigurationHandler configHandler = DirectoryServer.getInstance().getServerContext().getConfigurationHandler();
      if (configHandler.hasEntry(config.dn()))
      {
        try
opendj-server-legacy/src/main/java/org/opends/server/tasks/TaskUtils.java
@@ -103,7 +103,7 @@
    // backends.
    try
    {
      ConfigurationHandler configHandler = DirectoryServer.getConfigurationHandler();
      ConfigurationHandler configHandler = DirectoryServer.getInstance().getServerContext().getConfigurationHandler();
      for (DN childrenDn : configHandler.getChildren(backendBaseDN))
      {
        // Get the backend ID attribute from the entry.  If there isn't one, then
opendj-server-legacy/src/main/java/org/opends/server/tools/BackendToolUtils.java
@@ -67,7 +67,7 @@
    {
      // Iterate through the immediate children, attempting to parse them as backends.
      final RootCfg root = DirectoryServer.getInstance().getServerContext().getRootConfig();
      ConfigurationHandler configHandler = DirectoryServer.getConfigurationHandler();
      ConfigurationHandler configHandler = DirectoryServer.getInstance().getServerContext().getConfigurationHandler();
      final DN backendBaseDN = getBackendBaseDN();
      for (final DN childrenDn : configHandler.getChildren(backendBaseDN))
      {
opendj-server-legacy/src/main/java/org/opends/server/tools/ConfigureDS.java
@@ -300,7 +300,7 @@
      final DN rootDN = parseRootDN();
      final String rootPW = parseRootDNPassword();
      configHandler = DirectoryServer.getConfigurationHandler();
      configHandler = DirectoryServer.getInstance().getServerContext().getConfigurationHandler();
      checkManagerProvider(keyManagerProviderDN, JCKES_KEY_MANAGER_DN, JCKES_KEY_MANAGER_LDIF_ENTRY, true);
      checkManagerProvider(trustManagerProviderDN, JCKES_TRUST_MANAGER_DN, JCKES_TRUST_MANAGER_LDIF_ENTRY, false);
opendj-server-legacy/src/main/java/org/opends/server/tools/ListBackends.java
@@ -393,7 +393,7 @@
    // Iterate through the immediate children, attempting to parse them as backends.
    Map<String, Set<DN>> backendMap = new TreeMap<>();
    ConfigurationHandler configHandler = DirectoryServer.getConfigurationHandler();
    ConfigurationHandler configHandler = DirectoryServer.getInstance().getServerContext().getConfigurationHandler();
    for (DN childrenDn : configHandler.getChildren(backendBaseDN))
    {
      Entry configEntry = Converters.to(configHandler.getEntry(childrenDn));
opendj-server-legacy/src/test/java/org/opends/server/replication/GenerationIdTest.java
@@ -415,9 +415,9 @@
      Entry ecle = DirectoryServer.getEntry(DN.valueOf("cn=external changelog," + synchroServerStringDN));
      if (ecle!=null)
      {
        DirectoryServer.getConfigurationHandler().deleteEntry(ecle.getName());
        DirectoryServer.getInstance().getServerContext().getConfigurationHandler().deleteEntry(ecle.getName());
      }
      DirectoryServer.getConfigurationHandler().deleteEntry(synchroServerDN);
      DirectoryServer.getInstance().getServerContext().getConfigurationHandler().deleteEntry(synchroServerDN);
      assertNull(DirectoryServer.getEntry(synchroServerEntry.getName()),
        "Unable to delete the synchronized domain");
      synchroServerEntry = null;
opendj-server-legacy/src/test/java/org/opends/server/replication/ProtocolWindowTest.java
@@ -104,7 +104,7 @@
    // @formatter:on
    // Configure replication domain
    DirectoryServer.getConfigurationHandler().addEntry(Converters.from(repDomainEntry));
    DirectoryServer.getInstance().getServerContext().getConfigurationHandler().addEntry(Converters.from(repDomainEntry));
    assertNotNull(DirectoryServer.getEntry(repDomainEntry.getName()),
          "Unable to add the synchronized server");
    configEntriesToCleanup.add(repDomainEntry.getName());
opendj-server-legacy/src/test/java/org/opends/server/replication/ReplicationTestCase.java
@@ -457,7 +457,7 @@
  {
    if (configEntry != null)
    {
      DirectoryServer.getConfigurationHandler().addEntry(Converters.from(configEntry));
      DirectoryServer.getInstance().getServerContext().getConfigurationHandler().addEntry(Converters.from(configEntry));
      assertNotNull(DirectoryServer.getEntry(configEntry.getName()), errorMessage);
      configEntriesToCleanup.add(configEntry.getName());
    }
opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/AssuredReplicationPluginTest.java
@@ -247,7 +247,7 @@
    Entry domainCfgEntry = TestCaseUtils.entryFromLdifString(configEntryLdif);
    // Add the config entry to create the replicated domain
    DirectoryServer.getConfigurationHandler().addEntry(Converters.from(domainCfgEntry));
    DirectoryServer.getInstance().getServerContext().getConfigurationHandler().addEntry(Converters.from(domainCfgEntry));
    assertNotNull(DirectoryServer.getEntry(domainCfgEntry.getName()),
      "Unable to add the domain config entry: " + configEntryLdif);
@@ -278,7 +278,7 @@
    // @formatter:on
    // Add the config entry to create the replicated domain
    DirectoryServer.getConfigurationHandler().addEntry(Converters.from(domainCfgEntry));
    DirectoryServer.getInstance().getServerContext().getConfigurationHandler().addEntry(Converters.from(domainCfgEntry));
    assertNotNull(DirectoryServer.getEntry(domainCfgEntry.getName()),
      "Unable to add the domain config entry: " + domainCfgEntry);
opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/FractionalReplicationTest.java
@@ -505,7 +505,7 @@
      fractionalDomainCfgEntry = TestCaseUtils.entryFromLdifString(configEntryLdif);
      // Add the config entry to create the replicated domain
      DirectoryServer.getConfigurationHandler().addEntry(Converters.from(fractionalDomainCfgEntry));
      DirectoryServer.getInstance().getServerContext().getConfigurationHandler().addEntry(Converters.from(fractionalDomainCfgEntry));
      assertNotNull(DirectoryServer.getEntry(fractionalDomainCfgEntry.getName()),
        "Unable to add the domain config entry: " + configEntryLdif);
    }