/// <summary> /// Executes the Ps1 script with DryDun switch, /// Parses the output to acquire primary and legacy Urls, /// Tests the primary Url to see if it is available, /// Reports the results to the data service provided. /// </summary> internal static async Task ExecuteDryRunCheckAndReportUrlAccessAsync(ILogger log, string monitorName, string additionalCmdArgs, CancellationToken cancellationToken = default) { string scriptName = "dotnet-install.ps1"; string commandLineArgs = $"-DryRun {additionalCmdArgs}"; using IDataService dataService = new DataServiceFactory().GetDataService(); // Execute the script; ScriptExecutionResult results = await HelperMethods.ExecuteInstallScriptPs1Async(commandLineArgs).ConfigureAwait(false); log.LogInformation($"Ouput stream: {results.Output}"); if (!string.IsNullOrWhiteSpace(results.Error)) { log.LogError($"Error stream: {results.Error}"); await dataService.ReportScriptExecutionAsync(monitorName, scriptName, commandLineArgs, results.Error, cancellationToken) .ConfigureAwait(false); return; } // Parse the output ScriptDryRunResult dryRunResults = ParseDryRunOutput(results.Output); if (string.IsNullOrWhiteSpace(dryRunResults.PrimaryUrl)) { log.LogError($"Primary Url was not found for channel {additionalCmdArgs}"); await dataService.ReportScriptExecutionAsync(monitorName, scriptName, commandLineArgs, "Failed to parse primary url from the following DryRun execution output: " + results.Output , cancellationToken).ConfigureAwait(false); return; } // Validate URL accessibility await HelperMethods.CheckAndReportUrlAccessAsync(log, monitorName, dryRunResults.PrimaryUrl, dataService); }
protected override async void OnLoad(EventArgs e) { this.Cursor = Cursors.WaitCursor; try { var ticket = await Session.GetTikectAsync(); var results = await DataServiceFactory.Create().ListProcessesAsync(ticket); foreach (var item in results) { if (item.active == 1) { AddToListView(item); } } } finally { this.Cursor = Cursors.Default; } }
/// <summary> /// Loads Items from our DataServices and sort into grouped enumerable /// </summary> private async void LoadItems(bool overrideCache = false) { IsBusy = true; if (AppSettings.EnableRemoteAppSettings) { RemoteAppSettingsService remoteAppSettingsService = new RemoteAppSettingsService(); await remoteAppSettingsService.LoadRemoteAppSettings(overrideCache); } //Name may change after RemoteSettings enabled ApplicationName = AppSettings.ApplicationName; if (AppSettings.EnableRemoteUrlSourceService) { await RemoteUrlSourceService.GetRemoteUrlSources(); } EnabledDataServices = DataServiceFactory.GetCurrentDataService(); if (EnabledDataServices.Count == 0) { ServiceLocator.MessageService.ShowErrorAsync("No DataServices Enabled", "Application Error"); return; } items = new List <Item>(); await DoFetchDataServices(EnabledDataServices, overrideCache); ItemGroups = new List <Group <Item> >(from item in items group item by item.Group into grp orderby grp.GetOrderPreference() select new Group <Item>(grp.Key, grp)).ToList(); IsBusy = false; }
public static async Task RunAsync([TimerTrigger("0 */30 * * * *")] TimerInfo myTimer, ILogger log) { using IDataService dataService = new DataServiceFactory().GetDataService(); await HelperMethods.CheckAndReportUrlAccessAsync(log, _monitorName, _url, dataService).ConfigureAwait(false); }
public void ConstructorThrowsIoExceptionIfCacheBaseDirectoryDoesNotExist() { DataServiceFactory.GetService(StorageDomain.UserCacheData, new NewsComponentsConfiguration()); }
public void ConstructorThrowsArgumentNullExceptionIfConfigurationIsMissing() { Assert.Throws <ArgumentNullException>(() => DataServiceFactory.GetService(StorageDomain.UserCacheData, null)); }
public static PubHelper GetHelper() { return(new PubHelper(DataServiceFactory.Create(BLLConstants.SITE_DEFAULT + BLLConstants.BU_DEFAULT))); }
public MainForm() { InitializeComponent(); _dataService = DataServiceFactory.Create(); }
public UploadManager() { log = LogManager.GetLogger(GetType()); dataService = DataServiceFactory.Create(); queue = new Queue <Tuple <string, List <DokuField> > >(); }
public static DataContext GetDB(UserInfo ui) { return(DataServiceFactory.Create(ui.SiteCode + ui.BUCode)); }
public AGServer() { DataFactory.DataFactory.ConnectionString = StaticConfigs.GetDBConfig("OracleConnectionString"); DataFactory.DataFactory.SqlCommandTimeout = int.Parse(StaticConfigs.GetDBConfig("SqlCommandTimeout")); _dataServiceSample = new DataServiceFactory(); }
private ConstantsHelper(string site, string bu) { _site = string.IsNullOrEmpty(site)?BLLConstants.SITE_DEFAULT:site; _bu = string.IsNullOrEmpty(bu)?BLLConstants.BU_DEFAULT:bu; this.DBContext = DataServiceFactory.Create(_site + _bu); }
private ConstantsHelper() { this.DBContext = DataServiceFactory.Create(_site + _bu); }