mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Moving to root below branch label
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2005 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
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();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user