public RunInitializationResult(LogsharkRequestTarget target, IArtifactProcessor artifactProcessor, ISet <string> collectionsRequested, string logsetHash, ISet <Type> pluginsToExecute) { Target = target; ArtifactProcessor = artifactProcessor; ArtifactProcessorVersion = artifactProcessor.GetType().Assembly.GetName().Version; CollectionsRequested = collectionsRequested; CollectionsRequested.UnionWith(artifactProcessor.RequiredCollections); LogsetHash = logsetHash; PluginTypesToExecute = pluginsToExecute; }
/// <summary> /// Filters a collection of plugins by the defaults specified for that Artifact Processor in the LogsharkConfiguration. /// </summary> /// <param name="artifactProcessor">The artifact processor to load the defaults for.</param> /// <param name="plugins">The set of plugins to filter.</param> /// <returns>Set of plugins filtered down to only those that are specified as defaults for the given artifact processor.</returns> protected ISet <Type> FilterPluginsByConfiguredDefaults(IArtifactProcessor artifactProcessor, ISet <Type> plugins) { try { LogsharkArtifactProcessorConfiguration artifactProcessorConfiguration = artifactProcessorOptions.LoadConfiguration(artifactProcessor.GetType()); return(FilterPluginsByName(plugins, artifactProcessorConfiguration.DefaultPlugins)); } catch (KeyNotFoundException) { // If the user has not specified a default configuration for the given artifact processor, just default to running everything. return(plugins); } }