Package org.alfresco.solr.tracker
Class SolrTrackerScheduler
- java.lang.Object
-
- org.alfresco.solr.tracker.SolrTrackerScheduler
-
public class SolrTrackerScheduler extends java.lang.ObjectThis is a decorator of the Quartz Scheduler object to add Solr-specific functionality.- Author:
- Ahmed Owian
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.slf4j.Loggerlogprotected org.quartz.Schedulerschedulerstatic java.lang.StringSOLR_JOB_GROUP
-
Constructor Summary
Constructors Constructor Description SolrTrackerScheduler(AlfrescoCoreAdminHandler adminHandler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddeleteJobForTrackerInstance(java.lang.String coreName, Tracker tracker)Delete a Tracker Job ONLY if its exactly the same tracker instance that was passed in.voiddeleteTrackerJob(java.lang.String coreName, Tracker tracker)voiddeleteTrackerJobs(java.lang.String coreName, java.util.Collection<Tracker> trackers)protected java.lang.StringgetJobName(Tracker tracker, java.lang.String coreName)intgetJobsCount()booleanisShutdown()voidpauseAll()voidschedule(Tracker tracker, java.lang.String coreName, java.util.Properties props)Schedules individual trackers based on the solrcore properties.voidshutdown()
-
-
-
Field Detail
-
SOLR_JOB_GROUP
public static final java.lang.String SOLR_JOB_GROUP
- See Also:
- Constant Field Values
-
log
protected static final org.slf4j.Logger log
-
scheduler
protected org.quartz.Scheduler scheduler
-
-
Constructor Detail
-
SolrTrackerScheduler
public SolrTrackerScheduler(AlfrescoCoreAdminHandler adminHandler)
-
-
Method Detail
-
schedule
public void schedule(Tracker tracker, java.lang.String coreName, java.util.Properties props)
Schedules individual trackers based on the solrcore properties.- Parameters:
tracker- the tracker to bo scheduled.coreName- the owning core name.props- the core properties.
-
getJobName
protected java.lang.String getJobName(Tracker tracker, java.lang.String coreName)
-
shutdown
public void shutdown() throws org.quartz.SchedulerException- Throws:
org.quartz.SchedulerException
-
deleteTrackerJobs
public void deleteTrackerJobs(java.lang.String coreName, java.util.Collection<Tracker> trackers) throws org.quartz.SchedulerException- Throws:
org.quartz.SchedulerException
-
deleteJobForTrackerInstance
public void deleteJobForTrackerInstance(java.lang.String coreName, Tracker tracker)Delete a Tracker Job ONLY if its exactly the same tracker instance that was passed in. In theory more than one instance of a core can exist with the same core name but the scheduler stores jobs using the core name as a unique key (even though it may not be unique). This method gets the tracker instance associated with the Job and compares to see if its identical to the instance that is passed in. If they are identical then the job is deleted. Otherwise, another core (of the same name) scheduled this job, so its left alone.- Parameters:
coreName- the core name.tracker- Specific instance of a tracker
-
deleteTrackerJob
public void deleteTrackerJob(java.lang.String coreName, Tracker tracker) throws org.quartz.SchedulerException- Throws:
org.quartz.SchedulerException
-
isShutdown
public boolean isShutdown() throws org.quartz.SchedulerException- Throws:
org.quartz.SchedulerException
-
pauseAll
public void pauseAll() throws org.quartz.SchedulerException- Throws:
org.quartz.SchedulerException
-
getJobsCount
public int getJobsCount() throws org.quartz.SchedulerException- Throws:
org.quartz.SchedulerException
-
-