| | |
| | | |
| | | import org.opends.server.api.Backend; |
| | | import org.opends.server.api.plugin.PluginType; |
| | | import org.opends.server.config.ConfigEntry; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.core.CoreConfigManager; |
| | | import org.opends.server.core.DirectoryServer; |
| | |
| | | import static org.opends.server.util.StaticUtils.*; |
| | | import org.opends.server.util.StaticUtils; |
| | | import static org.opends.server.tools.ToolConstants.*; |
| | | |
| | | import org.opends.server.admin.std.server.BackendCfg; |
| | | |
| | | |
| | | /** |
| | |
| | | { |
| | | try |
| | | { |
| | | directoryServer.bootstrapClient(); |
| | | directoryServer.initializeJMX(); |
| | | DirectoryServer.bootstrapClient(); |
| | | DirectoryServer.initializeJMX(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | // and also finding backends with subordinate base DNs that should be |
| | | // excluded from the export. |
| | | Backend backend = null; |
| | | ConfigEntry configEntry = null; |
| | | List<DN> baseDNList = null; |
| | | List<DN> defaultIncludeBranches = null; |
| | | ArrayList<DN> excludeBranches = null; |
| | | |
| | | ArrayList<Backend> backendList = new ArrayList<Backend>(); |
| | | ArrayList<ConfigEntry> entryList = new ArrayList<ConfigEntry>(); |
| | | ArrayList<BackendCfg> entryList = new ArrayList<BackendCfg>(); |
| | | ArrayList<List<DN>> dnList = new ArrayList<List<DN>>(); |
| | | BackendToolUtils.getBackends(backendList, entryList, dnList); |
| | | |
| | |
| | | if (backend == null) |
| | | { |
| | | backend = b; |
| | | configEntry = entryList.get(i); |
| | | baseDNList = dnList.get(i); |
| | | defaultIncludeBranches = dnList.get(i); |
| | | } |
| | |
| | | excludeBranches = new ArrayList<DN>(); |
| | | for (String s : excludeBranchStrings.getValues()) |
| | | { |
| | | DN excludeBranch = null; |
| | | DN excludeBranch; |
| | | try |
| | | { |
| | | excludeBranch = DN.decode(s); |
| | |
| | | includeBranches = new ArrayList<DN>(); |
| | | for (String s : includeBranchStrings.getValues()) |
| | | { |
| | | DN includeBranch = null; |
| | | DN includeBranch; |
| | | try |
| | | { |
| | | includeBranch = DN.decode(s); |
| | |
| | | // Launch the export. |
| | | try |
| | | { |
| | | backend.exportLDIF(configEntry, baseDNs, exportConfig); |
| | | backend.exportLDIF(exportConfig); |
| | | } |
| | | catch (DirectoryException de) |
| | | { |