Class AbstractRuleEngineJob
- java.lang.Object
-
- de.hybris.platform.servicelayer.cronjob.AbstractJobPerformable<RuleEngineCronJobModel>
-
- de.hybris.platform.ruleengineservices.jobs.impl.AbstractRuleEngineJob
-
- All Implemented Interfaces:
RuleEngineJobPerformable<RuleEngineCronJobModel>
,JobPerformable<RuleEngineCronJobModel>
- Direct Known Subclasses:
RuleEngineAllModulesInitJobPerformable
,RuleEngineArchiveJobPerformable
,RuleEngineCompilePublishJobPerformable
,RuleEngineModuleInitJobPerformable
,RuleEngineModuleSyncJobPerformable
,RuleEngineUndeployJobPerformable
public abstract class AbstractRuleEngineJob extends AbstractJobPerformable<RuleEngineCronJobModel> implements RuleEngineJobPerformable<RuleEngineCronJobModel>
Abstract implementation ofJobPerformable
for rule engine tasks
-
-
Field Summary
Fields Modifier and Type Field Description protected static PerformResult
ABORTED_RESULT
protected static PerformResult
FAILURE_RESULT
protected static PerformResult
SUCCESS_RESULT
-
Fields inherited from class de.hybris.platform.servicelayer.cronjob.AbstractJobPerformable
flexibleSearchService, modelService, sessionService
-
-
Constructor Summary
Constructors Constructor Description AbstractRuleEngineJob()
-
Method Summary
-
Methods inherited from class de.hybris.platform.servicelayer.cronjob.AbstractJobPerformable
clearAbortRequestedIfNeeded, isPerformable, setFlexibleSearchService, setModelService, setSessionService
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.hybris.platform.servicelayer.cronjob.JobPerformable
isPerformable
-
-
-
-
Field Detail
-
SUCCESS_RESULT
protected static final PerformResult SUCCESS_RESULT
-
FAILURE_RESULT
protected static final PerformResult FAILURE_RESULT
-
ABORTED_RESULT
protected static final PerformResult ABORTED_RESULT
-
-
Method Detail
-
perform
public PerformResult perform(RuleEngineCronJobModel cronJob)
Description copied from interface:JobPerformable
The 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:
perform
in interfaceJobPerformable<RuleEngineCronJobModel>
- Specified by:
perform
in classAbstractJobPerformable<RuleEngineCronJobModel>
- Parameters:
cronJob
- the related CronJob in whose context the execution will be performed.- Returns:
- a
PerformResult
that indicates whether theexecution
was successfully executed or not and has finished or not.
-
isAbortable
public boolean isAbortable()
Description copied from interface:JobPerformable
Checks whether the execution is implemented abortable.- Specified by:
isAbortable
in interfaceJobPerformable<RuleEngineCronJobModel>
- Overrides:
isAbortable
in classAbstractJobPerformable<RuleEngineCronJobModel>
- Returns:
- true if the execution can be aborted
-
isPerformable
public boolean isPerformable(RuleEngineCronJobModel cronJob)
Description copied from interface:RuleEngineJobPerformable
Identifies whether provided cron job can be performed- Specified by:
isPerformable
in interfaceRuleEngineJobPerformable<RuleEngineCronJobModel>
- Parameters:
cronJob
- - cron job instance- Returns:
true
in case cron job can be performed,false
- otherwise
-
performInternal
protected abstract java.util.Optional<RuleCompilerPublisherResult> performInternal(RuleEngineCronJobModel cronJob, CronJobProgressTracker tracker)
-
createCronJobProgressTracker
protected CronJobProgressTracker createCronJobProgressTracker(RuleEngineCronJobModel cronJob)
-
getJobName
protected abstract java.lang.String getJobName()
-
getPerformResult
protected PerformResult getPerformResult(RuleEngineCronJobModel cronJob, RuleCompilerPublisherResult result)
-
hasErrors
protected boolean hasErrors(RuleCompilerPublisherResult result)
-
hasPublisherErrors
protected boolean hasPublisherErrors(RuleCompilerPublisherResult result)
-
onError
protected void onError(RuleEngineCronJobModel cronJob, RuleCompilerPublisherResult ruleResults)
-
logCompilerErrorMessages
protected void logCompilerErrorMessages(RuleEngineCronJobModel cronJob, RuleCompilerPublisherResult ruleResults)
-
logPublisherErrorMessages
protected void logPublisherErrorMessages(RuleEngineCronJobModel cronJob, RuleCompilerPublisherResult ruleResults)
-
logToDatabase
protected void logToDatabase(RuleEngineCronJobModel cronJob, java.lang.String error)
-
logOnJobStart
protected void logOnJobStart()
-
logOnSuccessfulJobFinish
protected void logOnSuccessfulJobFinish()
-
logOnFailedJobFinish
protected void logOnFailedJobFinish()
-
setTrackerProgress
protected void setTrackerProgress(CronJobProgressTracker tracker, double progress)
-
getRuleMaintenanceService
protected RuleMaintenanceService getRuleMaintenanceService()
-
setRuleMaintenanceService
public void setRuleMaintenanceService(RuleMaintenanceService ruleMaintenanceService)
-
getRuleEngineJobExecutionSynchronizer
protected RuleEngineJobExecutionSynchronizer getRuleEngineJobExecutionSynchronizer()
-
setRuleEngineJobExecutionSynchronizer
public void setRuleEngineJobExecutionSynchronizer(RuleEngineJobExecutionSynchronizer ruleEngineJobExecutionSynchronizer)
-
getModelService
protected ModelService getModelService()
-
-