/// <summary> /// Retrieves a collection of output monitor destinations of the specified type. /// </summary> /// <param name="monitorType">The type of output monitor destinations to retrieve.</param> /// <returns>A collection of output monitor destinations.</returns> public IEnumerable <string> GetOutputMonitorDestinations(string monitorType) { STFMonitorType stfMonitorType = (STFMonitorType)Enum.Parse(typeof(STFMonitorType), monitorType); Collection <string> result = new Collection <string>(); using (AssetInventoryContext context = DbConnect.AssetInventoryContext()) { foreach (MonitorConfig monitorConfig in context.MonitorConfigs.Where(m => m.MonitorType == monitorType)) { if (monitorConfig.Configuration.StartsWith("<OutputMonitorConfig")) { OutputMonitorConfig outputConfig = LegacySerializer.DeserializeXml <OutputMonitorConfig>(monitorConfig.Configuration); if (stfMonitorType.Equals(STFMonitorType.OutputEmail) || stfMonitorType.Equals(STFMonitorType.DigitalSendNotification)) { result.Add(outputConfig.MonitorLocation); } else { result.Add($@"\\{monitorConfig.ServerHostName}\{outputConfig.MonitorLocation}"); } } } } return(result); }
private void CreateMonitor(MonitorConfig monitorConfig) { STFMonitorType monitorType = EnumUtil.Parse <STFMonitorType>(monitorConfig.MonitorType); StfMonitor monitor = null; switch (monitorType) { case STFMonitorType.OutputEmail: monitor = new OutputEmailMonitor(monitorConfig); break; case STFMonitorType.OutputDirectory: monitor = new OutputDirectoryMonitor(monitorConfig); break; case STFMonitorType.SharePoint: monitor = new SharePointMonitor(monitorConfig); break; case STFMonitorType.LANFax: monitor = new LANFaxMonitor(monitorConfig); break; case STFMonitorType.DigitalSendNotification: monitor = new DigitalSendNotificationMonitor(monitorConfig); break; case STFMonitorType.Directory: monitor = new DirectoryMonitor(monitorConfig); break; case STFMonitorType.AutoStore: monitor = new AutoStoreMonitor(monitorConfig); break; case STFMonitorType.DSSServer: monitor = new DigitalSendDatabaseMonitor(monitorConfig); break; case STFMonitorType.Hpcr: monitor = new HpcrDatabaseMonitor(monitorConfig); break; case STFMonitorType.EPrint: monitor = new EPrintJobMonitorService(monitorConfig); break; default: TraceFactory.Logger.Debug($"Unknown monitor type: {monitorConfig.MonitorType}"); return; } monitor.RegisteredSessions = _registeredSessions; _monitors.Add(monitor); TraceFactory.Logger.Debug($"Added monitor for '{monitor.MonitorLocation}'."); }