tim-connector: Modify SchedulerManager to use ConfigurationDAO instead of ConfigurationModel
Remove unneeded public method in IConfigurationModel. FEA: ItEr77S16JiraAndTimConnectorContributionIntegration
This commit is contained in:
parent
a610afa957
commit
9325470d3d
3 changed files with 6 additions and 11 deletions
|
|
@ -27,11 +27,11 @@ import java.util.Map;
|
|||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.libreplan.business.common.daos.IConnectorDAO;
|
||||
import org.libreplan.business.common.daos.IJobSchedulerConfigurationDAO;
|
||||
import org.libreplan.business.common.entities.Connector;
|
||||
import org.libreplan.business.common.entities.JobClassNameEnum;
|
||||
import org.libreplan.business.common.entities.JobSchedulerConfiguration;
|
||||
import org.libreplan.web.common.IConfigurationModel;
|
||||
import org.quartz.CronExpression;
|
||||
import org.quartz.CronTrigger;
|
||||
import org.quartz.JobExecutionContext;
|
||||
|
|
@ -44,6 +44,7 @@ import org.springframework.context.annotation.Scope;
|
|||
import org.springframework.scheduling.quartz.CronTriggerBean;
|
||||
import org.springframework.scheduling.quartz.JobDetailBean;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* Implementation of scheduler manager
|
||||
|
|
@ -66,7 +67,7 @@ public class SchedulerManager implements ISchedulerManager {
|
|||
private ApplicationContext applicationContext;
|
||||
|
||||
@Autowired
|
||||
private IConfigurationModel configurationModel;
|
||||
private IConnectorDAO connectorDAO;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -96,6 +97,7 @@ public class SchedulerManager implements ISchedulerManager {
|
|||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public void scheduleOrUnscheduleJob(
|
||||
JobSchedulerConfiguration jobSchedulerConfiguration) throws SchedulerException {
|
||||
|
||||
|
|
@ -136,10 +138,7 @@ public class SchedulerManager implements ISchedulerManager {
|
|||
* @return true if activated
|
||||
*/
|
||||
private boolean isConnectorActivated(String connectorName) {
|
||||
configurationModel.initConnectorConfiguration();
|
||||
|
||||
Connector connector = configurationModel
|
||||
.getConnectorByName(connectorName);
|
||||
Connector connector = connectorDAO.findUniqueByName(connectorName);
|
||||
if (connector == null) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -139,9 +139,7 @@ public class ConfigurationModel implements IConfigurationModel {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public void initConnectorConfiguration() {
|
||||
private void initConnectorConfiguration() {
|
||||
connectors = connectorDAO.getAll();
|
||||
forceLoadConnectors();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -195,8 +195,6 @@ public interface IConfigurationModel {
|
|||
|
||||
void setJiraConnectorTypeOfWorkHours(TypeOfWorkHours typeOfWorkHours);
|
||||
|
||||
void initConnectorConfiguration();
|
||||
|
||||
List<Connector> getConnectors();
|
||||
|
||||
Connector getConnectorByName(String name);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue