예제 #1
0
        private DataCacheInternal createCacheInternal(
            InternalCacheUpdater cacheUpdater,
            string hostname,
            IHostProperties hostProperties,
            User user,
            SearchQueryCollection queryCollection,
            IModificationNotifier modificationNotifier,
            INetworkOperationStatusListener networkOperationStatusListener,
            bool isApprovalStatusSupported)
        {
            MergeRequestManager mergeRequestManager = new MergeRequestManager(
                _cacheContext, cacheUpdater, hostname, hostProperties, queryCollection, networkOperationStatusListener,
                isApprovalStatusSupported);
            DiscussionManager discussionManager = new DiscussionManager(
                _cacheContext, hostname, hostProperties, user, mergeRequestManager,
                modificationNotifier, networkOperationStatusListener);
            TimeTrackingManager timeTrackingManager = new TimeTrackingManager(
                hostname, hostProperties, user, discussionManager, modificationNotifier, networkOperationStatusListener);

            ProjectCache projectCache = null;

            if (_cacheContext.SupportProjectCache)
            {
                IProjectListLoader loader = new ProjectListLoader(hostname, _operator);
                projectCache = new ProjectCache(loader, _cacheContext, hostname);
            }
            UserCache userCache = null;

            if (_cacheContext.SupportUserCache)
            {
                IUserListLoader userListLoader = new UserListLoader(hostname, _operator);
                userCache = new UserCache(userListLoader, _cacheContext, hostname);
            }
            return(new DataCacheInternal(mergeRequestManager, discussionManager, timeTrackingManager, projectCache, userCache));
        }
예제 #2
0
        private DataCacheInternal createCacheInternal(
            InternalCacheUpdater cacheUpdater,
            string hostname,
            IHostProperties hostProperties,
            User user,
            DataCacheConnectionContext context)
        {
            MergeRequestManager mergeRequestManager = new MergeRequestManager(
                _dataCacheContext, cacheUpdater, hostname, hostProperties, context, _modificationNotifier);
            DiscussionManager discussionManager = new DiscussionManager(
                _dataCacheContext, hostname, hostProperties, user, mergeRequestManager, context, _modificationNotifier);
            TimeTrackingManager timeTrackingManager = new TimeTrackingManager(
                hostname, hostProperties, user, discussionManager, _modificationNotifier);

            IProjectListLoader loader = ProjectListLoaderFactory.CreateProjectListLoader(
                hostname, _operator, context, cacheUpdater);
            ProjectCache projectCache = new ProjectCache(cacheUpdater, loader, _dataCacheContext);

            return(new DataCacheInternal(mergeRequestManager, discussionManager, timeTrackingManager, projectCache));
        }