Interface BackupRestoreManager
- All Known Implementing Classes:
ConfluenceBackupRestoreManager
@ExperimentalApi
public interface BackupRestoreManager
Responsible for accepting backup/restore operations, checking permissions, managing the queue and cluster-wide locks.
All operations are asynchronous.
- Since:
- 7.17.0
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Checks whether the current user can upload a backup file.int
Cancels all queued jobs including jobs in QUEUED state and PROCESSING state.Cancels the job.findJobs
(BackupRestoreJobsSearchFilter backupRestoreJobsSearchFilter) Returns jobs based on the filter provided.Get job by id.getSettingsById
(long id) Returns job settings.getStatisticsById
(long id) boolean
hasJobs
(BackupRestoreJobsSearchFilter filter) startSiteBackup
(BackupRestoreSettings siteBackupSettings) Queues a new site backup job if possible.startSiteRestore
(BackupRestoreSettings siteRestoreSettings) Queues the new site restore job if possible.startSpaceBackup
(BackupRestoreSettings spaceBackupSettings) Adds the new space backup job to the queue.startSpaceRestore
(BackupRestoreSettings spaceRestoreSettings) Adds the new space restore job to the queue.
-
Method Details
-
getJob
Get job by id.- Throws:
NotPermittedException
-
startSpaceBackup
BackupRestoreJob startSpaceBackup(BackupRestoreSettings spaceBackupSettings) throws NotPermittedException, TheSameSpaceBackupRestoreJobAlreadyInProgressException Adds the new space backup job to the queue. Throws an exception if the operation is not permitted. Support either single-space backup ot multi-space backups (depends on how many space ids are provided).- Parameters:
spaceBackupSettings
- space backup settings- Throws:
NotPermittedException
TheSameSpaceBackupRestoreJobAlreadyInProgressException
-
startSiteBackup
BackupRestoreJob startSiteBackup(BackupRestoreSettings siteBackupSettings) throws NotPermittedException Queues a new site backup job if possible. Throws an exception if the operation is not permitted. The user has to be a sysadmin to perform this operation.- Parameters:
siteBackupSettings
- site backup settings- Throws:
NotPermittedException
-
startSpaceRestore
BackupRestoreJob startSpaceRestore(BackupRestoreSettings spaceRestoreSettings) throws NotPermittedException Adds the new space restore job to the queue. Throws an exception if the operation is not permitted. The user has to the a sysadmin to perform this operation.- Parameters:
spaceRestoreSettings
- space restore settings- Throws:
NotPermittedException
-
startSiteRestore
BackupRestoreJob startSiteRestore(BackupRestoreSettings siteRestoreSettings) throws NotPermittedException Queues the new site restore job if possible. It cancels all other jobs and starts the restore just after. Throws an exception if the operation is not permitted.- Parameters:
siteRestoreSettings
- site restore settings- Throws:
NotPermittedException
-
cancelJob
Cancels the job. If the job is already cancelled or failed, the method will do nothing. Throws an exception if the operation is not permitted.- Parameters:
jobId
- jobId- Returns:
- the job
- Throws:
NotPermittedException
-
cancelAllJobsFromQueue
Cancels all queued jobs including jobs in QUEUED state and PROCESSING state.- Returns:
- number of cancelled jobs.
- Throws:
NotPermittedException
-
findJobs
Returns jobs based on the filter provided. Permissions are based on the user SysAdmins can return all, Users can return only jobs that they have space export permissions for- Parameters:
backupRestoreJobsSearchFilter
- properties to filter jobs by- Returns:
- List of BackupRestoreJobs
-
hasJobs
- Since:
- 9.3
-
assertUserHasSystemAdminPermissions
Checks whether the current user can upload a backup file. Throws a PermissionException if the user does not have permission.- Throws:
PermissionException
- if user doesn't have permission to upload backup fileNotPermittedException
-
getSettingsById
Returns job settings.- Parameters:
id
- job id- Returns:
- settings
-
getStatisticsById
- Parameters:
id
-- Returns:
- the job's statistics
-