public class ConfigFileBackupTask extends Object
Modifier and Type | Class and Description |
---|---|
private class |
ConfigFileBackupTask.ConfigFileBackupTaskImplementation
Klasse, die die eigentliche Arbeit macht
|
Modifier and Type | Field and Description |
---|---|
private BackupProgressCallback |
_callback |
private long |
_completed |
private ConfigAuthentication |
_configAuthentication |
private ConfigurationAuthority |
_configurationAuthority |
private ConfigurationFileManager |
_configurationFileManager |
private ConfigAreaFile |
_currentFile |
private ConfigDataModel |
_dataModel |
private static Debug |
_debug |
private long |
_failed |
private int |
_queryIndex |
private SenderReceiverCommunication |
_sender |
private File |
_targetDirectory |
private long |
_total |
static int |
BACKUP_STATE_FINISHED |
static int |
BACKUP_STATE_INITIALIZING |
static int |
BACKUP_STATE_INPROGRESS |
Constructor and Description |
---|
ConfigFileBackupTask(ConfigAuthentication authentication,
ConfigDataModel dataModel,
String target,
ConfigurationAuthority configurationAuthority)
Erstellt einen neuen ConfigFileBackupTask, welches keinerlei Fortschrittsmeldungen sendet.
|
ConfigFileBackupTask(ConfigAuthentication authentication,
ConfigDataModel dataModel,
String target,
ConfigurationAuthority configurationAuthority,
BackupProgressCallback callback)
Erstellt einen neuen ConfigFileBackupTask, welches den Fortschritt an ein lokales BackupProgressCallback-Objekt übergibt
|
ConfigFileBackupTask(ConfigAuthentication authentication,
ConfigDataModel dataModel,
String target,
ConfigurationAuthority configurationAuthority,
SenderReceiverCommunication senderReplyAreaTasks,
int queryIndex)
Erstellt einen neuen ConfigFileBackupTask, welches den Fortschritt über den Datenverteiler an ein RemoteRequester übermittelt
|
Modifier and Type | Method and Description |
---|---|
private static String |
generateDirectoryName()
Formatiert das aktuelle Datum und Uhrzeit in einen als Pfadnamen darstellbaren, einfach sortierbaren String
|
private ConfigurationAreaFile[] |
getConfigurationAreasToBackup() |
double |
getFileProgress()
Gibt den aktuellen Fortschritt der aktuellen Datei zurück
|
double |
getOverallProgress()
Gibt den aktuellen Gesamt-Fortschritt zurück
|
String |
getTargetPath()
Gibt das Zielverzeichnis zurück
|
private static boolean |
isStringNullOrBlank(String param) |
void |
startAsync()
Startet einen Backup-Vorgang asynchron, wartet also nicht auf das Beenden.
|
BackupResult |
startSync()
Startet einen Backup-Vorgang und wartet auf das Beenden.
|
public static final int BACKUP_STATE_INITIALIZING
public static final int BACKUP_STATE_INPROGRESS
public static final int BACKUP_STATE_FINISHED
private final ConfigurationFileManager _configurationFileManager
private File _targetDirectory
private volatile long _failed
private volatile long _total
private volatile long _completed
private static final Debug _debug
private ConfigDataModel _dataModel
private BackupProgressCallback _callback
private ConfigAuthentication _configAuthentication
private ConfigurationAuthority _configurationAuthority
private volatile ConfigAreaFile _currentFile
private SenderReceiverCommunication _sender
private int _queryIndex
public ConfigFileBackupTask(ConfigAuthentication authentication, ConfigDataModel dataModel, String target, ConfigurationAuthority configurationAuthority, BackupProgressCallback callback) throws IOException
authentication
- Klasse von der die Benutzerverwaltung.xml gesichert werden solldataModel
- Lokale Konfigurationtarget
- Zielverzeichnis, welches innerhalb von ConfigDataModel.getBackupBaseDirectory()
angelegt werden soll.configurationAuthority
- Konfigurationsverantwortlicher, dessen Konfigurations-Dateien gesichert werden sollen. Falls null werden
alle Dateien gesichert.callback
- Objekt, das über den Fortschritt des Backup-Vorgangs informiert werden soll.IOException
- Wenn das angegebene target-Verzeichnis ungültig istpublic ConfigFileBackupTask(ConfigAuthentication authentication, ConfigDataModel dataModel, String target, ConfigurationAuthority configurationAuthority, SenderReceiverCommunication senderReplyAreaTasks, int queryIndex) throws IOException
authentication
- Klasse von der die Benutzerverwaltung.xml gesichert werden solldataModel
- Lokale Konfigurationtarget
- Zielverzeichnis, welches innerhalb von ConfigDataModel.getBackupBaseDirectory()
angelegt werden soll.configurationAuthority
- Konfigurationsverantwortlicher, dessen Konfigurations-Dateien gesichert werden sollen. Falls null werden
alle Dateien gesichert.senderReplyAreaTasks
- Verbindung mit dem RemoteRequestManagerqueryIndex
- Anfrageindex @throws IOException Wenn das angegebene target-Verzeichnis ungültig istIOException
public ConfigFileBackupTask(ConfigAuthentication authentication, ConfigDataModel dataModel, String target, ConfigurationAuthority configurationAuthority) throws IOException
authentication
- Klasse von der die Benutzerverwaltung.xml gesichert werden soll. Kann null sein, dann wird keine
Benutzerverwaltung gesichert.dataModel
- Lokale Konfigurationtarget
- Zielverzeichnis, welches innerhalb von ConfigDataModel.getBackupBaseDirectory()
angelegt werden soll. Falls null oder ein Leerstring angegeben wird, wird anhand des aktuellen Datums, der
Uhrzeit und/oder anderen nicht näher spezifizierten Mechanismen ein eindeutiges neues Verzeichnis
erstellt. Falls im ConfigDataModel kein Zielverzeichnis über ConfigDataModel.setBackupBaseDirectory(java.io.File)
festgelegt wurde kann jedes beliebige absolute oder relative Verzeichnis angegeben werden.configurationAuthority
- Konfigurationsverantwortlicher, dessen Konfigurations-Dateien gesichert werden sollen. Falls null werden
alle Dateien gesichert.IOException
- Wenn das angegebene target-Verzeichnis ungültig istprivate ConfigurationAreaFile[] getConfigurationAreasToBackup()
private static String generateDirectoryName()
private static boolean isStringNullOrBlank(String param)
public void startAsync()
public BackupResult startSync()
public double getFileProgress()
public double getOverallProgress()
public String getTargetPath()