Class BackupProcessManagerImpl
- java.lang.Object
-
- jetbrains.buildServer.serverSide.maintenance.BackupProcessManagerImpl
-
- All Implemented Interfaces:
BackupProcessManager
public class BackupProcessManagerImpl extends Object implements BackupProcessManager
-
-
Constructor Summary
Constructors Constructor Description BackupProcessManagerImpl(ServerPaths serverPaths, DBFunctionsProvider dbProvider, ZipFactory zipFactory, BackupRegistration backupRegistration, BackupSettingsPersistor backupSettingsPersistor, ActionThrow<AccessDeniedException> accessChecker, MaintenanceLock maintenanceLock, boolean singleUserMode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
captureProcessSlot(MaintenanceProcessKind processKind, long timeout)
This procedure attempts to capture the maintenance process slot, waits if it is busy for the specified time.BackupProcess
getCurrentBackupProcess()
Returns the current backup process.BackupProcessor
getCurrentProcess()
MaintenanceProcessKind
getCurrentProcessKind()
boolean
isPossibleToStartProcess()
void
releaseProcessSlot()
When invoked from a non-maintenance thread, this method blocks until the maintenance thread (if known) terminates.BackupProcess
startBackup(BackupConfig config)
Starts a new backup process if possible to start it right now, or does nothing if not possible.
-
-
-
Constructor Detail
-
BackupProcessManagerImpl
public BackupProcessManagerImpl(@NotNull ServerPaths serverPaths, @Nullable DBFunctionsProvider dbProvider, @NotNull ZipFactory zipFactory, @Nullable BackupRegistration backupRegistration, @NotNull BackupSettingsPersistor backupSettingsPersistor, @Nullable ActionThrow<AccessDeniedException> accessChecker, @Nullable MaintenanceLock maintenanceLock, boolean singleUserMode)
-
-
Method Detail
-
isPossibleToStartProcess
public boolean isPossibleToStartProcess()
-
getCurrentProcessKind
public MaintenanceProcessKind getCurrentProcessKind()
-
getCurrentProcess
@Nullable public BackupProcessor getCurrentProcess()
-
captureProcessSlot
public void captureProcessSlot(@NotNull MaintenanceProcessKind processKind, long timeout) throws MaintenanceProcessAlreadyRunningException
This procedure attempts to capture the maintenance process slot, waits if it is busy for the specified time.Don't forget to call
releaseProcessSlot()
.Multithreading: this procedure thread safe but is not reentrant.
- Parameters:
timeout
- how long time to wait for the maintenance process slot, in milliseconds.- Throws:
MaintenanceProcessAlreadyRunningException
- when another process is running now and waiting time is out.
-
releaseProcessSlot
public void releaseProcessSlot()
When invoked from a non-maintenance thread, this method blocks until the maintenance thread (if known) terminates.
-
startBackup
@NotNull public BackupProcess startBackup(@Nullable BackupConfig config) throws MaintenanceProcessAlreadyRunningException
Description copied from interface:BackupProcessManager
Starts a new backup process if possible to start it right now, or does nothing if not possible.- Specified by:
startBackup
in interfaceBackupProcessManager
- Parameters:
config
- backup configuration or null to use the default one.- Returns:
- started backup process.
- Throws:
MaintenanceProcessAlreadyRunningException
- when another maintenance process is running now.- See Also:
#startBackup(BackupConfig, jetbrains.buildServer.util.Action)
-
getCurrentBackupProcess
@Nullable public BackupProcess getCurrentBackupProcess()
Description copied from interface:BackupProcessManager
Returns the current backup process.- Specified by:
getCurrentBackupProcess
in interfaceBackupProcessManager
- Returns:
- the current backup process or null if backup is not running right now.
-
-