config.setRepository(repositoryName);
config.setWorkspace(workspaceName);
config.setBackupType(BackupManager.FULL_BACKUP_ONLY);
config.setBackupDir(backDir);
BackupChain bch = backupManagerImpl.startBackup(config);
// wait till full backup will stop
while (bch.getFullBackupState() != BackupChain.FINISHED)
{
Thread.yield();
Thread.sleep(30);
}
if (bch != null)
{
backupManagerImpl.stopBackup(bch);
}
// restore
BackupChainLog bclog = new BackupChainLog(new File(bch.getLogFilePath()));
JobExistingWorkspaceSameConfigRestore job =
new JobExistingWorkspaceSameConfigRestore(repositoryService, backupManagerImpl, repositoryName, bclog, bclog
.getOriginalWorkspaceEntry());