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

Gaetan Boismal
22.24.2015 83e546caf028133b97f01534b9fab108bd44910b
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/NewBaseDNPanel.java
@@ -110,6 +110,7 @@
import org.opends.server.tools.makeldif.MakeLDIF;
import org.opends.server.types.DN;
import org.opends.server.types.OpenDsException;
import org.opends.server.util.RemoveOnceNewConfigFrameworkIsUsed;
import org.opends.server.util.SetupUtils;
import com.forgerock.opendj.cli.CommandBuilder;
@@ -968,16 +969,7 @@
        return;
      }
      //FIXME GB This could be replaced by a call to BackendCreationHelper.createBackend(...)
      // once the new configuration framework migration will be done
      final RootCfgClient root = getRootConfigurationClient();
      final BackendCfgClient backend =
          root.createBackend(getSelectedBackendType().getLegacyConfigurationFrameworkBackend(), backendName, null);
      backend.setEnabled(true);
      backend.setBaseDN(Collections.singleton(DN.valueOf(newBaseDN)));
      backend.setBackendId(backendName);
      backend.setWritabilityMode(BackendCfgDefn.WritabilityMode.ENABLED);
      backend.commit();
      createBackendOnline(backendName);
    }
    private void createBackendOffline(String backendName) throws OpenDsException
@@ -993,6 +985,19 @@
      }
    }
    @RemoveOnceNewConfigFrameworkIsUsed("Use BackendCreationHelper.createBackend(...)")
    private void createBackendOnline(String backendName) throws OpenDsException
    {
      final RootCfgClient root = getRootConfigurationClient();
      final BackendCfgClient backend =
          root.createBackend(getSelectedBackendType().getLegacyConfigurationFrameworkBackend(), backendName, null);
      backend.setEnabled(true);
      backend.setBaseDN(Collections.singleton(DN.valueOf(newBaseDN)));
      backend.setBackendId(backendName);
      backend.setWritabilityMode(BackendCfgDefn.WritabilityMode.ENABLED);
      backend.commit();
    }
    private RootCfgClient getRootConfigurationClient()
    {
      final JNDIDirContextAdaptor jndiContext = JNDIDirContextAdaptor.adapt(getInfo().getDirContext());