| | |
| | | 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; |
| | |
| | | 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 |
| | |
| | | } |
| | | } |
| | | |
| | | @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()); |