| | |
| | | import java.util.TimeZone; |
| | | |
| | | import org.opends.server.api.Backend; |
| | | 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) |
| | | { |
| | |
| | | // Get information about the backends defined in the server, and determine |
| | | // whether we are backing up multiple backends or a single backend. |
| | | 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); |
| | | int numBackends = backendList.size(); |
| | | |
| | | boolean multiple; |
| | | ArrayList<Backend> backendsToArchive = new ArrayList<Backend>(numBackends); |
| | | HashMap<String,ConfigEntry> configEntries = |
| | | new HashMap<String,ConfigEntry>(numBackends); |
| | | HashMap<String,BackendCfg> configEntries = |
| | | new HashMap<String,BackendCfg>(numBackends); |
| | | if (backUpAll.isPresent()) |
| | | { |
| | | for (int i=0; i < numBackends; i++) |
| | |
| | | |
| | | |
| | | // Get the config entry for this backend. |
| | | ConfigEntry configEntry = configEntries.get(b.getBackendID()); |
| | | BackendCfg configEntry = configEntries.get(b.getBackendID()); |
| | | |
| | | |
| | | // Get the path to the directory to use for this backup. If we will be |
| | |
| | | |
| | | // If the directory doesn't exist, then create it. If it does exist, then |
| | | // see if it has a backup descriptor file. |
| | | BackupDirectory backupDir = null; |
| | | BackupDirectory backupDir; |
| | | backupDirFile = new File(backupDirPath); |
| | | if (backupDirFile.exists()) |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | backupDir = new BackupDirectory(backupDirPath, configEntry.getDN()); |
| | | backupDir = new BackupDirectory(backupDirPath, configEntry.dn()); |
| | | } |
| | | } |
| | | else |
| | |
| | | continue; |
| | | } |
| | | |
| | | backupDir = new BackupDirectory(backupDirPath, configEntry.getDN()); |
| | | backupDir = new BackupDirectory(backupDirPath, configEntry.dn()); |
| | | } |
| | | |
| | | |
| | |
| | | // Perform the backup. |
| | | try |
| | | { |
| | | b.createBackup(configEntry, backupConfig); |
| | | b.createBackup(backupConfig); |
| | | } |
| | | catch (DirectoryException de) |
| | | { |