com.atlassian.crowd.manager.backup
Class DefaultBackupManager

java.lang.Object
  extended by com.atlassian.crowd.manager.backup.DefaultBackupManager
All Implemented Interfaces:
BackupManager

public class DefaultBackupManager
extends Object
implements BackupManager

Default implementation of BackupManager

Since:
v2.7

Constructor Summary
DefaultBackupManager(XmlMigrationManager xmlMigrationManager, FileConfigurationExporter fileConfigurationExporter, BackupFileStore backupFileStore)
           
 
Method Summary
 long backup(String exportFileName, boolean resetDomain)
          Perform an XML export of crowd, as well as of the directory configuration.
 String generateAutomatedBackupFileName()
          Generate a filename for an automated backup, that can then be used with BackupManager.backup(String, boolean).
protected  String generateFileName(String pattern)
           
 String generateManualBackupFileName()
          Generate a filename for a manual backup, that can then be used with BackupManager.backup(String, boolean)
 BackupSummary getAutomatedBackupSummary()
          Return a summary of how many automated backups are present, and how old are the oldest and most recent backups.
 String getBackupFileFullPath(String fileName)
          Generate the full path of the given backup filename.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultBackupManager

public DefaultBackupManager(XmlMigrationManager xmlMigrationManager,
                            FileConfigurationExporter fileConfigurationExporter,
                            BackupFileStore backupFileStore)
Method Detail

generateManualBackupFileName

public String generateManualBackupFileName()
Description copied from interface: BackupManager
Generate a filename for a manual backup, that can then be used with BackupManager.backup(String, boolean)

Specified by:
generateManualBackupFileName in interface BackupManager
Returns:
a filename

generateAutomatedBackupFileName

public String generateAutomatedBackupFileName()
Description copied from interface: BackupManager
Generate a filename for an automated backup, that can then be used with BackupManager.backup(String, boolean).

Specified by:
generateAutomatedBackupFileName in interface BackupManager
Returns:
a filename

getBackupFileFullPath

public String getBackupFileFullPath(String fileName)
Description copied from interface: BackupManager
Generate the full path of the given backup filename.

Specified by:
getBackupFileFullPath in interface BackupManager
Parameters:
fileName - a filename
Returns:
a full path

backup

@Transactional
public long backup(String exportFileName,
                                 boolean resetDomain)
            throws ExportException
Description copied from interface: BackupManager
Perform an XML export of crowd, as well as of the directory configuration.

Specified by:
backup in interface BackupManager
Parameters:
exportFileName - the name of the file to export to (not the full path)
resetDomain - whether to activate the RESET_DOMAIN option or not
Returns:
the time it took to execute the export, in milliseconds
Throws:
ExportException - in case an error happens while exporting the data

getAutomatedBackupSummary

public BackupSummary getAutomatedBackupSummary()
Description copied from interface: BackupManager
Return a summary of how many automated backups are present, and how old are the oldest and most recent backups.

Specified by:
getAutomatedBackupSummary in interface BackupManager
Returns:
a BackupSummary

generateFileName

protected String generateFileName(String pattern)


Copyright © 2013 Atlassian. All Rights Reserved.