jetbrains.buildServer.serverSide.maintenance
Interface BackupProcessManager


public interface BackupProcessManager

Backup process manager. Could start a backup process or get the current backup process.


Method Summary
 boolean canStartBackup()
          Checks whether is possible to start backup process right now.
 BackupInfo findBackupInfoById(int processId)
          Looks for the brief info of a backup process by its process identifier.
 BackupProcess getCurrentBackupProcess()
          Returns the current backup process.
 BackupProcess startBackup(BackupConfig config)
          Starts a new backup process if possible to start it right now, or does nothing if not possible.
 BackupProcess startBackup(BackupConfig config, Action<MaintenanceProcess> onFinishAction)
          Starts a new backup process if possible to start it right now, or does nothing if not possible.
 

Method Detail

canStartBackup

boolean canStartBackup()
Checks whether is possible to start backup process right now. It is possible if no other maintenance processes are running.

Returns:

startBackup

@NotNull
BackupProcess startBackup(@Nullable
                                  BackupConfig config)
                          throws AccessDeniedException,
                                 MaintenanceProcessAlreadyRunningException
Starts a new backup process if possible to start it right now, or does nothing if not possible.

Parameters:
config - backup configuration or null to use the default one.
Returns:
started backup process.
Throws:
AccessDeniedException - when the current user is not granted to perform backup.
MaintenanceProcessAlreadyRunningException - when another maintenance process is running now.
See Also:
canStartBackup(), startBackup(BackupConfig, jetbrains.buildServer.util.Action)

startBackup

@NotNull
BackupProcess startBackup(@Nullable
                                  BackupConfig config,
                                  @Nullable
                                  Action<MaintenanceProcess> onFinishAction)
                          throws AccessDeniedException,
                                 MaintenanceProcessAlreadyRunningException
Starts a new backup process if possible to start it right now, or does nothing if not possible.

Parameters:
config - backup configuration or null to use the default one.
onFinishAction - action that can be fired when backup is completed (not depend successful, unsuccessful or being cancelled). The completing process (the same as this function returns) will be passed as a parameter to the calling Action.apply(T). Note: this action will not be fired if backup could not start.
Returns:
started backup process.
Throws:
AccessDeniedException - when the current user is not granted to perform backup.
MaintenanceProcessAlreadyRunningException - when another maintenance process is running now.
Since:
6.0
See Also:
canStartBackup()

getCurrentBackupProcess

@Nullable
BackupProcess getCurrentBackupProcess()
Returns the current backup process.

Returns:
the current backup process or null if backup is not running right now.

findBackupInfoById

@Nullable
BackupInfo findBackupInfoById(int processId)
Looks for the brief info of a backup process by its process identifier.

Parameters:
processId - backup process identifier, see MaintenanceProcess.getProcessId().
Returns:
brief info, or null if not found.