예제 #1
0
        public IList <SyncJob> GetSyncJobHistory()
        {
            List <SyncJob> runs = new List <SyncJob>();

            using (var db = this.GetDatabase())
            {
                foreach (SyncHistoryData historyData in db.History)
                {
                    runs.Add(SyncJob.FromHistoryEntry(this, historyData));
                }
            }

            return(runs);
        }
예제 #2
0
        public JobBase BeginSyncJob(
            SyncTriggerType syncTriggerType,
            AnalyzeRelationshipResult previousResult)
        {
            if (this.ActiveJob != null)
            {
                throw new InvalidOperationException("An ActiveJob is already present.");
            }

            if (previousResult == null)
            {
                AnalyzeJob newAnalyzeJob = new AnalyzeJob(this);

                newAnalyzeJob.ContinuationJob = new SyncJob(this, newAnalyzeJob.AnalyzeResult)
                {
                    TriggerType = syncTriggerType
                };

                newAnalyzeJob.Started  += this.JobStarted;
                newAnalyzeJob.Finished += this.JobFinished;

                newAnalyzeJob.ContinuationJob.Started  += this.JobStarted;
                newAnalyzeJob.ContinuationJob.Finished += this.JobFinished;

                newAnalyzeJob.Start();

                return(newAnalyzeJob);
            }

            SyncJob newJob = new SyncJob(this, previousResult)
            {
                TriggerType = syncTriggerType
            };

            newJob.Started  += this.JobStarted;
            newJob.Finished += this.JobFinished;

            newJob.Start();

            return(newJob);
        }
예제 #3
0
 public SyncJobContext(SyncJob job)
 {
     this.JobId            = job.Id;
     this.RelationshipGuid = job.Relationship.Configuration.RelationshipId;
 }