public class BatchJob extends GeneratedBatchJob
BatchJob is a subclass of Job, which divides the task which should be performed into
several Steps. Thus a complex task (for example a BMECat import) can be divided into several small steps
(for example article, media and price import) which are assigned to one BatchJob.
The performCronJob(CronJob) implementation of the BatchJob iterates over all pending steps and
executes each Step.Job.JobFileLogContainer, Job.SynchronicityGenericItem.GenericItemImplLocalizableItem.LocalizableItemImplExtensibleItem.ExtensibleItemImplItem.AttributeFilter, Item.AttributeMode, Item.CachedGetter, Item.CachedSetter, Item.ItemAttributeMap, Item.ItemConstraint, Item.ItemImpl, Item.JaloCachedComputationExceptionDEFAULT_INITIAL_ATTRIBUTES, STEPSCTX_CURRENTCRONJOB, CTX_CURRENTJOBACTIVE, ALTERNATIVEDATASOURCEID, CHANGERECORDINGENABLED, CODE, CRONJOBS, CRONJOBSHANDLER, EMAILADDRESS, EMAILNOTIFICATIONTEMPLATE, ERRORMODE, LOGLEVELDATABASE, LOGLEVELFILE, LOGTODATABASE, LOGTOFILE, NODEGROUP, NODEID, PRIORITY, REMOVEONEXIT, REQUESTABORT, REQUESTABORTSTEP, RESTRICTIONS, RESTRICTIONSHANDLER, RETRY, SENDEMAIL, SESSIONCONTEXTVALUES, SESSIONCURRENCY, SESSIONLANGUAGE, SESSIONUSER, SINGLEEXECUTABLE, TRIGGERS, TRIGGERSHANDLERLANGUAGE_FALLBACK_ENABLED_CREATION_TIME_INTERNAL, _MODIFIED_TIME_INTERNAL, accessorLog, CREATION_TIME, DISABLE_ATTRIBUTE_CHECK, DISABLE_ITEMCHECK_BEFORE_REMOVABLE, EVEN, FEATURE_ACCESSMAP_QUALIFIER, INITIAL_CREATION_FLAG, isJaloOnly, MODIFIED_TIME, NEGATIVE, NOT_FOUND, OWNER, PK, POSITIVE, SAVE_FROM_SERVICE_LAYER, staticTransientObjects, TYPEimpl, tenant| Constructor and Description |
|---|
BatchJob() |
| Modifier and Type | Method and Description |
|---|---|
protected Step |
addStep() |
Step |
addStep(ComposedType stepType)
Adds a
Step of the specified type to the BatchJob and returns it. |
Step |
addStep(ComposedType stepType,
Map additionalAttributes)
Adds a
Step of the specified type to the BatchJob and returns it. |
protected boolean |
canUndo(CronJob cronJob)
Returns
true, if the BatchJob can be undone using the specified CronJob. |
Collection<Step> |
getAllPreviousSteps(SessionContext ctx,
Step step)
Returns a
Collection of all predecessor Steps of the specified Step. |
Collection<Step> |
getAllPreviousSteps(Step step)
Returns a
Collection of all predecessor Steps of the specified Step. |
protected static Step |
getCurrentlyExecutingStep() |
Step |
getFirstStep()
Returns the first
Step. |
Step |
getFirstStep(SessionContext ctx)
Returns the first
Step. |
Step |
getLastStep()
Returns the last
Step. |
Step |
getLastStep(SessionContext ctx)
Returns the last
Step. |
protected Integer |
getNextSequenceNumber()
Returns the next sequence number.
|
protected Integer |
getNextSequenceNumber(SessionContext ctx)
Returns the next sequence number.
|
List<Step> |
getSteps()
Returns a
List of all Steps of the BatchJob. |
List<Step> |
getSteps(int start,
int count)
Returns a
List containing the specified range of Steps of the BatchJob. |
List<Step> |
getSteps(SessionContext ctx)
Returns a
List of all Steps of the BatchJob. |
List<Step> |
getSteps(SessionContext ctx,
int start,
int count)
Returns a
List containing the specified range of Steps of the BatchJob. |
protected static boolean |
hasCurrentlyExecutingStep() |
boolean |
isAbortable(CronJob cronJob)
Is abortable if the current step supports abort (see
Step.isAbortable(). |
protected CronJob.CronJobResult |
performCronJob(CronJob cronJob)
Performs the
BatchJob using the specified CronJob. |
void |
remove(SessionContext ctx)
First all assigned
CronJobs were removed, than the Job itself. |
protected static void |
setCurrentlyExecutingStep(Step step) |
void |
setSteps(SessionContext ctx,
List<Step> steps)
Sets the
Steps of the BatchJob and deletes all Steps which were assigned
before and which are not part of the specified Collection. |
protected CronJob.CronJobResult |
undoCronJob(CronJob cronJob)
Starts the undo-process of the
BatchJob for the specified CronJob. |
protected static void |
unsetCurrentlyExecutingStep() |
getDefaultAttributeModes, setStepscanPerform, checkRemovable, configureCronjob, createItem, createLogContext, debug, error, fatal, getConfigAttributes, getCronJobsByCode, getCronJobsByCode, getCurrentLogContainer, getEffectiveLogLevel, getNonInitialAttributes, info, isDebugEnabled, isEnabledFor, isErrorEnabled, isInfoEnabled, isPerformable, isPerformable, isUndoable, isWarnEnabled, jobIsCurrentlyRunning, log, logToFile, perform, perform, perform, prepareAfterFinishEvent, prepareBeforeStartEvent, saveToLogFile, sendFinishedEvent, sendStartEvent, setCode, setCronJobs, setCurrentLogContainer, setNonInitialAttributes, startOwnSession, stopOwnSession, switchDataSource, undo, undo, unsetAlternativeDataSource, unsetCurrentLogContainer, warnaddToRestrictions, addToRestrictions, addToTriggers, addToTriggers, getAlternativeDataSourceID, getAlternativeDataSourceID, getCode, getCode, getCronJobs, getCronJobs, getEmailAddress, getEmailAddress, getEmailNotificationTemplate, getEmailNotificationTemplate, getErrorMode, getErrorMode, getLogLevelDatabase, getLogLevelDatabase, getLogLevelFile, getLogLevelFile, getNodeGroup, getNodeGroup, getNodeID, getNodeID, getNodeIDAsPrimitive, getNodeIDAsPrimitive, getPriority, getPriority, getPriorityAsPrimitive, getPriorityAsPrimitive, getRestrictions, getRestrictions, getSessionCurrency, getSessionCurrency, getSessionLanguage, getSessionLanguage, getSessionUser, getSessionUser, getTriggers, getTriggers, isActive, isActive, isActiveAsPrimitive, isActiveAsPrimitive, isChangeRecordingEnabled, isChangeRecordingEnabled, isChangeRecordingEnabledAsPrimitive, isChangeRecordingEnabledAsPrimitive, isLogToDatabase, isLogToDatabase, isLogToDatabaseAsPrimitive, isLogToDatabaseAsPrimitive, isLogToFile, isLogToFile, isLogToFileAsPrimitive, isLogToFileAsPrimitive, isRemoveOnExit, isRemoveOnExit, isRemoveOnExitAsPrimitive, isRemoveOnExitAsPrimitive, isRequestAbort, isRequestAbort, isRequestAbortAsPrimitive, isRequestAbortAsPrimitive, isRequestAbortStep, isRequestAbortStep, isRequestAbortStepAsPrimitive, isRequestAbortStepAsPrimitive, isRetry, isRetry, isRetryAsPrimitive, isRetryAsPrimitive, isSendEmail, isSendEmail, isSendEmailAsPrimitive, isSendEmailAsPrimitive, isSingleExecutable, isSingleExecutable, isSingleExecutableAsPrimitive, isSingleExecutableAsPrimitive, removeFromRestrictions, removeFromRestrictions, removeFromTriggers, removeFromTriggers, setActive, setActive, setActive, setActive, setAlternativeDataSourceID, setAlternativeDataSourceID, setChangeRecordingEnabled, setChangeRecordingEnabled, setChangeRecordingEnabled, setChangeRecordingEnabled, setCode, setEmailAddress, setEmailAddress, setEmailNotificationTemplate, setEmailNotificationTemplate, setErrorMode, setErrorMode, setLogLevelDatabase, setLogLevelDatabase, setLogLevelFile, setLogLevelFile, setLogToDatabase, setLogToDatabase, setLogToDatabase, setLogToDatabase, setLogToFile, setLogToFile, setLogToFile, setLogToFile, setNodeGroup, setNodeGroup, setNodeID, setNodeID, setNodeID, setNodeID, setPriority, setPriority, setPriority, setPriority, setRemoveOnExit, setRemoveOnExit, setRemoveOnExit, setRemoveOnExit, setRequestAbort, setRequestAbort, setRequestAbort, setRequestAbort, setRequestAbortStep, setRequestAbortStep, setRequestAbortStep, setRequestAbortStep, setRestrictions, setRestrictions, setRetry, setRetry, setRetry, setRetry, setSendEmail, setSendEmail, setSendEmail, setSendEmail, setSessionCurrency, setSessionCurrency, setSessionLanguage, setSessionLanguage, setSessionUser, setSessionUser, setSingleExecutable, setSingleExecutable, setSingleExecutable, setSingleExecutable, setTriggers, setTriggersgetInitialPropertiesgetAllLocalizedProperties, getAllLocalizedProperties, getAllLocalizedProperties, getAllLocalizedProperties, getAllValuesSessionContext, getLocalizedProperty, getLocalizedProperty, getLocalizedPropertyInternal, getLocalizedPropertyNames, getLocalizedPropertyNames, hasLanguage, isEmptyValue, isFallbackEnabled, removeLocalizedProperty, removeLocalizedProperty, setAllLocalizedProperties, setAllLocalizedProperties, setLocalizedProperty, setLocalizedPropertycreateNonClassAccessor, getAllProperties, getAllProperties, getProperty, getProperty, getPropertyNames, getPropertyNames, removeProperty, removeProperty, setAllProperties, setAllProperties, setProperty, setPropertyaddLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addNegativePermission, addPermission, addPositivePermission, assureExtensionsLoaded, changeTypeAfterCreation, checkConstraint, checkItemPermission, checkMandatoryAttribute, checkMandatoryAttribute, checkPermission, checkPermission, clearPermission, compareTo, ctx, doAfterRemove, doBeforeRemove, equals, getAccessorFor, getAllAttributes, getAllAttributes, getAllAttributes, getAllAttributes, getAllAttributesInternal, getAllLinkedItems, getAndCheckCacheBoundItem, getAttribute, getAttribute, getCacheBoundItem, getComposedType, getComposedTypePK, getCreationTime, getCurrentlyRemovingCount, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItemsCount, getLinkedItemsCount, getLinkedItemsCount, getModificationTime, getNegativePermissions, getOwner, getPermissionMap, getPermissions, getPersistenceVersion, getPK, getPositivePermissions, getRestrictedPrincipals, getSession, getSyncObject, getTenant, getTransientObject, getTransientObjectMap, hashCode, hasRegisteredClassAccessorFor, internal_registerClassAccessorFor, internal_registerNonClassAccessorFor, invalidateLocalCaches, isAlive, isCacheBound, isCurrentlyRemoving, isCurrentlyRemoving, isEmptyRelationValue, isInCreate, isInstanceOf, isItemCheckBeforeRemoveableDisabled, isRelationLocalizationFallbackEnabled, newInstance, notifyExtensionsAfterItemCreation, notifyExtensionsBeforeItemCreation, notifyItemRemoval, readResolve, refreshRemote, registerAccessFor, registerAccessFor, registerJaloInvalidationListeners, remove, removeItemCollection, removeItemCollection, removeLinkedItems, removeLinkedItems, removeLinkedItems, removeLinkedItems, removeLinks, removePartOfItems, removePartOfItems, setAllAttributes, setAllAttributes, setAllAttributesInternal, setAllLinkedItems, setAllLinkedItems, setAllLinkedItems, setAllLinkedItems, setAttribute, setAttribute, setAttributeFromString, setAttributeFromString, setCacheBound, setComposedType, setCreationTime, setImplementation, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setModificationTime, setOwner, setPermissionsByMap, setTransientObject, setUseTA, toString, useTA, writeReplacegetImplementation, setTenantpublic void remove(SessionContext ctx) throws ConsistencyCheckException
JobCronJobs were removed, than the Job itself.remove in class Jobctx - A SessionContext objectConsistencyCheckException - if this item could not be removed for some reasonItem.remove(de.hybris.platform.jalo.SessionContext)protected static final void setCurrentlyExecutingStep(Step step)
protected static final void unsetCurrentlyExecutingStep()
protected static final Step getCurrentlyExecutingStep()
protected static final boolean hasCurrentlyExecutingStep()
public boolean isAbortable(CronJob cronJob)
Step.isAbortable().isAbortable in class JobcronJob - the current execution of this job.true if the cronjob is running and the job supports aborting via
GeneratedCronJob.setRequestAbort(boolean)Job.isAbortable(de.hybris.platform.cronjob.jalo.CronJob)public void setSteps(SessionContext ctx, List<Step> steps)
Steps of the BatchJob and deletes all Steps which were assigned
before and which are not part of the specified Collection.setSteps in class GeneratedBatchJobctx - 123steps - the List of the new Stepspublic List<Step> getSteps()
List of all Steps of the BatchJob.getSteps in class GeneratedBatchJobList of all Steps of the BatchJobpublic List<Step> getSteps(SessionContext ctx)
List of all Steps of the BatchJob.getSteps in class GeneratedBatchJobctx - 123List of all Steps of the BatchJobpublic List<Step> getSteps(int start, int count)
List containing the specified range of Steps of the BatchJob.
(Range: start -> (start + count))start - the start index of the rangecount - the number of steps in the rangeList containing the specified range of Steps of the BatchJobpublic List<Step> getSteps(SessionContext ctx, int start, int count)
List containing the specified range of Steps of the BatchJob.
(Range: start -> (start + count))ctx - 123start - the start index of the rangecount - the number of steps in the rangeList containing the specified range of Steps of the BatchJobpublic Step getFirstStep()
Step.Steppublic Step getFirstStep(SessionContext ctx)
Step.ctx - Steppublic Step getLastStep()
Step.Steppublic Step getLastStep(SessionContext ctx)
Step.ctx - Steppublic Collection<Step> getAllPreviousSteps(Step step)
Collection of all predecessor Steps of the specified Step.step - the Step whose predecessor Steps should be returnedCollection of all predecessor Steps of the specified Steppublic Collection<Step> getAllPreviousSteps(SessionContext ctx, Step step)
Collection of all predecessor Steps of the specified Step.ctx - 123step - the Step whose predecessor Steps should be returnedCollection of all predecessor Steps of the specified Stepprotected Integer getNextSequenceNumber()
protected Integer getNextSequenceNumber(SessionContext ctx)
ctx - 123protected Step addStep()
public Step addStep(ComposedType stepType)
Step of the specified type to the BatchJob and returns it.stepType - the ComposedType of the Step, which will be addedStep which have been added to the BatchJobpublic Step addStep(ComposedType stepType, Map additionalAttributes)
Step of the specified type to the BatchJob and returns it.stepType - the ComposedType of the Step, which will be addedadditionalAttributes - additionalAttributes, which will be used to the create the specified Step typeStep which have been added to the BatchJobprotected CronJob.CronJobResult undoCronJob(CronJob cronJob)
BatchJob for the specified CronJob.undoCronJob in class JobcronJob - the CronJob, which is used for the undo-processprotected CronJob.CronJobResult performCronJob(CronJob cronJob)
BatchJob using the specified CronJob. The BatchJob will
execute all pending Steps in the given order. If one Step cannot be performed, the
execution of the BatchJob is paused.performCronJob in class JobcronJob - the CronJob, which should used for executionCronJob.getFinishedResult(boolean),
CronJob.getAbortResult()protected boolean canUndo(CronJob cronJob)
true, if the BatchJob can be undone using the specified CronJob.canUndo in class JobcronJob - the CronJob to undo changes fortrue, if the BatchJob can be undone using the specified CronJobJob.canUndo(de.hybris.platform.cronjob.jalo.CronJob)Copyright © 2017 SAP SE. All Rights Reserved.