@Service public class DefaultBackupService extends Object implements BackupService
| Constructor and Description |
|---|
DefaultBackupService() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkIntegrity(Path muleDistributionHome)
Checks the integrity of a backup checking the backup descriptor entries match with the current files in the backup folder
|
void |
create(MuleDistribution muleDistribution,
boolean force,
boolean isDryRunMode)
This function creates the backup descriptor.
|
Path |
getBackupDestDir(Path muleLocation)
Gets the back destination dir where the backup files are going to be placed
|
Clock |
getClock() |
void |
printBackUpDescriptor(Optional<BackupDescriptor> backupDescriptor)
Prints a BackUp Descriptor with a pretty format .
|
Optional<BackupDescriptor> |
readBackupDescriptor(Path muleDistributionHome)
This function reads the backup descriptor.
|
void |
setClock(Clock clock) |
public void create(MuleDistribution muleDistribution, boolean force, boolean isDryRunMode) throws IOException
create in interface BackupServicemuleDistribution - a MuleDistribution representing the Mule distro where the backup will be taken from.isDryRunMode - if isDryRunMode is true, the tool only log in debug level the files and directories that would copy
but not copy them properly.IOExceptionpublic Optional<BackupDescriptor> readBackupDescriptor(Path muleDistributionHome) throws IOException
readBackupDescriptor in interface BackupServicemuleDistributionHome - location where is the backup descriptor.IOExceptionpublic boolean checkIntegrity(Path muleDistributionHome) throws IOException
BackupServicecheckIntegrity in interface BackupServicemuleDistributionHome - location of the Mule distribution where backup could reside.IOException - In case of any I/O related error while creating the backup.public Path getBackupDestDir(Path muleLocation)
BackupServicegetBackupDestDir in interface BackupServicemuleLocation - Path with the mule distribution where is going to be resolved the backup folder pathpublic void printBackUpDescriptor(Optional<BackupDescriptor> backupDescriptor)
printBackUpDescriptor in interface BackupServicebackupDescriptor - BackUp Descriptor selected.public Clock getClock()
public void setClock(Clock clock)
Copyright © 2022 MuleSoft, Inc.. All rights reserved.