public abstract class AbstractMaintenanceJobPerformable extends AbstractJobPerformable<CronJobModel> implements TypeAwareJobPerformable
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.flexibleSearchService, modelService, sessionService| Constructor and Description |
|---|
AbstractMaintenanceJobPerformable() |
| Modifier and Type | Method and Description |
|---|---|
abstract FlexibleSearchQuery |
getFetchQuery(CronJobModel cronJob) |
java.lang.String |
getType()
Must return an existing subtype of
ServicelayerJobModel as String. |
PerformResult |
perform(CronJobModel cronJob)
The execution body for a
ServicelayerJob. |
abstract void |
process(java.util.List<ItemModel> elements,
CronJobModel cronJob) |
void |
setAbortOnError(boolean abort)
If set to true the job will abort by the first thrown exception.
|
void |
setModelResolver(ItemObjectResolver modelResolver) |
void |
setPageSize(int pagesize)
Sets the page size for the removing part.
|
clearAbortRequestedIfNeeded, isAbortable, isPerformable, setFlexibleSearchService, setModelService, setSessionServiceclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateDefaultJobpublic abstract FlexibleSearchQuery getFetchQuery(CronJobModel cronJob)
public abstract void process(java.util.List<ItemModel> elements, CronJobModel cronJob)
MaintenanceCleanupStrategy.process(List)public final PerformResult perform(CronJobModel cronJob)
JobPerformableServicelayerJob. 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.perform in interface JobPerformable<CronJobModel>perform in class AbstractJobPerformable<CronJobModel>cronJob - the related CronJob in whose context the execution will be performed.PerformResult that indicates whether the execution was successfully executed
or not and has finished or not.public void setModelResolver(ItemObjectResolver modelResolver)
public void setPageSize(int pagesize)
process(List, CronJobModel) will contain 80 elements or less.public void setAbortOnError(boolean abort)
public java.lang.String getType()
TypeAwareJobPerformableServicelayerJobModel as String.getType in interface TypeAwareJobPerformableCopyright © 2018 SAP SE. All Rights Reserved.