mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-16 10:58:30 -05:00
Agent configuration support classes (WIP) (#632)
* Additional SQL Agent config classes (WIP) * Fix build breaks * Clean up job step code * Add VS Code build files * Move changes to other machine * More of the action execution classes * More execution processing refactors * More refactoring * Disable tests for WIP merge * Fix break on Release config * Stage changes to other machine.
This commit is contained in:
61
src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/JobActions.cs
Normal file
61
src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/JobActions.cs
Normal file
@@ -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 System;
|
||||
using Microsoft.SqlTools.ServiceLayer.Admin;
|
||||
using Microsoft.SqlTools.ServiceLayer.Agent.Contracts;
|
||||
using Microsoft.SqlTools.ServiceLayer.Management;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.Agent
|
||||
{
|
||||
/// <summary>
|
||||
/// JobActions provides basic SQL Server Agent Job configuration actions
|
||||
/// </summary>
|
||||
internal class JobActions : ManagementActionBase
|
||||
{
|
||||
private JobData data;
|
||||
private ConfigAction configAction;
|
||||
|
||||
public JobActions(CDataContainer dataContainer, JobData data, ConfigAction configAction)
|
||||
{
|
||||
this.DataContainer = dataContainer;
|
||||
this.data = data;
|
||||
this.configAction = configAction;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
|
||||
//release the data object
|
||||
this.data = null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// called by ManagementActionBase.PreProcessExecution
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// true if regular execution should take place, false if everything,
|
||||
/// has been done by this function
|
||||
/// </returns>
|
||||
protected override bool DoPreProcessExecution(RunType runType, out ExecutionMode executionResult)
|
||||
{
|
||||
base.DoPreProcessExecution(runType, out executionResult);
|
||||
this.data.ApplyChanges(creating: true);
|
||||
if (!IsScripting(runType))
|
||||
{
|
||||
this.DataContainer.SqlDialogSubject = this.data.Job;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user