Package de.hybris.platform.jobs
Class AbstractMaintenanceJobPerformable
java.lang.Object
de.hybris.platform.servicelayer.cronjob.AbstractJobPerformable<CronJobModel>
de.hybris.platform.jobs.AbstractMaintenanceJobPerformable
- All Implemented Interfaces:
JobPerformable<CronJobModel>,TypeAwareJobPerformable
- Direct Known Subclasses:
DynamicMaintenanceJobPerformable,GenericMaintenanceJobPerformable
public abstract class AbstractMaintenanceJobPerformable
extends AbstractJobPerformable<CronJobModel>
implements TypeAwareJobPerformable
Job Performable which executes a given
MaintenanceCleanupStrategy. With the given Search result from
MaintenanceCleanupStrategy.createFetchQuery(CronJobModel) the job pages throught the resultlist (list of PKs,
small) and for each sublist (100 elements as default, modify with setPageSize(int)) the
MaintenanceCleanupStrategy.process(List) is executed. If setAbortOnError(boolean) is set to true
this performable will stop when during MaintenanceCleanupStrategy.process(List) an exception is thrown and
the performable stops with an error/aborted. When set to false (default) the exception is just logged.-
Field Summary
Fields inherited from class de.hybris.platform.servicelayer.cronjob.AbstractJobPerformable
flexibleSearchService, modelService, sessionService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract FlexibleSearchQuerygetFetchQuery(CronJobModel cronJob) getType()Must return an existing subtype ofServicelayerJobModelas String.final PerformResultperform(CronJobModel cronJob) The execution body for aServicelayerJob.abstract voidprocess(List<ItemModel> elements, CronJobModel cronJob) voidsetAbortOnError(boolean abort) If set to true the job will abort by the first thrown exception.voidsetModelResolver(ItemObjectResolver modelResolver) voidsetPageSize(int pagesize) Sets the page size for the removing part.voidsetSuspendResumeService(SuspendResumeService suspendResumeService) protected booleanMethods inherited from class de.hybris.platform.servicelayer.cronjob.AbstractJobPerformable
clearAbortRequestedIfNeeded, isAbortable, isPerformable, setFlexibleSearchService, setModelService, setSessionServiceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.hybris.platform.servicelayer.cronjob.TypeAwareJobPerformable
createDefaultJob
-
Constructor Details
-
AbstractMaintenanceJobPerformable
public AbstractMaintenanceJobPerformable()
-
-
Method Details
-
getFetchQuery
-
process
- See Also:
-
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<CronJobModel>- Specified by:
performin classAbstractJobPerformable<CronJobModel>- 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.
-
shouldAbort
protected boolean shouldAbort() -
setModelResolver
-
setPageSize
public void setPageSize(int pagesize) Sets the page size for the removing part. Default is 100. If set to 80 the elements list inprocess(List, CronJobModel)will contain 80 elements or less. -
setAbortOnError
public void setAbortOnError(boolean abort) If set to true the job will abort by the first thrown exception. When set to false (default) the exception is just logged. -
getType
Description copied from interface:TypeAwareJobPerformableMust return an existing subtype ofServicelayerJobModelas String.- Specified by:
getTypein interfaceTypeAwareJobPerformable
-
setSuspendResumeService
-