Interface BackupRestoreService
- All Known Implementing Classes:
DefaultBackupRestoreService
public interface BackupRestoreService
Service responsible for accepting backup/restore operations.
- Since:
- 8.2.0
-
Method Summary
Modifier and TypeMethodDescriptionint
Cancels all queued jobs.cancelJob
(long jobId) Cancels the job.createSiteBackupJob
(SiteBackupSettings settings) Starts the new site backup job if possible.createSiteRestoreJob
(SiteRestoreSettings settings) Starts the new site restore job if possible.createSiteRestoreJob
(SiteRestoreSettings settings, InputStream inputStream) Starts the new site restore (from uploaded file) job if possible.createSpaceBackupJob
(SpaceBackupSettings settings) Creates new space backup job and adds it to the queue.createSpaceRestoreJob
(SpaceRestoreSettings settings) Creates new space restore job and adds it to the queue.createSpaceRestoreJob
(SpaceRestoreSettings settings, InputStream inputStream) Creates new space restore (from uploaded file) job and adds it to the queue.Gets backup/restore jobs based on the filter provided.getBackupFile
(Long jobId) Download backup file.Gets information of files stored in /restore/(jobScope)getJob
(long jobId) Get job by id.
-
Method Details
-
createSpaceBackupJob
Creates new space backup job and adds it to the queue. Supports either single-space backup or multi-space backups (depends on how many space ids are provided). Throws an exception if the operation is not permitted. The user should have Space Export permissions to all the spaces passed for backup (or be a sysadmin) to be able to perform this operation.- Parameters:
settings
- space backup settings- Returns:
- space backup job details
- Throws:
PermissionException
- if user doesn't have permission to create space backupsConflictException
- if backup with the same spaces selected is already in PROGRESS or QUEUEDBadRequestException
- if invalid settings provided
-
createSiteBackupJob
Starts the new site backup job if possible. If another site backup/restore job is in progress, the operation will be rejected because the existing site backup must be either cancelled or finished first. Throws an exception if the operation is not permitted. The user should be a sysadmin to be able to perform this operation.- Parameters:
settings
- site backup settings- Returns:
- site backup job details
- Throws:
PermissionException
- if user doesn't have permission to create site backupsBadRequestException
- if invalid settings provided
-
createSpaceRestoreJob
Creates new space restore job and adds it to the queue. Throws an exception if the operation is not permitted. The user should be a sysadmin to be able to perform this operation.- Parameters:
settings
- space restore settings- Returns:
- space restore job details
- Throws:
PermissionException
- if user doesn't have permission to restore spaceBadRequestException
- if invalid filename provided
-
createSiteRestoreJob
Starts the new site restore job if possible. If another site backup/restore job is in progress, the operation will be rejected because the existing site backup must be either cancelled or finished first. Throws an exception if the operation is not permitted. The user should be a sysadmin to be able to perform this operation.- Parameters:
settings
- site restore settings- Returns:
- site restore job details
- Throws:
PermissionException
- if user doesn't have permission to restore siteBadRequestException
- if invalid filename provided
-
createSpaceRestoreJob
SpaceRestoreJobDetails createSpaceRestoreJob(SpaceRestoreSettings settings, InputStream inputStream) Creates new space restore (from uploaded file) job and adds it to the queue. Throws an exception if the operation is not permitted. The user should be a sysadmin to be able to perform this operation.- Parameters:
settings
- space restore settingsinputStream
- Input Stream ( File contents)- Returns:
- space restore job details
- Throws:
PermissionException
- if user doesn't have permission to restore spaceBadRequestException
- if invalid filename provided
-
createSiteRestoreJob
Starts the new site restore (from uploaded file) job if possible. If another site backup/restore job is in progress, the operation will be rejected because the existing site backup must be either cancelled or finished first. Throws an exception if the operation is not permitted. The user should be a sysadmin to be able to perform this operation.- Parameters:
settings
- site restore settingsinputStream
- Input Stream ( File contents)- Returns:
- site restore job details
- Throws:
PermissionException
- if user doesn't have permission to restore siteConflictException
- if another site operation (BACKUP or RESTORE) is in progressBadRequestException
- if invalid filename provided
-
getJob
Get job by id. The user should be a sysadmin or an owner of the job- Parameters:
jobId
- id of the backup/restore job- Returns:
- job details
- Throws:
NotFoundException
- if job not found or user doesn't have permission to see it
-
findJobs
Gets backup/restore jobs based on the filter provided.- Parameters:
filter
- job filter- Returns:
- List of backup/restore jobs visible to user based on the filter provided.
-
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. The user should be a sysadmin or an owner of this job to be able to perform this operation.- Parameters:
jobId
- id of the backup/restore job- Returns:
- details of cancelled job
- Throws:
NotFoundException
- if job not found or user doesn't have permission to cancel it
-
getFiles
Gets information of files stored in /restore/(jobScope)- Parameters:
jobScope
- SITE or SPACE, the scope to get files from- Returns:
- List of file information of files in the directory storing the jobScope's restore files.
- Throws:
PermissionException
- if user doesn't have permission to see files
-
cancelAllQueuedJobs
int cancelAllQueuedJobs()Cancels all queued jobs. Does not affect jobs that are being processed at the moment.- Returns:
- number of cancelled jobs
- Throws:
PermissionException
- if user doesn't have permission to cancel jobs
-
getBackupFile
Download backup file. Throws an exception if the operation is not permitted or the file is missing in the confluence-home/temp directory. The user should be a sysadmin or have permissions to back up all spaces for this job.- Parameters:
jobId
- id of the backup job- Returns:
- backup file
- Throws:
NotFoundException
- if job cannot be found, lack permissions or the backup file does not exist in confluence-home/temp directory
-