class ReportJobsQuartzScheduler implements ReportJobsScheduler, InitializingBean, Diagnostic {

    @Override
    public Map<DiagnosticAttribute, DiagnosticCallback> getDiagnosticData() {
        return new DiagnosticAttributeBuilder()
                .addDiagnosticAttribute(DiagnosticAttributeBuilder.TOTAL_SCHEDULED_JOBS, new DiagnosticCallback<Integer>() {
                    @Override
                    public Integer getDiagnosticAttributeValue() {
                        Integer totalScheduledJobs = 0;
                        try {
                            totalScheduledJobs = getAllJobsOfScheduler().size();
                        } catch (SchedulerException e) {
                            // Empty Body
                        }
                        return totalScheduledJobs;
                    }
                })
                .addDiagnosticAttribute(DiagnosticAttributeBuilder.TOTAL_RUNNING_JOBS, new DiagnosticCallback<Integer>() {
                    @Override
                    public Integer getDiagnosticAttributeValue() {
                        Integer totalRunningJobs = 0;
                        try {
                            totalRunningJobs = getExecutingJobNames().size();
                        } catch (SchedulerException e) {
                            // Empty Body
                        }
                        return totalRunningJobs;
                    }
                })
                .addDiagnosticAttribute(DiagnosticAttributeBuilder.RUNNING_JOBS_LIST, new DiagnosticCallback<Map<String, Map<String, Long>>>() {
                    @Override
                    public Map<String, Map<String, Long>> getDiagnosticAttributeValue() {
                        Map<String, Map<String, Long>> runningJobList = new HashMap<String, Map<String, Long>>();
                        try {
                            List<JobExecutionContext> jobExecutionContexts = scheduler.getCurrentlyExecutingJobs();
                            if (jobExecutionContexts != null && jobExecutionContexts.size() > 0) {
                                for (JobExecutionContext jobExecutionContext : jobExecutionContexts) {
                                    JobDetail jobDetail = jobExecutionContext.getJobDetail();
                                    if (jobDetail.getKey().getGroup().equals(GROUP)) {
                                        Map<String, Long> reportUrisWithTimeExecutions = new HashMap<String, Long>();
                                        Long executionTime = System.currentTimeMillis() - jobExecutionContext.getFireTime().getTime();
                                        reportUrisWithTimeExecutions.put(((ReportExecutionJob) (jobExecutionContext).getJobInstance()).reportUnit.getURI(), executionTime/1000);
                                        runningJobList.put(jobExecutionContext.getJobDetail().getKey().getName(), reportUrisWithTimeExecutions);
                                    }
                                }
                            }
                        } catch (SchedulerException e) {
                            // Empty Body
                        }
                        return runningJobList;
                    }
                }).build();
    }

    public  ReportJobsQuartzScheduler();

}