示例#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
 internal MergeRequestCreator(ProjectKey projectKey, IHostProperties hostProperties,
                              INetworkOperationStatusListener networkOperationStatusListener)
 {
     _projectKey     = projectKey;
     _hostProperties = hostProperties;
     _networkOperationStatusListener = networkOperationStatusListener;
 }
示例#3
0
 internal UserAccessor(string hostname, IHostProperties hostProperties,
                       INetworkOperationStatusListener networkOperationStatusListener)
 {
     _hostname       = hostname;
     _hostProperties = hostProperties;
     _networkOperationStatusListener = networkOperationStatusListener;
 }
示例#4
0
        internal UpdateManager(
            DataCacheContext dataCacheContext,
            string hostname,
            IHostProperties hostProperties,
            SearchQueryCollection queryCollection,
            InternalCacheUpdater cacheUpdater,
            INetworkOperationStatusListener networkOperationStatusListener,
            bool isApprovalStatusSupported)
        {
            _updateOperator         = new DataCacheOperator(hostname, hostProperties, networkOperationStatusListener);
            _mergeRequestListLoader = new MergeRequestListLoader(
                hostname, _updateOperator, cacheUpdater, null, queryCollection,
                isApprovalStatusSupported);
            _mergeRequestLoader = new MergeRequestLoader(_updateOperator, cacheUpdater,
                                                         dataCacheContext.UpdateRules.UpdateOnlyOpenedMergeRequests, isApprovalStatusSupported);
            _extLogging    = dataCacheContext.UpdateManagerExtendedLogging;
            _tagForLogging = dataCacheContext.TagForLogging;

            _cache = cacheUpdater.Cache;

            _timer = new System.Timers.Timer
            {
                Interval = dataCacheContext.UpdateRules.UpdateMergeRequestsPeriod.Value
            };
            _timer.Elapsed            += onTimer;
            _timer.SynchronizingObject = dataCacheContext.SynchronizeInvoke;
            _timer.Start();
        }
示例#5
0
 internal RepositoryAccessor(IHostProperties settings, ProjectKey projectKey,
                             INetworkOperationStatusListener networkOperationStatusListener)
 {
     _settings   = settings;
     _projectKey = projectKey;
     _networkOperationStatusListener = networkOperationStatusListener;
 }
 internal SingleProjectAccessor(ProjectKey projectKey, IHostProperties settings,
                                IModificationListener modificationListener, INetworkOperationStatusListener networkOperationStatusListener)
 {
     _projectKey                     = projectKey;
     _settings                       = settings;
     _modificationListener           = modificationListener;
     _networkOperationStatusListener = networkOperationStatusListener;
 }
示例#7
0
 internal MergeRequestAccessor(IHostProperties settings, ProjectKey projectKey,
                               IModificationListener modificationListener, INetworkOperationStatusListener networkOperationStatusListener)
 {
     _settings                       = settings;
     _projectKey                     = projectKey;
     _modificationListener           = modificationListener;
     _networkOperationStatusListener = networkOperationStatusListener;
 }
 internal ProjectAccessor(IHostProperties settings, string hostname,
                          IModificationListener modificationListener, INetworkOperationStatusListener networkOperationStatusListener)
 {
     _settings                       = settings;
     _hostname                       = hostname;
     _modificationListener           = modificationListener;
     _networkOperationStatusListener = networkOperationStatusListener;
 }
示例#9
0
 internal BaseOperator(string hostname, IHostProperties hostProperties,
                       INetworkOperationStatusListener networkOperationStatusListener)
 {
     _settings = hostProperties;
     Hostname  = hostname;
     _client   = new GitLabTaskRunner(hostname, _settings.GetAccessToken(hostname));
     _networkOperationStatusListener = networkOperationStatusListener;
 }
示例#10
0
 internal DiscussionAccessor(IHostProperties settings, MergeRequestKey mrk,
                             IModificationListener modificationListener, INetworkOperationStatusListener networkOperationStatusListener)
 {
     _settings                       = settings;
     _mrk                            = mrk;
     _modificationListener           = modificationListener;
     _networkOperationStatusListener = networkOperationStatusListener;
 }
示例#11
0
 internal MergeRequestEditor(IHostProperties hostProperties,
                             MergeRequestKey mrk, IModificationListener modificationListener,
                             INetworkOperationStatusListener networkOperationStatusListener)
 {
     _mrk                            = mrk;
     _hostProperties                 = hostProperties;
     _modificationListener           = modificationListener;
     _networkOperationStatusListener = networkOperationStatusListener;
 }
示例#12
0
 internal DiscussionEditor(MergeRequestKey mrk, string discussionId, IHostProperties hostProperties,
    IModificationListener modificationListener, INetworkOperationStatusListener networkOperationStatusListener)
 {
    _hostProperties = hostProperties;
    _mergeRequestKey = mrk;
    _discussionId = discussionId;
    _modificationListener = modificationListener;
    _networkOperationStatusListener = networkOperationStatusListener;
 }
示例#13
0
 internal TimeTracker(MergeRequestKey mrk, IHostProperties hostProperties,
                      IModificationListener modificationListener, INetworkOperationStatusListener networkOperationStatusListener)
 {
     _mergeRequestKey                = mrk;
     _hostProperties                 = hostProperties;
     _modificationListener           = modificationListener;
     _stopwatch                      = new Stopwatch();
     _networkOperationStatusListener = networkOperationStatusListener;
 }
示例#14
0
 internal DiscussionCreator(MergeRequestKey mrk, IHostProperties hostProperties,
                            User currentUser, IModificationListener modificationListener,
                            INetworkOperationStatusListener networkOperationStatusListener)
 {
     _discussionOperator = new DiscussionOperator(
         mrk.ProjectKey.HostName, hostProperties, networkOperationStatusListener);
     _mergeRequestKey      = mrk;
     _currentUser          = currentUser;
     _modificationListener = modificationListener;
 }
        public TimeTrackingManager(
            string hostname,
            IHostProperties hostProperties,
            User user,
            IDiscussionLoader discussionLoader,
            IModificationNotifier modificationNotifier,
            INetworkOperationStatusListener networkOperationStatusListener)
        {
            _operator             = new TimeTrackingOperator(hostname, hostProperties, networkOperationStatusListener);
            _currentUser          = user;
            _modificationNotifier = modificationNotifier;

            _modificationNotifier.TrackedTimeModified += onTrackedTimeModified;

            _discussionLoader = discussionLoader;
            _discussionLoader.DiscussionsLoading += preProcessDiscussions;
            _discussionLoader.DiscussionsLoaded  += processDiscussions;
        }
        internal MergeRequestManager(
            DataCacheContext dataCacheContext,
            InternalCacheUpdater cacheUpdater,
            string hostname,
            IHostProperties hostProperties,
            SearchQueryCollection queryCollection,
            INetworkOperationStatusListener networkOperationStatusListener,
            bool isApprovalStatusSupported)
        {
            _cacheUpdater         = cacheUpdater;
            _listRefreshTimestamp = DateTime.Now;

            if (dataCacheContext.UpdateRules.UpdateMergeRequestsPeriod.HasValue)
            {
                _updateManager = new UpdateManager(dataCacheContext, hostname, hostProperties,
                                                   queryCollection, _cacheUpdater, networkOperationStatusListener,
                                                   isApprovalStatusSupported);
                _updateManager.MergeRequestEvent         += onUpdate;
                _updateManager.MergeRequestListRefreshed += onListRefreshed;
                _updateManager.MergeRequestRefreshed     += onMergeRequestRefreshed;
            }
        }
        internal DiscussionManager(
            DataCacheContext dataCacheContext,
            string hostname,
            IHostProperties hostProperties,
            User user,
            IMergeRequestCache mergeRequestCache,
            IModificationNotifier modificationNotifier,
            INetworkOperationStatusListener networkOperationStatusListener)
        {
            _operator = new DiscussionOperator(hostname, hostProperties, networkOperationStatusListener);

            _parser = new DiscussionParser(this, dataCacheContext.DiscussionKeywords, user);
            _parser.DiscussionEvent += onDiscussionParserEvent;

            _mergeRequestFilterChecker = dataCacheContext.MergeRequestFilterChecker;
            _tagForLogging             = dataCacheContext.TagForLogging;

            _mergeRequestCache = mergeRequestCache;
            _mergeRequestCache.MergeRequestEvent += OnMergeRequestEvent;
            _modificationNotifier = modificationNotifier;

            _modificationNotifier.DiscussionResolved += onDiscussionResolved;
            _modificationNotifier.DiscussionModified += onDiscussionModified;

            if (dataCacheContext.UpdateRules.UpdateDiscussionsPeriod.HasValue)
            {
                _timer = new System.Timers.Timer
                {
                    Interval = dataCacheContext.UpdateRules.UpdateDiscussionsPeriod.Value
                };
                _timer.Elapsed            += onTimer;
                _timer.SynchronizingObject = dataCacheContext.SynchronizeInvoke;
                _timer.Start();

                scheduleUpdate(null /* update all merge requests cached at the moment of update processing */,
                               DiscussionUpdateType.InitialSnapshot);
            }
        }
 internal MergeRequestOperator(string host, IHostProperties settings,
                               INetworkOperationStatusListener networkOperationStatusListener)
     : base(host, settings, networkOperationStatusListener)
 {
 }
 internal DiscussionOperator(string hostname, IHostProperties settings,
                             INetworkOperationStatusListener networkOperationStatusListener)
     : base(hostname, settings, networkOperationStatusListener)
 {
 }
示例#20
0
 internal ProjectOperator(string hostname, IHostProperties hostProperties,
                          INetworkOperationStatusListener networkOperationStatusListener)
     : base(hostname, hostProperties, networkOperationStatusListener)
 {
 }
示例#21
0
 internal DataCacheOperator(string host, IHostProperties settings,
                            INetworkOperationStatusListener networkOperationStatusListener)
     : base(host, settings, networkOperationStatusListener)
 {
 }
 internal RepositoryOperator(ProjectKey projectKey, IHostProperties settings,
                             INetworkOperationStatusListener networkOperationStatusListener)
     : base(projectKey.HostName, settings, networkOperationStatusListener)
 {
     _projectname = projectKey.ProjectName;
 }
 internal TimeTrackingOperator(string hostname, IHostProperties settings,
                               INetworkOperationStatusListener networkOperationStatusListener)
     : base(hostname, settings, networkOperationStatusListener)
 {
 }