Exemple #1
0
 public PreprocessingStepsFactory(
     Workspaces.IWorkspacesManager workspacesManager,
     AppLaunch.ILaunchUrlParser appLaunch,
     ISynchronizationContext invoke,
     IExtensionsRegistry extentions,
     Progress.IProgressAggregator progressAggregator,
     Persistence.IWebContentCache cache,
     ICredentialsCache credCache,
     ILogProviderFactoryRegistry logProviderFactoryRegistry,
     WebViewTools.IWebViewTools webBrowserDownloader,
     ILogsDownloaderConfig logsDownloaderConfig,
     RegularExpressions.IRegexFactory regexFactory
     )
 {
     this.workspacesManager  = workspacesManager;
     this.appLaunch          = appLaunch;
     this.invoke             = invoke;
     this.extentions         = extentions;
     this.progressAggregator = progressAggregator;
     this.cache     = cache;
     this.credCache = credCache;
     this.logProviderFactoryRegistry = logProviderFactoryRegistry;
     this.webViewTools         = webBrowserDownloader;
     this.logsDownloaderConfig = logsDownloaderConfig;
     this.regexFactory         = regexFactory;
 }
Exemple #2
0
        public Mocks(ViewModelObjects viewModel)
        {
            CredentialsCache      = Substitute.For <Preprocessing.ICredentialsCache>();
            WebBrowserDownloader  = Substitute.For <WebViewTools.IWebViewTools>();
            WebContentCacheConfig = Substitute.For <Persistence.IWebContentCacheConfig>();
            LogsDownloaderConfig  = Substitute.For <Preprocessing.ILogsDownloaderConfig>();

            ShellOpen           = Substitute.For <LogJoint.UI.Presenters.IShellOpen>();
            FileDialogs         = Substitute.For <LogJoint.UI.Presenters.IFileDialogs>();
            PromptDialog        = Substitute.For <LogJoint.UI.Presenters.IPromptDialog>();
            AboutConfig         = Substitute.For <LogJoint.UI.Presenters.About.IAboutConfig>();
            DragDropHandler     = Substitute.For <LogJoint.UI.Presenters.MainForm.IDragDropHandler>();
            SystemThemeDetector = Substitute.For <LogJoint.UI.Presenters.ISystemThemeDetector>();
            Views = Substitute.For <LogJoint.UI.Presenters.Factory.IViewsFactory>();

            Views.CreateLoadedMessagesView().Returns(viewModel.LoadedMessagesViewProxy);
            Views.CreateSourcesManagerView().Returns(viewModel.SourcesManagerViewProxy);
            Views.CreateSourcesListView().Returns(viewModel.SourcesListViewProxy);
            Views.CreatePostprocessingTabPage().Returns(viewModel.PostprocessingTabPage);
            Views.PostprocessingViewsFactory.CreateStateInspectorView().Returns(viewModel.PostprocesssingStateInspectorViewProxy);
            Views.CreatePreprocessingView().Returns(viewModel.PreprocessingUserInteractions);
            Views.CreateSearchPanelView().Returns(viewModel.SearchPanel);
            Views.CreateSearchResultView().Returns(viewModel.SearchResult);
            Views.CreateBookmarksListView().Returns(viewModel.BookmarksList);
            Views.CreateHistoryDialogView().Returns(viewModel.HistoryDialog);
            Views.CreateMessagePropertiesDialogView().Returns(viewModel.MessageProperties);
        }
Exemple #3
0
 private DownloadStep(
     Preprocessing.IStepsFactory preprocessingStepsFactory,
     WebViewTools.IWebViewTools webViewTools
     )
 {
     this.preprocessingStepsFactory = preprocessingStepsFactory;
     this.webViewTools = webViewTools;
 }
Exemple #4
0
 internal DownloadStep(
     Preprocessing.IStepsFactory preprocessingStepsFactory,
     WebViewTools.IWebViewTools webViewTools,
     PreprocessingStepParams source
     ) : this(preprocessingStepsFactory, webViewTools)
 {
     this.source = source;
 }
 public PreprocessingStepsFactory(
     Preprocessing.IStepsFactory preprocessingStepsFactory,
     WebViewTools.IWebViewTools webViewTools
     )
 {
     this.preprocessingStepsFactory = preprocessingStepsFactory;
     this.webViewTools = webViewTools;
 }
Exemple #6
0
 internal DownloadStep(
     Preprocessing.IStepsFactory preprocessingStepsFactory,
     WebViewTools.IWebViewTools webViewTools,
     IReadOnlyCollection <string> ids,
     DateTime referenceTime,
     string env
     ) : this(preprocessingStepsFactory, webViewTools)
 {
     source = new PreprocessingStepParams(MakeUrl(ids, referenceTime, env));
 }
Exemple #7
0
 public PreprocessingStepsFactory(
     Preprocessing.IStepsFactory preprocessingStepsFactory,
     WebViewTools.IWebViewTools webViewTools,
     IContentCache contentCache
     )
 {
     this.preprocessingStepsFactory = preprocessingStepsFactory;
     this.webViewTools = webViewTools;
     this.contentCache = contentCache;
 }
Exemple #8
0
 private DownloadStep(
     Preprocessing.IStepsFactory preprocessingStepsFactory,
     WebViewTools.IWebViewTools webViewTools,
     IContentCache contentCache
     )
 {
     this.preprocessingStepsFactory = preprocessingStepsFactory;
     this.webViewTools = webViewTools;
     this.contentCache = contentCache;
 }
Exemple #9
0
 public Model(
     ISynchronizationContext threadSync,
     IChangeNotification changeNotification,
     Persistence.IWebContentCache webCache,
     Persistence.IContentCache contentCache,
     Persistence.IStorageManager storageManager,
     IBookmarks bookmarks,
     ILogSourcesManager sourcesManager,
     IModelThreads threads,
     ITempFilesManager tempFilesManager,
     Preprocessing.IModel preprocessingModel,
     Progress.IProgressAggregator progressAggregator,
     ILogProviderFactoryRegistry logProviderFactoryRegistry,
     IUserDefinedFormatsManager userDefinedFormatsManager,
     MRU.IRecentlyUsedEntities mru,
     Progress.IProgressAggregatorFactory progressAggregatorsFactory,
     IShutdown shutdown,
     WebViewTools.IWebViewTools webViewTools,
     Postprocessing.IModel postprocessingModel,
     IPluginsManager pluginsManager,
     ITraceSourceFactory traceSourceFactory,
     LogMedia.IFileSystem fileSystem
     )
 {
     this.SynchronizationContext = threadSync;
     this.ChangeNotification     = changeNotification;
     this.WebContentCache        = webCache;
     this.ContentCache           = contentCache;
     this.StorageManager         = storageManager;
     this.Bookmarks                  = bookmarks;
     this.SourcesManager             = sourcesManager;
     this.Threads                    = threads;
     this.TempFilesManager           = tempFilesManager;
     this.Preprocessing              = preprocessingModel;
     this.ProgressAggregator         = progressAggregator;
     this.LogProviderFactoryRegistry = logProviderFactoryRegistry;
     this.UserDefinedFormatsManager  = userDefinedFormatsManager;
     this.ProgressAggregatorsFactory = progressAggregatorsFactory;
     this.MRU                = mru;
     this.Shutdown           = shutdown;
     this.WebViewTools       = webViewTools;
     this.Postprocessing     = postprocessingModel;
     this.PluginsManager     = pluginsManager;
     this.TraceSourceFactory = traceSourceFactory;
     this.FileSystem         = fileSystem;
 }
Exemple #10
0
 internal DownloadingStep(
     PreprocessingStepParams srcFile,
     Progress.IProgressAggregator progressAgg,
     Persistence.IWebContentCache cache,
     ICredentialsCache credCache,
     WebViewTools.IWebViewTools webBrowserDownloader,
     ILogsDownloaderConfig config,
     IStepsFactory preprocessingStepsFactory
     )
 {
     this.sourceFile = srcFile;
     this.preprocessingStepsFactory = preprocessingStepsFactory;
     this.progressAggregator        = progressAgg;
     this.cache                = cache;
     this.credCache            = credCache;
     this.webBrowserDownloader = webBrowserDownloader;
     this.config               = config;
 }
Exemple #11
0
        public static ModelObjects Create(
            ModelConfig config,
            ISynchronizationContext modelSynchronizationContext,
            Func <Persistence.IStorageManager, Preprocessing.ICredentialsCache> createPreprocessingCredentialsCache,
            Func <IShutdownSource, Persistence.IWebContentCache, ITraceSourceFactory, WebViewTools.IWebViewTools> createWebBrowserDownloader,
            Drawing.IMatrixFactory matrixFactory,
            RegularExpressions.IRegexFactory regexFactory
            )
        {
            ITraceSourceFactory traceSourceFactory = new TraceSourceFactory(config.TraceListeners);
            IShutdownSource     shutdown           = new Shutdown();
            var tracer = traceSourceFactory.CreateTraceSource("App", "model");

            Telemetry.UnhandledExceptionsReporter.SetupLogging(tracer, shutdown);
            ILogProviderFactoryRegistry  logProviderFactoryRegistry  = new LogProviderFactoryRegistry();
            IFormatDefinitionsRepository formatDefinitionsRepository = new DirectoryFormatsRepository(null);

            MultiInstance.IInstancesCounter instancesCounter = config.DisableLogjointInstancesCounting ?
                                                               (MultiInstance.IInstancesCounter) new MultiInstance.DummyInstancesCounter() :
                                                               (MultiInstance.IInstancesCounter) new MultiInstance.InstancesCounter(shutdown);
            ITempFilesManager tempFilesManager = new TempFilesManager(traceSourceFactory, instancesCounter);

            Persistence.Implementation.IStorageManagerImplementation userDataStorage = new Persistence.Implementation.StorageManagerImplementation();
            Persistence.IStorageManager storageManager = new Persistence.PersistentUserDataManager(traceSourceFactory, userDataStorage, shutdown);
            var persistentUserDataFileSystem           = Persistence.Implementation.DesktopFileSystemAccess.CreatePersistentUserDataFileSystem(config.AppDataDirectory);

            Settings.IGlobalSettingsAccessor globalSettingsAccessor = new Settings.GlobalSettingsAccessor(storageManager);
            userDataStorage.Init(
                new Persistence.Implementation.RealTimingAndThreading(),
                persistentUserDataFileSystem,
                new Persistence.PersistentUserDataManager.ConfigAccess(globalSettingsAccessor)
                );
            Telemetry.ITelemetryUploader telemetryUploader = new Telemetry.AzureTelemetryUploader(
                traceSourceFactory,
                config.TelemetryUrl,
                config.IssuesUrl
                );
            var telemetryCollectorImpl = new Telemetry.TelemetryCollector(
                storageManager,
                telemetryUploader,
                modelSynchronizationContext,
                instancesCounter,
                shutdown,
                new MemBufferTraceAccess(),
                traceSourceFactory
                );

            Telemetry.ITelemetryCollector telemetryCollector        = telemetryCollectorImpl;
            FieldsProcessor.IFactory      fieldsProcessorFactory    = new FieldsProcessor.FieldsProcessorImpl.Factory(storageManager, telemetryCollector);
            UserDefinedFormatsManager     userDefinedFormatsManager = new UserDefinedFormatsManager(
                formatDefinitionsRepository, logProviderFactoryRegistry, tempFilesManager, traceSourceFactory, regexFactory, fieldsProcessorFactory);

            RegisterUserDefinedFormats(userDefinedFormatsManager);
            RegisterPredefinedFormatFactories(logProviderFactoryRegistry, tempFilesManager, userDefinedFormatsManager, regexFactory, traceSourceFactory);
            ISynchronizationContext threadPoolSynchronizationContext = new ThreadPoolSynchronizationContext();
            IChangeNotification     changeNotification = new ChangeNotification(modelSynchronizationContext);
            IFiltersFactory         filtersFactory     = new FiltersFactory(changeNotification, regexFactory);
            IBookmarksFactory       bookmarksFactory   = new BookmarksFactory(changeNotification);
            var bookmarks = bookmarksFactory.CreateBookmarks();

            Persistence.IFirstStartDetector firstStartDetector = persistentUserDataFileSystem;
            Persistence.Implementation.IStorageManagerImplementation contentCacheStorage = new Persistence.Implementation.StorageManagerImplementation();
            contentCacheStorage.Init(
                new Persistence.Implementation.RealTimingAndThreading(),
                Persistence.Implementation.DesktopFileSystemAccess.CreateCacheFileSystemAccess(config.AppDataDirectory),
                new Persistence.ContentCacheManager.ConfigAccess(globalSettingsAccessor)
                );
            Persistence.IContentCache           contentCache          = new Persistence.ContentCacheManager(traceSourceFactory, contentCacheStorage);
            Persistence.IWebContentCacheConfig  webContentCacheConfig = config.WebContentCacheConfig;
            Preprocessing.ILogsDownloaderConfig logsDownloaderConfig  = config.LogsDownloaderConfig;
            Persistence.IWebContentCache        webContentCache       = new Persistence.WebContentCache(
                contentCache,
                webContentCacheConfig
                );
            IHeartBeatTimer heartBeatTimer = new HeartBeatTimer();

            Progress.IProgressAggregatorFactory progressAggregatorFactory = new Progress.ProgressAggregator.Factory(heartBeatTimer, modelSynchronizationContext);
            Progress.IProgressAggregator        progressAggregator        = progressAggregatorFactory.CreateProgressAggregator();

            var threadColorsLease = new ColorLease(1);
            IModelThreadsInternal modelThreads = new ModelThreads(threadColorsLease);


            MRU.IRecentlyUsedEntities recentlyUsedLogs = new MRU.RecentlyUsedEntities(
                storageManager,
                logProviderFactoryRegistry,
                telemetryCollector
                );

            ILogSourcesManager logSourcesManager = new LogSourcesManager(
                heartBeatTimer,
                modelSynchronizationContext,
                modelThreads,
                tempFilesManager,
                storageManager,
                bookmarks,
                globalSettingsAccessor,
                recentlyUsedLogs,
                shutdown,
                traceSourceFactory,
                changeNotification,
                regexFactory
                );

            telemetryCollectorImpl.SetLogSourcesManager(logSourcesManager);

            Telemetry.UnhandledExceptionsReporter.Setup(telemetryCollector, shutdown);

            IFormatAutodetect formatAutodetect = new FormatAutodetect(
                recentlyUsedLogs,
                logProviderFactoryRegistry,
                traceSourceFactory
                );

            Workspaces.Backend.IBackendAccess workspacesBackendAccess = new Workspaces.Backend.AzureWorkspacesBackend(
                traceSourceFactory,
                config.WorkspacesUrl
                );

            Workspaces.IWorkspacesManager workspacesManager = new Workspaces.WorkspacesManager(
                logSourcesManager,
                logProviderFactoryRegistry,
                storageManager,
                workspacesBackendAccess,
                tempFilesManager,
                recentlyUsedLogs,
                shutdown,
                traceSourceFactory
                );

            AppLaunch.ILaunchUrlParser launchUrlParser = new AppLaunch.LaunchUrlParser();

            Preprocessing.IExtensionsRegistry preprocessingManagerExtensionsRegistry =
                new Preprocessing.PreprocessingManagerExtentionsRegistry(logsDownloaderConfig);

            Preprocessing.ICredentialsCache preprocessingCredentialsCache = createPreprocessingCredentialsCache(
                storageManager
                );

            WebViewTools.IWebViewTools webBrowserDownloader = createWebBrowserDownloader(shutdown, webContentCache, traceSourceFactory);

            Preprocessing.IStepsFactory preprocessingStepsFactory = new Preprocessing.PreprocessingStepsFactory(
                workspacesManager,
                launchUrlParser,
                modelSynchronizationContext,
                preprocessingManagerExtensionsRegistry,
                progressAggregator,
                webContentCache,
                preprocessingCredentialsCache,
                logProviderFactoryRegistry,
                webBrowserDownloader,
                logsDownloaderConfig,
                regexFactory
                );

            Preprocessing.IManager logSourcesPreprocessings = new Preprocessing.LogSourcesPreprocessingManager(
                modelSynchronizationContext,
                formatAutodetect,
                preprocessingManagerExtensionsRegistry,
                new Preprocessing.BuiltinStepsExtension(preprocessingStepsFactory),
                telemetryCollector,
                tempFilesManager,
                logSourcesManager,
                shutdown,
                traceSourceFactory,
                changeNotification
                );

            ISearchManager searchManager = new SearchManager(
                logSourcesManager,
                progressAggregatorFactory,
                modelSynchronizationContext,
                globalSettingsAccessor,
                telemetryCollector,
                heartBeatTimer,
                changeNotification,
                traceSourceFactory
                );

            IUserDefinedSearches userDefinedSearches = new UserDefinedSearchesManager(storageManager, filtersFactory, modelSynchronizationContext);

            ISearchHistory searchHistory = new SearchHistory(storageManager.GlobalSettingsEntry, userDefinedSearches);

            IBookmarksController bookmarksController = new BookmarkController(
                bookmarks,
                modelThreads,
                heartBeatTimer
                );

            IFiltersManager filtersManager = new FiltersManager(
                filtersFactory,
                globalSettingsAccessor,
                logSourcesManager,
                shutdown
                );

            Postprocessing.IUserNamesProvider analyticsShortNames = new Postprocessing.CodenameUserNamesProvider(
                logSourcesManager
                );

            Postprocessing.TimeSeries.ITimeSeriesTypesAccess timeSeriesTypesAccess = new Postprocessing.TimeSeries.TimeSeriesTypesLoader();

            Postprocessing.ILogPartTokenFactories logPartTokenFactories = new Postprocessing.LogPartTokenFactories();

            Postprocessing.Correlation.ISameNodeDetectionTokenFactories sameNodeDetectionTokenFactories = new Postprocessing.Correlation.SameNodeDetectionTokenFactories();

            Postprocessing.IManagerInternal postprocessorsManager = new Postprocessing.PostprocessorsManager(
                logSourcesManager,
                telemetryCollector,
                modelSynchronizationContext,
                threadPoolSynchronizationContext,
                heartBeatTimer,
                progressAggregator,
                globalSettingsAccessor,
                new Postprocessing.OutputDataDeserializer(timeSeriesTypesAccess, logPartTokenFactories, sameNodeDetectionTokenFactories),
                traceSourceFactory,
                logPartTokenFactories,
                sameNodeDetectionTokenFactories,
                changeNotification
                );

            Postprocessing.Correlation.ICorrelationManager correlationManager = new Postprocessing.Correlation.CorrelationManager(
                postprocessorsManager,
                () => new LogJoint.Postprocessing.Correlation.EmbeddedSolver.EmbeddedSolver(),
                modelSynchronizationContext,
                logSourcesManager,
                changeNotification,
                telemetryCollector
                );


            Postprocessing.IModel postprocessingModel = new Postprocessing.Model(
                postprocessorsManager,
                timeSeriesTypesAccess,
                new Postprocessing.StateInspector.Model(tempFilesManager, logPartTokenFactories),
                new Postprocessing.Timeline.Model(tempFilesManager, logPartTokenFactories),
                new Postprocessing.SequenceDiagram.Model(tempFilesManager, logPartTokenFactories),
                new Postprocessing.TimeSeries.Model(timeSeriesTypesAccess),
                new Postprocessing.Correlation.Model(tempFilesManager, logPartTokenFactories, sameNodeDetectionTokenFactories)
                );

            AutoUpdate.IFactory autoUpdateFactory = new AutoUpdate.Factory(
                tempFilesManager,
                traceSourceFactory,
                instancesCounter,
                shutdown,
                modelSynchronizationContext,
                firstStartDetector,
                telemetryCollector,
                storageManager,
                changeNotification,
                config.AutoUpdateUrl,
                config.PluginsUrl
                );

            AppLaunch.ICommandLineHandler commandLineHandler = new AppLaunch.CommandLineHandler(
                logSourcesPreprocessings,
                preprocessingStepsFactory);

            Postprocessing.IAggregatingLogSourceNamesProvider logSourceNamesProvider = new Postprocessing.AggregatingLogSourceNamesProvider();

            Postprocessing.InternalTracePostprocessors.Register(
                postprocessorsManager,
                userDefinedFormatsManager,
                timeSeriesTypesAccess,
                postprocessingModel
                );

            Extensibility.IPluginsManagerInternal pluginsManager = new Extensibility.PluginsManager(
                traceSourceFactory,
                telemetryCollector,
                shutdown,
                userDefinedFormatsManager,
                autoUpdateFactory.CreatePluginsIndexUpdateDownloader(),
                new Extensibility.PluginsIndex.Factory(telemetryCollector),
                changeNotification,
                autoUpdateFactory.CreateAppUpdateDownloader()
                );

            AutoUpdate.IAutoUpdater autoUpdater = autoUpdateFactory.CreateAutoUpdater(pluginsManager);

            Model expensibilityModel = new Model(
                modelSynchronizationContext,
                changeNotification,
                webContentCache,
                contentCache,
                storageManager,
                bookmarks,
                logSourcesManager,
                modelThreads,
                tempFilesManager,
                new Preprocessing.Model(
                    logSourcesPreprocessings,
                    preprocessingStepsFactory,
                    preprocessingManagerExtensionsRegistry
                    ),
                progressAggregator,
                logProviderFactoryRegistry,
                userDefinedFormatsManager,
                recentlyUsedLogs,
                progressAggregatorFactory,
                shutdown,
                webBrowserDownloader,
                postprocessingModel,
                pluginsManager,
                traceSourceFactory
                );

            tracer.Info("model creation completed");

            return(new ModelObjects
            {
                GlobalSettingsAccessor = globalSettingsAccessor,
                InstancesCounter = instancesCounter,
                Shutdown = shutdown,
                TelemetryCollector = telemetryCollector,
                FirstStartDetector = firstStartDetector,
                LaunchUrlParser = launchUrlParser,
                ChangeNotification = changeNotification,
                BookmarksFactory = bookmarksFactory,
                LogSourcesManager = logSourcesManager,
                ModelThreads = modelThreads,
                FiltersManager = filtersManager,
                Bookmarks = bookmarks,
                SearchManager = searchManager,
                FiltersFactory = filtersFactory,
                LogSourcesPreprocessings = logSourcesPreprocessings,
                UserDefinedSearches = userDefinedSearches,
                SearchHistory = searchHistory,
                ProgressAggregatorFactory = progressAggregatorFactory,
                PreprocessingStepsFactory = preprocessingStepsFactory,
                WorkspacesManager = workspacesManager,
                RecentlyUsedLogs = recentlyUsedLogs,
                LogProviderFactoryRegistry = logProviderFactoryRegistry,
                UserDefinedFormatsManager = userDefinedFormatsManager,
                PluginFormatsManager = userDefinedFormatsManager,
                FormatDefinitionsRepository = formatDefinitionsRepository,
                TempFilesManager = tempFilesManager,
                StorageManager = storageManager,
                TelemetryUploader = telemetryUploader,
                ProgressAggregator = progressAggregator,
                PostprocessorsManager = postprocessorsManager,
                CorrelationManager = correlationManager,
                ExpensibilityEntryPoint = expensibilityModel,
                AnalyticsShortNames = analyticsShortNames,
                SynchronizationContext = modelSynchronizationContext,
                AutoUpdater = autoUpdater,
                CommandLineHandler = commandLineHandler,
                LogSourceNamesProvider = logSourceNamesProvider,
                HeartBeatTimer = heartBeatTimer,
                ThreadColorsLease = threadColorsLease,
                PluginsManager = pluginsManager,
                TraceSourceFactory = traceSourceFactory,
                MatrixFactory = matrixFactory,
                RegexFactory = regexFactory,
                FieldsProcessorFactory = fieldsProcessorFactory,
            });
        }