mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-19 09:35:36 -05:00
Register backup to task service for execution (#381)
* Create backup task for execution * Register backup to task service * Fix backup task service * Fix async methods * Add backup unit test * Add cancellation token to task service and fix other PR comments * Add SR and fix other pr comments * Add comments to methods * Fixed backup cancel test and casing * Change sleep time in test
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using Microsoft.SqlTools.ServiceLayer.Admin;
|
||||
using Microsoft.SqlTools.ServiceLayer.DisasterRecovery;
|
||||
using Microsoft.SqlTools.ServiceLayer.DisasterRecovery.Contracts;
|
||||
using System.Data.SqlClient;
|
||||
using System.Threading;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.UnitTests.DisasterRecovery
|
||||
{
|
||||
/// <summary>
|
||||
/// Stub class that implements IBackupUtilities
|
||||
/// </summary>
|
||||
public class BackupUtilitiesStub : IBackupUtilities
|
||||
{
|
||||
/// <summary>
|
||||
/// Initialize
|
||||
/// </summary>
|
||||
/// <param name="dataContainer"></param>
|
||||
/// <param name="sqlConnection"></param>
|
||||
public void Initialize(CDataContainer dataContainer, SqlConnection sqlConnection)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Return database metadata for backup
|
||||
/// </summary>
|
||||
/// <param name="databaseName"></param>
|
||||
/// <returns></returns>
|
||||
public BackupConfigInfo GetBackupConfigInfo(string databaseName)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set backup input properties
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
public void SetBackupInput(BackupInfo input)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Execute backup
|
||||
/// </summary>
|
||||
public void PerformBackup()
|
||||
{
|
||||
Thread.Sleep(500);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Cancel backup
|
||||
/// </summary>
|
||||
public void CancelBackup()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user