class DefaultAdminService implements AdminService {

    @Override
    @Transactional(propagation = Propagation.REQUIRED, transactionManager = "lightminTransactionManager")
    public void updateJobConfiguration(final JobConfiguration jobConfiguration) {
        jobConfiguration.validateForUpdate();
        try {
            final JobConfiguration existingJobConfiguration = this.jobConfigurationRepository.getJobConfiguration(jobConfiguration.getJobConfigurationId(),
                    this.springBatchLightminCoreConfigurationProperties.getApplicationName());
            if (existingJobConfiguration.getJobSchedulerConfiguration() != null) {
                final String existingBeanName = existingJobConfiguration.getJobSchedulerConfiguration().getBeanName();
                jobConfiguration.getJobSchedulerConfiguration().setBeanName(existingBeanName);
                this.jobConfigurationRepository.update(jobConfiguration,
                        this.springBatchLightminCoreConfigurationProperties.getApplicationName());
                this.schedulerService.refreshSchedulerForJob(jobConfiguration);
                if (SchedulerStatus.RUNNING.equals(jobConfiguration.getJobSchedulerConfiguration().getSchedulerStatus())) {
                    this.schedulerService.schedule(jobConfiguration.getJobSchedulerConfiguration().getBeanName(), Boolean.TRUE);
                } else {
                    log.info("Scheduler not started, no scheduling triggered!");
                }
            } else if (existingJobConfiguration.getJobListenerConfiguration() != null) {
                final String existingBeanName = existingJobConfiguration.getJobListenerConfiguration().getBeanName();
                jobConfiguration.getJobListenerConfiguration().setBeanName(existingBeanName);
                this.jobConfigurationRepository.update(jobConfiguration,
                        this.springBatchLightminCoreConfigurationProperties.getApplicationName());
                this.listenerService.refreshListenerForJob(jobConfiguration);
            }
        } catch (final NoSuchJobConfigurationException e) {
            log.error(e.getMessage());
            throw new SpringBatchLightminApplicationException(e, e.getMessage());
        }

    }

    public  DefaultAdminService(final JobConfigurationRepository jobConfigurationRepository,
                               final SchedulerService schedulerService,
                               final ListenerService listenerService,
                               final SpringBatchLightminCoreConfigurationProperties springBatchLightminCoreConfigurationProperties
    );

}