/** * This will schedule the sync job for the given content source. Once the scheduling is complete, the content * source's adapter will be asked to synchronize with the remote content source according to the time(s) specified * in the {@link ContentSource#getSyncSchedule() schedule}. * * <p>If the content source's sync schedule is empty, this method assumes it should not be automatically sync'ed, so * no schedule will be created, and this method simply returns.</p> * * @param contentSource provider to sync * * @throws SchedulerException if failed to schedule the job */ public void scheduleProviderSyncJob(ContentSource contentSource) throws SchedulerException { String syncSchedule = contentSource.getSyncSchedule(); if ((syncSchedule == null) || (syncSchedule.trim().length() == 0)) { getLog().debug(contentSource.toString() + " does not define a sync schedule - not scheduling."); return; } SchedulerLocal scheduler = LookupUtil.getSchedulerBean(); scheduler.scheduleCronJob(ContentProviderSyncJob.createJobName(contentSource), CONTENT_SRC_SYNC_JOB_GROUP_NAME, ContentProviderSyncJob.createJobDataMap(contentSource, null), ContentProviderSyncJob.class, true, false, syncSchedule); }