Class AbstractSnIndexerJob<T extends AbstractSnIndexerCronJobModel>
java.lang.Object
de.hybris.platform.servicelayer.cronjob.AbstractJobPerformable<T>
de.hybris.platform.searchservices.indexer.service.impl.AbstractSnIndexerJob<T>
- All Implemented Interfaces:
JobPerformable<T>
- Direct Known Subclasses:
FullSnIndexerJob,IncrementalSnIndexerJob
public abstract class AbstractSnIndexerJob<T extends AbstractSnIndexerCronJobModel>
extends AbstractJobPerformable<T>
Implementation of
JobPerformable for running indexer operations.-
Field Summary
Fields inherited from class de.hybris.platform.servicelayer.cronjob.AbstractJobPerformable
flexibleSearchService, modelService, sessionService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract SnIndexerRequestcreateIndexerRequest(T cronJob, SnProgressTracker progressTracker) getLastSuccessfulStartTime(T cronJob) Retrieve the lastSuccessfulStartTime from the cronjob.booleanChecks whether the execution is implemented abortable.booleanChecks whether the execution can be performed at the moment.The execution body for aServicelayerJob.protected voidsaveLastSuccessfulStartTime(T cronJob) Persist the start time of the cronjob as last successful start time.voidsetSnCronJobProgressTrackerFactory(SnCronJobProgressTrackerFactory snCronJobProgressTrackerFactory) voidsetSnIndexerCronJobDao(SnIndexerCronJobDao snIndexerCronJobDao) voidsetSnIndexerService(SnIndexerService snIndexerService) Methods inherited from class de.hybris.platform.servicelayer.cronjob.AbstractJobPerformable
clearAbortRequestedIfNeeded, setFlexibleSearchService, setModelService, setSessionService
-
Constructor Details
-
AbstractSnIndexerJob
public AbstractSnIndexerJob()
-
-
Method Details
-
isAbortable
public boolean isAbortable()Description copied from interface:JobPerformableChecks whether the execution is implemented abortable.- Specified by:
isAbortablein interfaceJobPerformable<T extends AbstractSnIndexerCronJobModel>- Overrides:
isAbortablein classAbstractJobPerformable<T extends AbstractSnIndexerCronJobModel>- Returns:
- true if the execution can be aborted
-
isPerformable
public boolean isPerformable()Description copied from interface:JobPerformableChecks whether the execution can be performed at the moment.- Specified by:
isPerformablein interfaceJobPerformable<T extends AbstractSnIndexerCronJobModel>- Overrides:
isPerformablein classAbstractJobPerformable<T extends AbstractSnIndexerCronJobModel>- Returns:
- true if the execution is ready
-
perform
Description copied from interface:JobPerformableThe execution body for aServicelayerJob. Implement here your execution logic. It can be called synchronous or asynchronous. So be aware of thread-safety. Method will return a result object saying if the execution has reached end and if it was successful.- Specified by:
performin interfaceJobPerformable<T extends AbstractSnIndexerCronJobModel>- Specified by:
performin classAbstractJobPerformable<T extends AbstractSnIndexerCronJobModel>- Parameters:
cronJob- the related CronJob in whose context the execution will be performed.- Returns:
- a
PerformResultthat indicates whether theexecutionwas successfully executed or not and has finished or not.
-
createIndexerRequest
protected abstract SnIndexerRequest createIndexerRequest(T cronJob, SnProgressTracker progressTracker) throws SnIndexerException - Throws:
SnIndexerException
-
getLastSuccessfulStartTime
Retrieve the lastSuccessfulStartTime from the cronjob. If the cronjob didn't finish successfully before, retrieve the maximum of the lastSuccessfulStartTime from the full indexing cronjobs for the sameSnIndexTypeModel. If both are not available, return an empty result.- Parameters:
cronJob- the cronjob- Returns:
- the last successful start time, or empty
-
saveLastSuccessfulStartTime
Persist the start time of the cronjob as last successful start time.- Parameters:
cronJob- the cronjob
-
getSnIndexerService
-
setSnIndexerService
-
getSnIndexerCronJobDao
-
setSnIndexerCronJobDao
-
getSnCronJobProgressTrackerFactory
-
setSnCronJobProgressTrackerFactory
public void setSnCronJobProgressTrackerFactory(SnCronJobProgressTrackerFactory snCronJobProgressTrackerFactory)
-