private void scheduleJob(ApplicationConfig config) { FlowPurgeJob flowPurgeJob = getFlowPurgeJob(config); if (flowPurgeJob.isScheduled()) { flowPurgeJob.unschedule(); } flowPurgeJob.schedule(config); }
private FlowPurgeJob getFlowPurgeJob(ApplicationConfig config) { FlowPurgeJob flowPurgeJob = flowPurgeJobs.get(config.getApplication()); if (flowPurgeJob == null) { flowPurgeJob = new FlowPurgeJob(flowManager, scheduler, application); flowPurgeJob.setFlowPurgeSchedule(config.getFlowPurgeSchedule()); flowPurgeJob.setPurgeFlowsOlderThan(config.getPurgeFlowsOlderThan()); flowPurgeJob.setDoNotPurgeErrorFlows(config.isDoNotPurgeErrorFlows()); flowPurgeJobs.put(application, flowPurgeJob); } return flowPurgeJob; }
private void executeJob(ApplicationConfig config) { FlowPurgeJob flowPurgeJob = getFlowPurgeJob(config); flowPurgeJob.execute(config); }