this.startTime = Calendar.getInstance();
this.repositoryBackupId = repositoryBackupId;
List<String> wsLogFilePathList = new ArrayList<String>();
RepositoryEntry repository;
try
{
repository = repositoryService.getConfig().getRepositoryConfiguration(config.getRepository());
}
catch (RepositoryConfigurationException e)
{
throw new BackupOperationException("Can not get repository \"" + config.getRepository() + "\"", e);
}
for (WorkspaceEntry workspaceEntry : repository.getWorkspaceEntries())
{
BackupConfig wsBackupConfig = new BackupConfig();
wsBackupConfig.setRepository(config.getRepository());
wsBackupConfig.setWorkspace(workspaceEntry.getName());
wsBackupConfig.setBackupType(config.getBackupType());
wsBackupConfig.setIncrementalJobNumber(config.getIncrementalJobNumber());
wsBackupConfig.setIncrementalJobPeriod(config.getIncrementalJobPeriod());
Calendar startTime = Calendar.getInstance();
File dir =
FileNameProducer.generateBackupSetDir(wsBackupConfig.getRepository(), wsBackupConfig.getWorkspace(),
config.getBackupDir().getPath(), startTime);
dir.mkdirs();
wsBackupConfig.setBackupDir(dir);
BackupChain bchain =
new BackupChainImpl(wsBackupConfig, wsBackupConfig.getBackupDir(), repositoryService, fullBackupType,
incrementalBackupType, IdGenerator.generate(), logDirectory, startTime);
wsLogFilePathList.add(bchain.getLogFilePath());
workspaceBackups.add(bchain);
}
this.repositoryChainLog = new RepositoryBackupChainLog(logDirectory,
this.config,
fullBackupType,
incrementalBackupType,
repository.getSystemWorkspaceName(),
wsLogFilePathList,
this.repositoryBackupId,
startTime,
repository,
repositoryService.getConfig());