mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-06-02 17:35:18 +00:00
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2005 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
34 lines
1.1 KiB
Java
34 lines
1.1 KiB
Java
package org.alfresco.repo.node.index;
|
|
|
|
import org.quartz.Job;
|
|
import org.quartz.JobExecutionContext;
|
|
import org.quartz.JobExecutionException;
|
|
|
|
/**
|
|
* Forces a index recovery using the {@link IndexRecovery recovery component} passed
|
|
* in via the job detail.
|
|
*
|
|
* @author Derek Hulley
|
|
*/
|
|
public class IndexRecoveryJob implements Job
|
|
{
|
|
/** KEY_INDEX_RECOVERY_COMPONENT = 'indexRecoveryComponent' */
|
|
public static final String KEY_INDEX_RECOVERY_COMPONENT = "indexRecoveryComponent";
|
|
|
|
/**
|
|
* Forces a full index recovery using the {@link IndexRecovery recovery component} passed
|
|
* in via the job detail.
|
|
*/
|
|
public void execute(JobExecutionContext context) throws JobExecutionException
|
|
{
|
|
IndexRecovery indexRecoveryComponent = (IndexRecovery) context.getJobDetail()
|
|
.getJobDataMap().get(KEY_INDEX_RECOVERY_COMPONENT);
|
|
if (indexRecoveryComponent == null)
|
|
{
|
|
throw new JobExecutionException("Missing job data: " + KEY_INDEX_RECOVERY_COMPONENT);
|
|
}
|
|
// reindex
|
|
indexRecoveryComponent.reindex();
|
|
}
|
|
}
|