public class CronJob extends GeneratedCronJob
CronJob stores runtime informations, which are used by the Job/BatchJob
during execution (normal & undo). For example the JaloSession which will be used during the execution of
a Job/BatchJob used the values of the attributes SessionUser,
SessionLanguage and SessionCurrency as presets for the SessionContext.
Furthermore all informations (JobLogs,ChangeDescriptors & CronJobResult),
related to an execution of a Job are assigned to the CronJob, which was used during their
execution.| Modifier and Type | Class and Description |
|---|---|
static class |
CronJob.CronJobResult
Deprecated.
use
CronJobResult |
static class |
CronJob.CronJobThreadSettings |
GenericItem.GenericItemImplLocalizableItem.LocalizableItemImplExtensibleItem.ExtensibleItemImplItem.AttributeFilter, Item.AttributeMode, Item.CachedGetter, Item.CachedSetter, Item.ItemAttributeMap, Item.ItemConstraint, Item.ItemImpl, Item.JaloCachedComputationException| Modifier and Type | Field and Description |
|---|---|
static String |
CFG_FILTERED_CTX_ATTRIBUTES |
ACTIVE, ALTERNATIVEDATASOURCEID, CHANGERECORDINGENABLED, CHANGES, CODE, CRONJOBPENDINGSTEPSRELATION_MARKMODIFIED, CRONJOBPENDINGSTEPSRELATION_SRC_ORDERED, CRONJOBPENDINGSTEPSRELATION_TGT_ORDERED, CRONJOBPROCESSEDSTEPSRELATION_MARKMODIFIED, CRONJOBPROCESSEDSTEPSRELATION_SRC_ORDERED, CRONJOBPROCESSEDSTEPSRELATION_TGT_ORDERED, CURRENTSTEP, DEFAULT_INITIAL_ATTRIBUTES, EMAILADDRESS, EMAILNOTIFICATIONTEMPLATE, ENDTIME, ERRORMODE, FILESCOUNT, FILESDAYSOLD, FILESOPERATOR, JOB, JOBHANDLER, LOGFILES, LOGLEVELDATABASE, LOGLEVELFILE, LOGS, LOGSCOUNT, LOGSDAYSOLD, LOGSHANDLER, LOGSOPERATOR, LOGTEXT, LOGTODATABASE, LOGTOFILE, NODEGROUP, NODEID, PENDINGSTEPS, PRIORITY, PROCESSEDSTEPS, REMOVEONEXIT, REQUESTABORT, REQUESTABORTSTEP, RESULT, RETRY, RUNNINGONCLUSTERNODE, SENDEMAIL, SESSIONCONTEXTVALUES, SESSIONCURRENCY, SESSIONLANGUAGE, SESSIONUSER, SINGLEEXECUTABLE, STARTTIME, STATUS, 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 |
|---|
CronJob() |
| Modifier and Type | Method and Description |
|---|---|
static void |
activateCronJobThreadSettings(CronJob.CronJobThreadSettings settings)
Activates cronjob thread settings for the current thread.Use this to copy thread settings to another thread in
case your cronjob starts multiple threads.
|
ChangeDescriptor |
addChangeDescriptor(ComposedType changeDescriptorType,
Step forStep,
String changeType,
Item item,
String description)
Deprecated.
not supported in future
|
ChangeDescriptor |
addChangeDescriptor(ComposedType changeDescriptorType,
Step forStep,
String changeType,
Item item,
String description,
Map additionalAttributes)
Deprecated.
not supported in future
|
ChangeDescriptor |
addChangeDescriptor(ComposedType changeDescriptorType,
Step forStep,
String changeType,
PK item,
String description,
Map additionalAttributes)
Deprecated.
not supported in future
|
protected ChangeDescriptor |
addChangeDescriptor(Step forStep,
String changeType,
Item item,
String description)
Deprecated.
not supported in future
|
void |
addChangeListener(String topic,
ChangeListener listener)
Registers the specified
ChangeListener for the specified topic. |
JobLog |
addLog(String message)
Adds a loggin message to this CronJob.
|
JobLog |
addLog(String message,
EnumerationValue level)
Adds a loggin message with a given error level to this CronJob.
|
JobLog |
addLog(String message,
Step forStep)
Deprecated.
since 4.3
|
JobLog |
addLog(String message,
Step forStep,
EnumerationValue level)
Deprecated.
since 4.3
|
protected JobLog |
addLog(String message,
Step forStep,
EnumerationValue level,
boolean appendToLogFile) |
int |
addToCounter(int add)
Increases the current counter of this cronjob.
|
void |
addToPendingSteps(SessionContext ctx,
Step step)
Deprecated.
since 4.3
|
void |
addToPendingSteps(Step step)
Deprecated.
since 4.3
|
void |
addToProcessedSteps(SessionContext ctx,
Step step)
Deprecated.
since 4.3
|
void |
addToProcessedSteps(Step step)
Deprecated.
since 4.3
|
protected void |
adjustAttributes(SessionContext ctx,
Item.ItemAttributeMap attributes) |
boolean |
checkLogLevel(EnumerationValue configuredLevel,
String configProperty,
String defaultLevel) |
Level |
convertEnumToLogLevel(EnumerationValue enumvalue) |
EnumerationValue |
convertLogLevelToEnum(Level level) |
protected Item |
createItem(SessionContext ctx,
ComposedType type,
Item.ItemAttributeMap allAttributes)
Has to be implemented for each concrete subtype of item.
|
LogFile |
createNewLogFile(String fileName)
Deprecated.
use plain
LogFileModel creation, refer to wiki documentation |
void |
createRunOnceTrigger(Date date)
Deprecated.
please refer to
CronJobManager.createTrigger(CronJob, Date) |
protected JaloSession |
createSessionForCronJob(JaloSession jaloSession)
Sets the
User, Language and Currency of the specified
JaloSession to the values defined in GeneratedCronJob.getSessionUser(), GeneratedCronJob.getSessionLanguage(),
GeneratedCronJob.getSessionCurrency(). |
protected void |
currentStepDone(boolean undo)
If undo is
false the current Step is added to the list of processed Steps
and the current step of the CronJob is set to null. |
protected Map<String,Object> |
filterSessionContextValuesFromCronJob(Map<String,Object> sessionContextValues)
Session context values stored inside this cronjob are filtered for potentially harmful ones, since we cannot rule
out that they're manually changed!
|
EnumerationValue |
getAbortedStatus()
Deprecated.
use
CronJobStatus.ABORTED instead |
CronJob.CronJobResult |
getAbortResult()
Deprecated.
use
CronJobStatus.ABORTED instead |
Collection<ChangeDescriptor> |
getChanges(int start,
int count)
Deprecated.
not supported in future
|
Collection<ChangeDescriptor> |
getChanges(SessionContext ctx)
Deprecated.
not supported in future
|
Collection<ChangeDescriptor> |
getChanges(SessionContext ctx,
int start,
int count)
Deprecated.
not supported in future
|
Collection<ChangeDescriptor> |
getChanges(SessionContext ctx,
Step step)
Deprecated.
not supported in future
|
Collection<ChangeDescriptor> |
getChanges(SessionContext ctx,
Step step,
int start,
int count)
Deprecated.
not supported in future
|
Collection<ChangeDescriptor> |
getChanges(SessionContext ctx,
Step step,
String changeType)
Deprecated.
not supported in future
|
Collection<ChangeDescriptor> |
getChanges(SessionContext ctx,
Step step,
String changeType,
int start,
int count)
Deprecated.
not supported in future
|
Collection<ChangeDescriptor> |
getChanges(SessionContext ctx,
Step step,
String changeType,
int start,
int count,
boolean ascending)
Deprecated.
not supported in future
|
Collection<ChangeDescriptor> |
getChanges(SessionContext ctx,
String changeType)
Deprecated.
not supported in future
|
Collection<ChangeDescriptor> |
getChanges(SessionContext ctx,
String changeType,
int start,
int count)
Deprecated.
not supported in future
|
Collection<ChangeDescriptor> |
getChanges(Step step)
Deprecated.
not supported in future
|
Collection<ChangeDescriptor> |
getChanges(Step step,
int start,
int count)
Deprecated.
not supported in future
|
Collection<ChangeDescriptor> |
getChanges(Step step,
String changeType)
Deprecated.
not supported in future
|
Collection<ChangeDescriptor> |
getChanges(Step step,
String changeType,
int start,
int count)
Deprecated.
not supported in future
|
Collection<ChangeDescriptor> |
getChanges(Step step,
String changeType,
int start,
int count,
boolean ascending)
Deprecated.
not supported in future
|
Collection<ChangeDescriptor> |
getChanges(String changeType)
Deprecated.
not supported in future
|
Collection<ChangeDescriptor> |
getChanges(String changeType,
int start,
int count)
Deprecated.
not supported in future
|
int |
getCounter()
Provides the current counter value of this cronjob.
|
static CronJob.CronJobThreadSettings |
getCronJobThreadSettings()
Returns thread settings for currently executing cronjob.
|
protected static CronJob |
getCurrentlyExecutingCronJob() |
protected static CronJob |
getCurrentlyExecutingCronJobFailSave() |
EnumerationValue |
getDebugLogLevel()
Deprecated.
use
JobLogLevel.DEBUG instead |
EnumerationValue |
getErrorLogLevel()
Deprecated.
use
JobLogLevel.ERROR instead |
EnumerationValue |
getErrorResult()
Deprecated.
use
CronJobResult.ERROR instead |
EnumerationValue |
getFailureResult()
Deprecated.
use
CronJobResult.FAILURE instead |
EnumerationValue |
getFatalLogLevel()
Deprecated.
use
JobLogLevel.FATAL instead |
protected String |
getFinishedEmailBody(CronJob.CronJobResult cronJobResult) |
CronJob.CronJobResult |
getFinishedResult(boolean success)
Deprecated.
use
CronJobResult instead |
EnumerationValue |
getFinishedStatus()
Deprecated.
use
CronJobStatus.FINISHED instead |
EnumerationValue |
getInfoLogLevel()
Deprecated.
use
JobLogLevel.INFO instead |
Collection<LogFile> |
getLogFiles(SessionContext ctx)
Generated method - Getter of the
CronJob.logFiles attribute. |
EnumerationValue |
getLogLevelDatabase(SessionContext ctx)
Generated method - Getter of the
CronJob.logLevelDatabase attribute. |
EnumerationValue |
getLogLevelFile(SessionContext ctx)
Generated method - Getter of the
CronJob.logLevelFile attribute. |
List<JobLog> |
getLogs(SessionContext ctx,
int start,
int count)
Deprecated.
use
CronJobModel.getLogs() instead, however a strict access
is available also via
JobLogDao.findJobLogs(de.hybris.platform.cronjob.model.CronJobModel, int, boolean) |
String |
getLogText(SessionContext ctx)
Deprecated.
|
ChangeDescriptor |
getMostRecentChange(Step step,
String changeType)
Deprecated.
not supported in future
|
protected Integer |
getNextChangeNumber(ComposedType changeDescriptorType)
Deprecated.
not supported in future
|
CronJob.CronJobResult |
getPausedResult()
Deprecated.
use
CronJobStatus.PAUSED instead |
EnumerationValue |
getPausedStatus()
Deprecated.
use
CronJobStatus.PAUSED instead |
protected CronJobNotificationTemplateContext |
getRendererNotificationContext()
Gets filled context object used by velocity to access CronJob's significant data.
|
EnumerationValue |
getRunningRestartStatus()
Deprecated.
use
CronJobStatus.RUNNINGRESTART instead |
EnumerationValue |
getRunningStatus()
Deprecated.
use
CronJobStatus.RUNNING instead |
EnumerationValue |
getSuccessResult()
Deprecated.
use
CronJobResult.SUCCESS instead |
String |
getTimeTable()
Deprecated.
|
String |
getTimeTable(SessionContext ctx)
Deprecated.
use
CronJobModel.getTimeTable() instead. |
CronJob.CronJobResult |
getUndoFinishedResult(boolean success)
Deprecated.
no counterpart since 4.3
|
EnumerationValue |
getUnknownLogLevel()
Deprecated.
use
JobLogLevel.UNKNOWN instead |
EnumerationValue |
getUnknownResult()
Deprecated.
use
CronJobResult.UNKNOWN instead |
EnumerationValue |
getUnknownStatus()
Deprecated.
use
CronJobStatus.UNKNOWN instead |
EnumerationValue |
getWarnLogLevel()
Deprecated.
use
JobLogLevel.WARNING instead |
protected static boolean |
hasCurrentlyExecutingCronJob() |
boolean |
isAbortable()
|
boolean |
isEnabledFor(Level level)
Checks if the CronJob is enabled for logging with given log level.
|
boolean |
isFinished()
|
boolean |
isPaused()
|
boolean |
isRunning()
|
boolean |
isRunningRestart()
|
boolean |
mustRunOnOtherNode()
Tells whether or not this cronjob must be run on another node.
|
protected void |
notifyChangeListeners(ChangeEvent event)
Notifies all
ChangeListeners, which are registered for the topic of the specified event. |
void |
remove(SessionContext ctx)
Removes this item.
|
void |
removeAllChangeListener()
Removes all registered
ChangeListeners. |
void |
removeChangeListener(String topic,
ChangeListener listener)
Removes the registration of specified
ChangeListener for the specified topic. |
void |
resetCounter()
Resets the transient counter of this cronjob.
|
protected void |
resetFinishedCronJob()
Reset the
CronJob. |
void |
sendEmail(CronJob.CronJobResult cronJobResult)
Sends a
CronJobResult per email. |
protected void |
setAborted()
Deprecated.
|
void |
setCronJobResult(CronJob.CronJobResult res)
Deprecated.
no counterpart since 4.3
|
protected static void |
setCurrentlyExecutingCronJob(CronJob cronjob) |
protected void |
setCurrentStep(Step step,
boolean undo)
Sets the current
|
void |
setEndTime(Date end)
Sets the end time.
|
void |
setIsEnabledForCheckDifference(long diff)
Sets the difference between the point of times where the cache of the
isEnabledFor(Level) will be
reseted. |
protected void |
setJob(SessionContext ctx,
Job job)
Generated method - Setter of the
CronJob.job attribute. |
void |
setLogFiles(SessionContext ctx,
Collection<LogFile> param)
Generated method - Setter of the
CronJob.logFiles attribute. |
void |
setNodeGroup(SessionContext ctx,
String value)
Generated method - Setter of the
CronJob.nodeGroup attribute. |
void |
setNodeID(SessionContext ctx,
Integer value)
Generated method - Setter of the
CronJob.nodeID attribute. |
void |
setPaused()
Deprecated.
there is no counterpart in service layer
|
void |
setRequestAbort(SessionContext ctx,
Boolean abortRequested)
Sets the abort flag to the specified value.
|
void |
setResult(EnumerationValue result)
Sets the result.
|
protected void |
setRunning()
Deprecated.
there is no strict counterpart in servicelayer however you can use
CronJobService.performCronJob(de.hybris.platform.cronjob.model.CronJobModel, boolean)
instead to set status for given cronJob to RUNNING |
protected void |
setRunningRestart()
Deprecated.
there is no counterpart in service layer
|
void |
setStartTime(Date start)
Sets the end time.
|
void |
setStatus(EnumerationValue status)
Sets the status.
|
String |
toString()
Returns the
String representation of this item. |
void |
tryToStop(long maxWait)
Deprecated.
|
static void |
unsetCronJobThreadSettings(CronJob.CronJobThreadSettings settings)
Deactivates cronjob thread settings for the current thread.
|
protected static void |
unsetCurrentlyExecutingCronJob() |
addToTriggers, addToTriggers, getAlternativeDataSourceID, getAlternativeDataSourceID, getChanges, getCode, getCode, getCurrentStep, getCurrentStep, getDefaultAttributeModes, getEmailAddress, getEmailAddress, getEmailNotificationTemplate, getEmailNotificationTemplate, getEndTime, getEndTime, getErrorMode, getErrorMode, getFilesCount, getFilesCount, getFilesCountAsPrimitive, getFilesCountAsPrimitive, getFilesDaysOld, getFilesDaysOld, getFilesDaysOldAsPrimitive, getFilesDaysOldAsPrimitive, getFilesOperator, getFilesOperator, getJob, getJob, getLogFiles, getLogLevelDatabase, getLogLevelFile, getLogs, getLogs, getLogsCount, getLogsCount, getLogsCountAsPrimitive, getLogsCountAsPrimitive, getLogsDaysOld, getLogsDaysOld, getLogsDaysOldAsPrimitive, getLogsDaysOldAsPrimitive, getLogsOperator, getLogsOperator, getLogText, getNodeGroup, getNodeGroup, getNodeID, getNodeID, getNodeIDAsPrimitive, getNodeIDAsPrimitive, getPendingSteps, getPendingSteps, getPendingStepsCount, getPendingStepsCount, getPriority, getPriority, getPriorityAsPrimitive, getPriorityAsPrimitive, getProcessedSteps, getProcessedSteps, getProcessedStepsCount, getProcessedStepsCount, getResult, getResult, getRunningOnClusterNode, getRunningOnClusterNode, getRunningOnClusterNodeAsPrimitive, getRunningOnClusterNodeAsPrimitive, getSessionCurrency, getSessionCurrency, getSessionLanguage, getSessionLanguage, getSessionUser, getSessionUser, getStartTime, getStartTime, getStatus, getStatus, 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, removeFromPendingSteps, removeFromPendingSteps, removeFromProcessedSteps, removeFromProcessedSteps, removeFromTriggers, removeFromTriggers, setActive, setActive, setActive, setActive, setAlternativeDataSourceID, setAlternativeDataSourceID, setChangeRecordingEnabled, setChangeRecordingEnabled, setChangeRecordingEnabled, setChangeRecordingEnabled, setCode, setCode, setEmailAddress, setEmailAddress, setEmailNotificationTemplate, setEmailNotificationTemplate, setEndTime, setErrorMode, setErrorMode, setFilesCount, setFilesCount, setFilesCount, setFilesCount, setFilesDaysOld, setFilesDaysOld, setFilesDaysOld, setFilesDaysOld, setFilesOperator, setFilesOperator, setJob, setLogFiles, setLogLevelDatabase, setLogLevelDatabase, setLogLevelFile, setLogLevelFile, setLogsCount, setLogsCount, setLogsCount, setLogsCount, setLogsDaysOld, setLogsDaysOld, setLogsDaysOld, setLogsDaysOld, setLogsOperator, setLogsOperator, setLogToDatabase, setLogToDatabase, setLogToDatabase, setLogToDatabase, setLogToFile, setLogToFile, setLogToFile, setLogToFile, setNodeGroup, setNodeID, setNodeID, setNodeID, setPendingSteps, setPendingSteps, setPriority, setPriority, setPriority, setPriority, setProcessedSteps, setProcessedSteps, setRemoveOnExit, setRemoveOnExit, setRemoveOnExit, setRemoveOnExit, setRequestAbort, setRequestAbort, setRequestAbort, setRequestAbortStep, setRequestAbortStep, setRequestAbortStep, setRequestAbortStep, setResult, setRetry, setRetry, setRetry, setRetry, setRunningOnClusterNode, setRunningOnClusterNode, setRunningOnClusterNode, setRunningOnClusterNode, setSendEmail, setSendEmail, setSendEmail, setSendEmail, setSessionCurrency, setSessionCurrency, setSessionLanguage, setSessionLanguage, setSessionUser, setSessionUser, setSingleExecutable, setSingleExecutable, setSingleExecutable, setSingleExecutable, setStartTime, setStatus, setTriggers, setTriggersgetInitialProperties, getNonInitialAttributesgetAllLocalizedProperties, 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, checkRemovable, 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, setNonInitialAttributes, setOwner, setPermissionsByMap, setTransientObject, setUseTA, useTA, writeReplacegetImplementation, setTenantpublic static final String CFG_FILTERED_CTX_ATTRIBUTES
protected static final void setCurrentlyExecutingCronJob(CronJob cronjob)
protected static final void unsetCurrentlyExecutingCronJob()
protected static final CronJob getCurrentlyExecutingCronJob()
protected static final CronJob getCurrentlyExecutingCronJobFailSave()
protected static boolean hasCurrentlyExecutingCronJob()
protected Item createItem(SessionContext ctx, ComposedType type, Item.ItemAttributeMap allAttributes) throws JaloBusinessException
ItemComposedType.newInstance(Map).
In case this method uses any of the attribute values during creation it is required to override
Item.getNonInitialAttributes(SessionContext, ItemAttributeMap) too.
Sn example:
public static final String MY_ATTRIBUTE = "someAttribute"; ... protected Item createItem(SessionContext
ctx, ComposedType type, Map allAttributes ) throws JaloBusinessException { MyManager man = ... return
man.createMyItem( (String)allAttributes.get(MY_ATTRIBUTE) );
// here MY_ATTRIBUTE is used for creation, so it must not be set again } protected Map getNonInitialAttributes(
SessionContext ctx, Map allAttributes ) { // let superclass remove its own initial attributes Map ret =
super.getNonInitialAttributes( ctx, allAttributes );
// remove MY_ATTRIBUTE from all attributes since if has already been set ret.remove(MY_ATTRIBUTE); return ret; }
createItem in class GeneratedCronJobctx - the current session context which this item is created withintype - the actual item type ( since subtypes may not provide a own jalo class this may be different from the
type which this method was implemented for )JaloBusinessException - indicates an error during creation - any changes will be rollbackedprotected void adjustAttributes(SessionContext ctx, Item.ItemAttributeMap attributes)
protected void setJob(SessionContext ctx, Job job)
GeneratedCronJobCronJob.job attribute.setJob in class GeneratedCronJobjob - the job - References to the Job assigned to the CronJobpublic void remove(SessionContext ctx) throws ConsistencyCheckException
Item
This method is using the following attributes of the given SessionContext:
| CacheUsage | Language | StagingMethod | ||
|---|---|---|---|---|
| n/a (this is a setter method) | no, language doesn't matter for removal | yes if called on a StageableItem, no otherwise |
remove in class Itemctx - A SessionContext objectConsistencyCheckException - if this item could not be removed for some reasonpublic void resetCounter()
getCounter(),
addToCounter(int)public int getCounter()
addToCounter(int),
resetCounter()public int addToCounter(int add)
add - the amount to addgetCounter(),
resetCounter()public JobLog addLog(String message)
message - The logging message@Deprecated public JobLog addLog(String message, Step forStep)
Step to this CronJob.message - The logging messageforStep - The Step this message belongs topublic JobLog addLog(String message, EnumerationValue level)
message - The logging messagelevel - The error level@Deprecated public JobLog addLog(String message, Step forStep, EnumerationValue level)
Step to this CronJob.message - The logging messageforStep - The Step this message belongs tolevel - The error levelpublic EnumerationValue convertLogLevelToEnum(Level level)
public Level convertEnumToLogLevel(EnumerationValue enumvalue)
protected JobLog addLog(String message, Step forStep, EnumerationValue level, boolean appendToLogFile)
public EnumerationValue getLogLevelDatabase(SessionContext ctx)
GeneratedCronJobCronJob.logLevelDatabase attribute.getLogLevelDatabase in class GeneratedCronJobpublic EnumerationValue getLogLevelFile(SessionContext ctx)
GeneratedCronJobCronJob.logLevelFile attribute.getLogLevelFile in class GeneratedCronJobpublic boolean checkLogLevel(EnumerationValue configuredLevel, String configProperty, String defaultLevel)
public void setIsEnabledForCheckDifference(long diff)
isEnabledFor(Level) will be
reseted.diff - the time difference in mspublic final boolean isEnabledFor(Level level)
setIsEnabledForCheckDifference(long).level - log level to check@Deprecated public String getLogText(SessionContext ctx)
CronJobService.getLogsAsText(de.hybris.platform.cronjob.model.CronJobModel)
insteadString representation of the last 500 JobLogs of the CronJob.getLogText in class GeneratedCronJobctx - the SessionContext, which will be usedString representation of the last 500 JobLogs of the CronJob@Deprecated public List<JobLog> getLogs(SessionContext ctx, int start, int count)
CronJobModel.getLogs() instead, however a strict access
is available also via
JobLogDao.findJobLogs(de.hybris.platform.cronjob.model.CronJobModel, int, boolean)JobLogs as a Collection
. The JobLogs are ordered by their creation time.ctx - the SessionContext, which will be usedstart - start index of the rangecount - number of elements in the rangeJobLogs as a Collection@Deprecated public Collection<ChangeDescriptor> getChanges(SessionContext ctx)
Collection of all ChangeDescriptors which are assigned to the
CronJob. If the number of ChangeDescriptors is very high, consider using
getChanges(SessionContext, int, int) method.getChanges in class GeneratedCronJobctx - the SessionContext, which will be usedCollection of all ChangeDescriptors which are assigned to the
CronJob@Deprecated public Collection<ChangeDescriptor> getChanges(SessionContext ctx, Step step)
Collection of all ChangeDescriptors which are assigned to the
CronJob and the specified Step. If the number of ChangeDescriptors is very high,
consider using getChanges(SessionContext, Step, int, int) method.ctx - the SessionContext, which will be usedstep - the Step, whose ChangeDescriptors should be returnedCollection of all ChangeDescriptors which are assigned to the
CronJob and the specified Step@Deprecated public Collection<ChangeDescriptor> getChanges(Step step)
Collection of all ChangeDescriptors which are assigned to the
CronJob and the specified Step. If the number of ChangeDescriptors is very high,
consider using getChanges(SessionContext, Step, int, int) method.step - the Step, whose ChangeDescriptors should be returnedCollection of all ChangeDescriptors which are assigned to the
CronJob and the specified Step@Deprecated public Collection<ChangeDescriptor> getChanges(String changeType)
Collection of all ChangeDescriptors with the specified changeType
and which are assigned to the CronJob. If the number of ChangeDescriptors is very high, consider
using getChanges(String, int, int).changeType - the changeTypeCollection of all ChangeDescriptors with the specified changeType
and which are assigned to the CronJob. If the number of ChangeDescriptors is very high,
consider using getChanges(String, int, int)@Deprecated public Collection<ChangeDescriptor> getChanges(SessionContext ctx, String changeType)
Collection of all ChangeDescriptors with the specified changeType
and which are assigned to the CronJob. If the number of ChangeDescriptors is very high, consider
using getChanges(String, int, int).ctx - the SessionContext, which will be usedchangeType - the changeTypeCollection of all ChangeDescriptors with the specified changeType
and which are assigned to the CronJob. If the number of ChangeDescriptors is very high,
consider using getChanges(String, int, int)@Deprecated public Collection<ChangeDescriptor> getChanges(Step step, String changeType)
Collection of all ChangeDescriptors with the specified changeType
and which are assigned to the CronJob and the specified Step.step - the Step, whose ChangeDescriptors should be returnedchangeType - the changeTypeCollection of all ChangeDescriptors which are assigned to the
CronJob and the specified Step@Deprecated public Collection<ChangeDescriptor> getChanges(SessionContext ctx, Step step, String changeType)
Collection of all ChangeDescriptors with the specified changeType
and which are assigned to the CronJob and the specified Step.ctx - the SessionContext, which will be usedstep - the Step, whose ChangeDescriptors should be returnedchangeType - the changeTypeCollection of all ChangeDescriptors which are assigned to the
CronJob and the specified Step@Deprecated public Collection<ChangeDescriptor> getChanges(int start, int count)
ChangeDescriptors as a
Collection. The ChangeDescriptors are ordered by their creation time.start - start index of the rangecount - number of elements in the rangeChangeDescriptors as a
Collection@Deprecated public Collection<ChangeDescriptor> getChanges(SessionContext ctx, int start, int count)
ChangeDescriptors as a
Collection. The ChangeDescriptors are ordered by their creation time.ctx - the SessionContext, which will be usedstart - start index of the rangecount - number of elements in the rangeChangeDescriptors as a
Collection@Deprecated public Collection<ChangeDescriptor> getChanges(Step step, int start, int count)
ChangeDescriptors as a
Collection which are assigned to the specified Step. The ChangeDescriptors
are ordered by their creation time.step - the Step, whose ChangeDescriptors should be returnedstart - start index of the rangecount - number of elements in the rangeChangeDescriptors as a
Collection@Deprecated public Collection<ChangeDescriptor> getChanges(SessionContext ctx, Step step, int start, int count)
ChangeDescriptors as a
Collection which are assigned to the specified Step. The ChangeDescriptors
are ordered by their creation time.ctx - the SessionContext, which will be usedstep - the Step, whose ChangeDescriptors should be returnedstart - start index of the rangecount - number of elements in the rangeChangeDescriptors as a
Collection@Deprecated public Collection<ChangeDescriptor> getChanges(String changeType, int start, int count)
ChangeDescriptors as a
Collection which have the specified changeType. The ChangeDescriptors are ordered by
their creation time.changeType - the changeTypestart - start index of the rangecount - number of elements in the rangeChangeDescriptors as a
Collection@Deprecated public Collection<ChangeDescriptor> getChanges(SessionContext ctx, String changeType, int start, int count)
ChangeDescriptors as a
Collection which have the specified changeType. The ChangeDescriptors are ordered by
their creation time.ctx - the SessionContext, which will be usedchangeType - the changeTypestart - start index of the rangecount - number of elements in the rangeChangeDescriptors as a
Collection@Deprecated public Collection<ChangeDescriptor> getChanges(Step step, String changeType, int start, int count)
ChangeDescriptors as a
Collection which have the specified changeType and are assigned to the specified Step.
The ChangeDescriptors are ordered by their creation time.step - the Step, whose ChangeDescriptors should be returnedchangeType - the changeTypestart - start index of the rangecount - number of elements in the rangeChangeDescriptors as a
Collection@Deprecated public Collection<ChangeDescriptor> getChanges(SessionContext ctx, Step step, String changeType, int start, int count)
ChangeDescriptors as a
Collection which have the specified changeType and are assigned to the specified Step.
The ChangeDescriptors are ordered by their creation time.ctx - the SessionContext, which will be usedstep - the Step, whose ChangeDescriptors should be returnedchangeType - the changeTypestart - start index of the rangecount - number of elements in the rangeChangeDescriptors as a
Collection@Deprecated public Collection<ChangeDescriptor> getChanges(Step step, String changeType, int start, int count, boolean ascending)
ChangeDescriptors as a
Collection which have the specified changeType and are assigned to the specified Step.
The ChangeDescriptors are ordered by their creation time.step - the Step, whose ChangeDescriptors should be returnedchangeType - the changeTypestart - start index of the rangecount - number of elements in the rangeascending - order of elements by sequencenumberChangeDescriptors as a
Collection@Deprecated public Collection<ChangeDescriptor> getChanges(SessionContext ctx, Step step, String changeType, int start, int count, boolean ascending)
ChangeDescriptors as a
Collection which have the specified changeType and are assigned to the specified Step.
The ChangeDescriptors are ordered by their creation time.ctx - the SessionContext, which will be usedstep - the Step, whose ChangeDescriptors should be returnedchangeType - the changeTypestart - start index of the rangecount - number of elements in the rangeascending - order of elements by sequencenumberChangeDescriptors as a
Collection@Deprecated public ChangeDescriptor getMostRecentChange(Step step, String changeType)
ChangeDescriptor of the CronJob which is assigned to the specified
Step and has the specified changeType.step - the Step, whose ChangeDescriptors should be returnedchangeType - The change typeChangeDescriptor of the CronJob which is assigned to the specified
Step and has the specified changeType@Deprecated protected ChangeDescriptor addChangeDescriptor(Step forStep, String changeType, Item item, String description)
ChangeDescriptor with the specified Step, changeType, Item
and description.forStep - the Step of the new ChangeDescriptorchangeType - the changeType of the new ChangeDescriptoritem - the Item of the new ChangeDescriptordescription - the description of the new ChangeDescriptorChangeDescriptor@Deprecated protected Integer getNextChangeNumber(ComposedType changeDescriptorType)
changeDescriptorType - the changeDescriptorType@Deprecated public ChangeDescriptor addChangeDescriptor(ComposedType changeDescriptorType, Step forStep, String changeType, Item item, String description)
ChangeDescriptor with the specified Step, changeType, Item
and description.changeDescriptorType - the changeDescriptorTypeforStep - the Step of the new ChangeDescriptorchangeType - the changeType of the new ChangeDescriptoritem - the Item of the new ChangeDescriptordescription - the description of the new ChangeDescriptorChangeDescriptor@Deprecated public ChangeDescriptor addChangeDescriptor(ComposedType changeDescriptorType, Step forStep, String changeType, Item item, String description, Map additionalAttributes)
ChangeDescriptor with the specified Step, changeType, Item
and description.changeDescriptorType - the changeDescriptorTypeforStep - the Step of the new ChangeDescriptorchangeType - the changeType of the new ChangeDescriptoritem - the Item of the new ChangeDescriptordescription - the description of the new ChangeDescriptoradditionalAttributes - the additional attribute values for the specified changeDescriptorTypeChangeDescriptor@Deprecated public ChangeDescriptor addChangeDescriptor(ComposedType changeDescriptorType, Step forStep, String changeType, PK item, String description, Map additionalAttributes)
ChangeDescriptor with the specified Step, changeType, Item
and description.changeDescriptorType - the changeDescriptorTypeforStep - the Step of the new ChangeDescriptorchangeType - the changeType of the new ChangeDescriptoritem - the Item PK of the new ChangeDescriptordescription - the description of the new ChangeDescriptoradditionalAttributes - the additional attribute values for the specified changeDescriptorTypeChangeDescriptorpublic void setStatus(EnumerationValue status)
setStatus in class GeneratedCronJobstatus - the new statuspublic void setResult(EnumerationValue result)
setResult in class GeneratedCronJobresult - the new resultpublic void setStartTime(Date start)
setStartTime in class GeneratedCronJobstart - the new start timepublic void setEndTime(Date end)
setEndTime in class GeneratedCronJobend - the new end timeprotected void setCurrentStep(Step step, boolean undo)
step - undo - protected void currentStepDone(boolean undo)
false the current Step is added to the list of processed Steps
and the current step of the CronJob is set to null. If undo is true, the
current Step is added to the begining of the list of pending Steps and the current step
of the CronJob is set to null.undo - true if in undo mode, false if in normal mode.public String toString()
ItemString representation of this item. This is by default the representation of the primary
key of this item.@Deprecated public EnumerationValue getFatalLogLevel()
JobLogLevel.FATAL insteadEnumerationValue for log level FATAL.EnumerationValue for log level FATAL@Deprecated public EnumerationValue getErrorLogLevel()
JobLogLevel.ERROR insteadEnumerationValue for log level ERROR.EnumerationValue for log level ERROR@Deprecated public EnumerationValue getWarnLogLevel()
JobLogLevel.WARNING insteadEnumerationValue for log level WARNING.EnumerationValue for log level WARNING@Deprecated public EnumerationValue getInfoLogLevel()
JobLogLevel.INFO insteadEnumerationValue for log level INFO.EnumerationValue for log level INFO@Deprecated public EnumerationValue getDebugLogLevel()
JobLogLevel.DEBUG insteadEnumerationValue for log level DEBUG.EnumerationValue for log level DEBUG@Deprecated public EnumerationValue getUnknownLogLevel()
JobLogLevel.UNKNOWN insteadEnumerationValue for log level UNKNOWN.EnumerationValue for log level UNKNOWN@Deprecated public EnumerationValue getFinishedStatus()
CronJobStatus.FINISHED insteadEnumerationValue for CronJob status FINISHED.EnumerationValue for CronJob status FINISHED@Deprecated public EnumerationValue getRunningStatus()
CronJobStatus.RUNNING insteadEnumerationValue for CronJob status RUNNING.EnumerationValue for CronJob status RUNNING@Deprecated public EnumerationValue getRunningRestartStatus()
CronJobStatus.RUNNINGRESTART insteadEnumerationValue for CronJob status RUNNINGRESTART.EnumerationValue for CronJob status RUNNINGRESTART@Deprecated public EnumerationValue getPausedStatus()
CronJobStatus.PAUSED insteadEnumerationValue for CronJob status PAUSED.EnumerationValue for CronJob status PAUSED@Deprecated public EnumerationValue getAbortedStatus()
CronJobStatus.ABORTED insteadEnumerationValue for CronJob status ABORTED.EnumerationValue for CronJob status ABORTED@Deprecated public EnumerationValue getUnknownStatus()
CronJobStatus.UNKNOWN insteadEnumerationValue for CronJob status UNKNOWN.EnumerationValue for CronJob status UNKNOWN@Deprecated public EnumerationValue getErrorResult()
CronJobResult.ERROR insteadEnumerationValue for CronJob result ERROR.EnumerationValue for CronJob result ERROR@Deprecated public EnumerationValue getFailureResult()
CronJobResult.FAILURE insteadEnumerationValue for CronJob result FAILURE.EnumerationValue for CronJob result FAILURE@Deprecated public EnumerationValue getSuccessResult()
CronJobResult.SUCCESS insteadEnumerationValue for CronJob result SUCCESS.EnumerationValue for CronJob result SUCCESS@Deprecated public EnumerationValue getUnknownResult()
CronJobResult.UNKNOWN insteadEnumerationValue for CronJob result UNKNOWN.EnumerationValue for CronJob result UNKNOWN@Deprecated public void tryToStop(long maxWait) throws JaloInvalidParameterException
CronJobService.requestAbortCronJob(de.hybris.platform.cronjob.model.CronJobModel)
insteadmaxWait - the maximum time to wait for the cronjob to abortJaloInvalidParameterException - if the assoziated job does not support abort@Deprecated public boolean isRunning()
true if the CronJob is currently running.true if the CronJob is currently running@Deprecated public boolean isRunningRestart()
true if the CronJob has been restarted and is currently running.true if the CronJob has been restarted and is currently running@Deprecated public boolean isPaused()
true if the CronJob is currently paused.true if the CronJob is currently paused@Deprecated public boolean isFinished()
true if the CronJob has been finished.true if the CronJob has been finished@Deprecated protected void setRunning() throws IllegalStateException
CronJobService.performCronJob(de.hybris.platform.cronjob.model.CronJobModel, boolean)
instead to set status for given cronJob to RUNNINGCronJob to RUNNING.IllegalStateException - if the status of the CronJob is already RUNNING@Deprecated protected void setRunningRestart() throws IllegalStateException
CronJob to RUNNINGRESTART.IllegalStateException - if the status of the CronJob is already RUNNING or RUNNINGRESTART@Deprecated public void setPaused() throws IllegalStateException
CronJob to PAUSED.IllegalStateException - if the status of the CronJob is not RUNNING or RUNNINGRESTART@Deprecated protected void setAborted()
CronJobService.requestAbortCronJob(de.hybris.platform.cronjob.model.CronJobModel)
insteadCronJob to ABORTED.IllegalStateException - if the status of the CronJob is not RUNNING or RUNNINGRESTART@Deprecated public CronJob.CronJobResult getFinishedResult(boolean success)
CronJobResult insteadCronJobResult instance. Depending on the parameter success either a failure result or a
success result is returned.success - if true a success result will be returnedCronJobResult instance@Deprecated public CronJob.CronJobResult getUndoFinishedResult(boolean success)
CronJobResult instance. Depending on the parameter success either a failure result or a
success result is returned.success - if true a success result will be returnedCronJobResult instance@Deprecated public CronJob.CronJobResult getAbortResult()
CronJobStatus.ABORTED instead@Deprecated public CronJob.CronJobResult getPausedResult()
CronJobStatus.PAUSED instead@Deprecated public void setCronJobResult(CronJob.CronJobResult res)
protected JaloSession createSessionForCronJob(JaloSession jaloSession)
User, Language and Currency of the specified
JaloSession to the values defined in GeneratedCronJob.getSessionUser(), GeneratedCronJob.getSessionLanguage(),
GeneratedCronJob.getSessionCurrency().jaloSession - the JaloSession, which should be modifiedJaloSessionprotected Map<String,Object> filterSessionContextValuesFromCronJob(Map<String,Object> sessionContextValues)
protected void resetFinishedCronJob()
throws IllegalStateException
CronJob. This includes:
Step to .null.IllegalStateException - if the CronJob has not the status FINISHEDpublic void sendEmail(CronJob.CronJobResult cronJobResult) throws EmailException
CronJobResult per email. The following properties of your project|local.properties are used:
GeneratedCronJob.getEmailAddress().cronJobResult - the CronJobResult, which will be send per emailEmailException - if the sending of the email was not successful.protected CronJobNotificationTemplateContext getRendererNotificationContext()
protected String getFinishedEmailBody(CronJob.CronJobResult cronJobResult)
public void addChangeListener(String topic, ChangeListener listener)
ChangeListener for the specified topic.topic - the topic the ChangeListener will be regiersted forlistener - the ChangeListener which should be registeredpublic void removeChangeListener(String topic, ChangeListener listener)
ChangeListener for the specified topic.topic - the topic the ChangeListener should be deregiersted formlistener - the ChangeListener which should be deregisteredpublic void removeAllChangeListener()
ChangeListeners.protected final void notifyChangeListeners(ChangeEvent event)
ChangeListeners, which are registered for the topic of the specified event.event - the ChangeEvent all registered ChangeListeners should be notfied from@Deprecated public String getTimeTable(SessionContext ctx)
CronJobModel.getTimeTable() instead.CronJobs trigger(s).ctx - the SessionContext, which will be used@Deprecated public void addToPendingSteps(SessionContext ctx, Step step)
Step to the list of pending steps. This method is only used, if the assigned
Job (GeneratedCronJob.getJob()) is a BatchJob.addToPendingSteps in class GeneratedCronJobctx - the SessionContext, which will be usedstep - the Step, which will be appended@Deprecated public void addToPendingSteps(Step step)
Step to the list of pending steps. This method is only used, if the assigned
Job (GeneratedCronJob.getJob()) is a BatchJob.addToPendingSteps in class GeneratedCronJobstep - the Step, which will be appended@Deprecated public void addToProcessedSteps(SessionContext ctx, Step step)
Step to the list of processed steps. This method is only used, if the assigned
Job (GeneratedCronJob.getJob()) is a BatchJob.addToProcessedSteps in class GeneratedCronJobctx - the SessionContext, which will be usedstep - the Step, which will be appended@Deprecated public void addToProcessedSteps(Step step)
Step to the list of processed steps. This method is only used, if the assigned
Job (GeneratedCronJob.getJob()) is a BatchJob.addToProcessedSteps in class GeneratedCronJobstep - the Step, which will be appendedpublic boolean mustRunOnOtherNode()
GeneratedCronJob.getNodeID()).@Deprecated public void createRunOnceTrigger(Date date)
CronJobManager.createTrigger(CronJob, Date)@Deprecated public String getTimeTable()
CronJobs trigger(s).@Deprecated public boolean isAbortable()
Job.isAbortable(CronJob).public void setRequestAbort(SessionContext ctx, Boolean abortRequested)
setRequestAbort in class GeneratedCronJobctx - the SessionContext, which will be usedabortRequested - @Deprecated public LogFile createNewLogFile(String fileName)
LogFileModel creation, refer to wiki documentationpublic Collection<LogFile> getLogFiles(SessionContext ctx)
GeneratedCronJobCronJob.logFiles attribute.getLogFiles in class GeneratedCronJobpublic void setLogFiles(SessionContext ctx, Collection<LogFile> param)
GeneratedCronJobCronJob.logFiles attribute.setLogFiles in class GeneratedCronJobparam - the logFiles - A list of log files related to the current CronJobpublic void setNodeID(SessionContext ctx, Integer value)
GeneratedCronJobCronJob.nodeID attribute.setNodeID in class GeneratedCronJobvalue - the nodeID - The number of the cluster node on which the CronJob is to be run. This setting is
relevant for clustered hybris Suite installations only.public void setNodeGroup(SessionContext ctx, String value)
GeneratedCronJobCronJob.nodeGroup attribute.setNodeGroup in class GeneratedCronJobvalue - the nodeGrouppublic static CronJob.CronJobThreadSettings getCronJobThreadSettings()
activateCronJobThreadSettings(CronJobThreadSettings),
unsetCronJobThreadSettings(CronJobThreadSettings)public static void activateCronJobThreadSettings(CronJob.CronJobThreadSettings settings)
getCronJobThreadSettings(),
unsetCronJobThreadSettings(CronJobThreadSettings)public static void unsetCronJobThreadSettings(CronJob.CronJobThreadSettings settings)
getCronJobThreadSettings(),
activateCronJobThreadSettings(CronJobThreadSettings)Copyright © 2017 SAP SE. All Rights Reserved.