public JobDetailsData GetJobDetailsData(JobKey jobKey)
        {
            var scheduler = _schedulerProvider.Scheduler;

            if (scheduler.IsShutdown)
            {
                return null;
            }

            var job = scheduler.GetJobDetail(jobKey);
            if (job == null)
            {
                return null;
            }

            var detailsData = new JobDetailsData
            {
                PrimaryData = GetJobData(scheduler, jobKey)
            };

            foreach (var key in job.JobDataMap.Keys)
            {
                detailsData.JobDataMap.Add(key, job.JobDataMap[key]);
            }

            detailsData.JobProperties.Add("Description", job.Description);
            detailsData.JobProperties.Add("Full name", job.Key.Name);
            detailsData.JobProperties.Add("Job type", job.JobType);
            detailsData.JobProperties.Add("Durable", job.Durable);
            //detailsData.JobProperties.Add("Volatile", job.);

            return detailsData;
        }
        public JobDetailsData GetJobDetailsData(string name, string group)
        {
            var scheduler = _schedulerProvider.Scheduler;
            if (scheduler.IsShutdown)
            {
                return null;
            }

            var job = scheduler.GetJobDetail(new JobKey(name, group));
            if (job == null)
            {
                return null;
            }

            var detailsData = new JobDetailsData
            {
               PrimaryData = GetJobData(scheduler, name, group)
            };

            foreach (var key in job.JobDataMap.Keys)
            {
                var jobData = job.JobDataMap[key];
                detailsData.JobDataMap.Add(key, jobData);
            }

            detailsData.JobProperties.Add("Description", job.Description);
            detailsData.JobProperties.Add("Full name", job.Key.Name);
            detailsData.JobProperties.Add("Job type", job.JobType);
            detailsData.JobProperties.Add("Durable", job.Durable);
            detailsData.JobProperties.Add("ConcurrentExecutionDisallowed", job.ConcurrentExecutionDisallowed);
            detailsData.JobProperties.Add("PersistJobDataAfterExecution", job.PersistJobDataAfterExecution);
            detailsData.JobProperties.Add("RequestsRecovery", job.RequestsRecovery);

            return detailsData;
        }
Exemplo n.º 3
0
        public JobDetailsData GetJobDetailsData(JobKey jobKey)
        {
            var scheduler = _schedulerProvider.Scheduler;

            if (scheduler.IsShutdown)
            {
                return(null);
            }

            var job = scheduler.GetJobDetail(jobKey);

            if (job == null)
            {
                return(null);
            }

            var detailsData = new JobDetailsData
            {
                PrimaryData = GetJobData(scheduler, jobKey)
            };

            foreach (var key in job.JobDataMap.Keys)
            {
                detailsData.JobDataMap.Add(key, job.JobDataMap[key]);
            }

            detailsData.JobProperties.Add("Description", job.Description);
            //detailsData.JobProperties.Add("Full name", job.FullName);
            detailsData.JobProperties.Add("Job type", job.JobType);
            detailsData.JobProperties.Add("Durable", job.Durable);
            //detailsData.JobProperties.Add("Volatile", job.Volatile);

            return(detailsData);
        }
Exemplo n.º 4
0
        public JobDetailsData GetJobDetailsData(string name, string group)
        {
            var scheduler = _schedulerProvider.Scheduler;

            if (scheduler.IsShutdown)
            {
                return(null);
            }

            IJobDetail     job;
            JobDetailsData detailsData = new JobDetailsData
            {
                PrimaryData = GetJobData(scheduler, name, group)
            };

            try
            {
                job = scheduler.GetJobDetail(new JobKey(name, @group));
            }
            catch (Exception)
            {
                // GetJobDetail method throws exceptions for remote
                // scheduler in case when JobType requires an external
                // assembly to be referenced.
                // see https://github.com/guryanovev/CrystalQuartz/issues/16 for details

                detailsData.JobDataMap.Add("Data", "Not available for remote scheduler");
                detailsData.JobProperties.Add("Data", "Not available for remote scheduler");

                return(detailsData);
            }

            if (job == null)
            {
                return(null);
            }

            foreach (var key in job.JobDataMap.Keys)
            {
                var jobData = job.JobDataMap[key];
                detailsData.JobDataMap.Add(key, jobData);
            }

            detailsData.JobProperties.Add("Description", job.Description);
            detailsData.JobProperties.Add("Full name", job.Key.Name);
            detailsData.JobProperties.Add("Job type", GetJobType(job));
            detailsData.JobProperties.Add("Durable", job.Durable);
            detailsData.JobProperties.Add("ConcurrentExecutionDisallowed", job.ConcurrentExecutionDisallowed);
            detailsData.JobProperties.Add("PersistJobDataAfterExecution", job.PersistJobDataAfterExecution);
            detailsData.JobProperties.Add("RequestsRecovery", job.RequestsRecovery);

            return(detailsData);
        }
        public JobDetailsData GetJobDetailsData(string name, string group)
        {
            var scheduler = _schedulerProvider.Scheduler;

            if (scheduler.IsShutdown)
            {
                return(null);
            }

            IJobDetail     job;
            JobDetailsData detailsData = new JobDetailsData
            {
                PrimaryData = GetJobData(scheduler, name, group)
            };

            try
            {
                job = scheduler.GetJobDetail(new JobKey(name, @group));
            }
            catch (System.Exception)
            {
                detailsData.JobDataMap.Add("Data", "Not available for remote scheduler");
                detailsData.JobProperties.Add("Data", "Not available for remote scheduler");

                return(detailsData);
            }

            if (job == null)
            {
                return(null);
            }

            foreach (var key in job.JobDataMap.Keys)
            {
                var jobData = job.JobDataMap[key];
                detailsData.JobDataMap.Add(key, jobData);
            }
            detailsData.JobProperties.Add("Description", job.Description);
            detailsData.JobProperties.Add("Full name", job.Key.Name);
            detailsData.JobProperties.Add("Job Group", group);
            detailsData.JobProperties.Add("Job type", GetJobType(job));
            detailsData.JobProperties.Add("Durable", job.Durable);//持久性
            detailsData.JobProperties.Add("ConcurrentExecutionDisallowed", job.ConcurrentExecutionDisallowed);
            detailsData.JobProperties.Add("PersistJobDataAfterExecution", job.PersistJobDataAfterExecution);
            detailsData.JobProperties.Add("RequestsRecovery", job.RequestsRecovery);//可恢復性

            return(detailsData);
        }
Exemplo n.º 6
0
        public JobDetailsData GetJobDetailsData(string name, string group)
        {
            foreach (var scheduler in _schedulerProvider.Scheduler)
            {
                //var scheduler = _schedulerProvider.Scheduler;
                if (scheduler.IsShutdown)
                {
                    //return null;
                    continue;
                }

                var job = scheduler.GetJobDetail(new JobKey(name, group));
                if (job == null)
                {
                    //return null;
                    continue;
                }

                var detailsData = new JobDetailsData
                {
                    PrimaryData = GetJobData(scheduler, name, group)
                };

                foreach (var key in job.JobDataMap.Keys)
                {
                    var jobData = job.JobDataMap[key];
                    detailsData.JobDataMap.Add(key, jobData);
                }

                detailsData.JobProperties.Add("Description", job.Description);
                detailsData.JobProperties.Add("Full name", job.Key.Name);
                detailsData.JobProperties.Add("Job type", job.JobType);
                detailsData.JobProperties.Add("Durable", job.Durable);
                detailsData.JobProperties.Add("ConcurrentExecutionDisallowed", job.ConcurrentExecutionDisallowed);
                detailsData.JobProperties.Add("PersistJobDataAfterExecution", job.PersistJobDataAfterExecution);
                detailsData.JobProperties.Add("RequestsRecovery", job.RequestsRecovery);

                return(detailsData);
            }
            return(null);
        }
Exemplo n.º 7
0
        public JobDetailsData GetJobDetailsData(string name, string group)
        {
            var scheduler = _schedulerProvider.Scheduler;

            if (scheduler.IsShutdown)
            {
                return(null);
            }

            var job = scheduler.GetJobDetail(new JobKey(name, group));

            if (job == null)
            {
                return(null);
            }

            var detailsData = new JobDetailsData
            {
                PrimaryData = GetJobData(scheduler, name, group)
            };

            foreach (var key in job.JobDataMap.Keys)
            {
                detailsData.JobDataMap.Add(key, job.JobDataMap[key]);
            }

            detailsData.JobProperties.Add("Описание", job.Description);
            detailsData.JobProperties.Add("Полное название", job.Key.Name);
            detailsData.JobProperties.Add("Тип задачи", job.JobType);
            detailsData.JobProperties.Add("Долговечность", job.Durable);
            detailsData.JobProperties.Add("Параллельное выполнение запрещено", job.ConcurrentExecutionDisallowed);
            detailsData.JobProperties.Add("Сохранение данных задачи после выполнения", job.PersistJobDataAfterExecution);
            detailsData.JobProperties.Add("Перезапуск в случае восстановления или сбоя", job.RequestsRecovery);

            return(detailsData);
        }
 public NativeJobDetailDisplay(JobDetailsData jobDetailsData)
     : this()
 {
     this._jobDetailsData = jobDetailsData;
 }