Class CronJob

All Implemented Interfaces:
Serializable, Comparable
Direct Known Subclasses:
GeneratedAbstractMediaCronJob, GeneratedAbstractSnIndexerCronJob, GeneratedCartRemovalCronJob, GeneratedCartToOrderCronJob, GeneratedCleanUpCronJob, GeneratedCleanupDynamicProcessDefinitionsCronJob, GeneratedCompareCatalogVersionsCronJob, GeneratedCompositeCronJob, GeneratedCreateAuditReportCronJob, GeneratedCSTicketStagnationCronJob, GeneratedCxDefaultPersonalizationCalculationCronJob, GeneratedCxPersonalizationProcessCleanupCronJob, GeneratedCxResultsCleaningCronJob, GeneratedCxUpdateSegmentsCronJob, GeneratedDataSupplierCronJob, GeneratedDeleteDocumentFileCronJob, GeneratedExcelImportCronJob, GeneratedExportDataCronJob, GeneratedFlashBuyCronJob, GeneratedGeocodeAddressesCronJob, GeneratedImpExExportCronJob, GeneratedImpExImportCronJob, GeneratedMediaFolderStructureMigrationCronJob, GeneratedMediaProcessCronJob, GeneratedMoveMediaCronJob, GeneratedOldCartRemovalCronJob, GeneratedOldPaymentSubscriptionResultRemovalCronJob, GeneratedOrderScheduleCronJob, GeneratedOrderStatusUpdateCleanerCronJob, GeneratedOrderTemplateToOrderCronJob, GeneratedProductConfigurationPersistenceCleanUpCronJob, GeneratedProductExpressUpdateCleanerCronJob, GeneratedRemoveCatalogVersionCronJob, GeneratedRemoveItemsCronJob, GeneratedRemoveOrphanedFilesCronJob, GeneratedRuleEngineCronJob, GeneratedSessionEventsRemovalCronJob, GeneratedSiteMapMediaCronJob, GeneratedSolrIndexerCronJob, GeneratedSolrIndexOptimizationCronJob, GeneratedSolrQueryStatisticsCollectorCronJob, GeneratedSolrUpdateStopWordsCronJob, GeneratedSolrUpdateSynonymsCronJob, GeneratedSyncItemCronJob, GeneratedUncollectedOrdersCronJob, GeneratedWorkflow, GeneratedY2YSyncCronJob, OutboundSyncCronJob

public class CronJob extends GeneratedCronJob
The 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.

See Also:
  • Field Details

  • Constructor Details

    • CronJob

      public CronJob()
  • Method Details

    • setCurrentlyExecutingCronJob

      protected static final void setCurrentlyExecutingCronJob(CronJob cronjob)
    • unsetCurrentlyExecutingCronJob

      protected static final void unsetCurrentlyExecutingCronJob()
    • getCurrentlyExecutingCronJob

      protected static final CronJob getCurrentlyExecutingCronJob()
    • getCurrentlyExecutingCronJobFailSave

      protected static final CronJob getCurrentlyExecutingCronJobFailSave()
    • hasCurrentlyExecutingCronJob

      protected static boolean hasCurrentlyExecutingCronJob()
      Since:
      2.20
    • createItem

      protected Item createItem(SessionContext ctx, ComposedType type, Item.ItemAttributeMap allAttributes) throws JaloBusinessException
      Description copied from class: Item
      Has to be implemented for each concrete subtype of item. This method is responsible for creating a new item instance ( by calling managers, ejb homes, etc. ) during ComposedType.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; }
      
       
      Overrides:
      createItem in class GeneratedCronJob
      Parameters:
      ctx - the current session context which this item is created within
      type - 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 )
      Returns:
      the new item instance
      Throws:
      JaloBusinessException - indicates an error during creation - any changes will be rollbacked
    • adjustAttributes

      protected void adjustAttributes(SessionContext ctx, Item.ItemAttributeMap attributes)
    • setJob

      protected void setJob(SessionContext ctx, Job job)
      Description copied from class: GeneratedCronJob
      Generated method - Setter of the CronJob.job attribute.
      Overrides:
      setJob in class GeneratedCronJob
      job - the job - References to the Job assigned to the CronJob
    • remove

      public void remove(SessionContext ctx) throws ConsistencyCheckException
      Description copied from class: Item
      Removes this 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


      Overrides:
      remove in class Item
      Parameters:
      ctx - A SessionContext object
      Throws:
      ConsistencyCheckException - if this item could not be removed for some reason
    • resetCounter

      public void resetCounter()
      Resets the transient counter of this cronjob.
      See Also:
    • getCounter

      public int getCounter()
      Provides the current counter value of this cronjob.
      See Also:
    • addToCounter

      public int addToCounter(int add)
      Increases the current counter of this cronjob.
      Parameters:
      add - the amount to add
      Returns:
      the new counter value
      See Also:
    • addLog

      public JobLog addLog(String message)
      Adds a loggin message to this CronJob.
      Parameters:
      message - The logging message
      Returns:
      The JobLog object.
    • addLog

      @Deprecated(since="4.3", forRemoval=false) public JobLog addLog(String message, Step forStep)
      Deprecated.
      since 4.3
      Adds a loggin message for the given Step to this CronJob.
      Parameters:
      message - The logging message
      forStep - The Step this message belongs to
      Returns:
      The JobLog object.
    • addLog

      public JobLog addLog(String message, EnumerationValue level)
      Adds a loggin message with a given error level to this CronJob.
      Parameters:
      message - The logging message
      level - The error level
      Returns:
      The JobLog object.
    • addLog

      @Deprecated(since="4.3", forRemoval=false) public JobLog addLog(String message, Step forStep, EnumerationValue level)
      Deprecated.
      since 4.3
      Adds a loggin message and error level for the given Step to this CronJob.
      Parameters:
      message - The logging message
      forStep - The Step this message belongs to
      level - The error level
      Returns:
      The JobLog object.
    • convertLogLevelToEnum

      public EnumerationValue convertLogLevelToEnum(org.apache.log4j.Level level)
    • convertEnumToLogLevel

      public org.apache.log4j.Level convertEnumToLogLevel(EnumerationValue enumvalue)
    • addLog

      protected JobLog addLog(String message, Step forStep, EnumerationValue level, boolean appendToLogFile)
    • getLogLevelDatabase

      public EnumerationValue getLogLevelDatabase(SessionContext ctx)
      Description copied from class: GeneratedCronJob
      Generated method - Getter of the CronJob.logLevelDatabase attribute.
      Overrides:
      getLogLevelDatabase in class GeneratedCronJob
      Returns:
      the logLevelDatabase - Specifies the log level for logging to the database
    • getLogLevelFile

      public EnumerationValue getLogLevelFile(SessionContext ctx)
      Description copied from class: GeneratedCronJob
      Generated method - Getter of the CronJob.logLevelFile attribute.
      Overrides:
      getLogLevelFile in class GeneratedCronJob
      Returns:
      the logLevelFile - Specifies the log level for logging to the file
    • checkLogLevel

      public boolean checkLogLevel(EnumerationValue configuredLevel, String configProperty, String defaultLevel)
    • setIsEnabledForCheckDifference

      public void setIsEnabledForCheckDifference(long diff)
      Sets the difference between the point of times where the cache of the isEnabledFor(Level) will be reseted.
      Parameters:
      diff - the time difference in ms
    • isEnabledFor

      public final boolean isEnabledFor(org.apache.log4j.Level level)
      Checks if the CronJob is enabled for logging with given log level. Will check log to database and to file configuration. The call of this method will be cached for a specific time, adjustable by setIsEnabledForCheckDifference(long).
      Parameters:
      level - log level to check
      Returns:
      cronjob is enabled for given level
    • getLogText

      @Deprecated(since="ages", forRemoval=false) public String getLogText(SessionContext ctx)
      Returns a String representation of the last 500 JobLogs of the CronJob.
      Specified by:
      getLogText in class GeneratedCronJob
      Parameters:
      ctx - the SessionContext, which will be used
      Returns:
      a String representation of the last 500 JobLogs of the CronJob
    • getLogs

      @Deprecated(since="ages", forRemoval=false) public List<JobLog> getLogs(SessionContext ctx, int start, int count)
      Deprecated.
      since ages - useCronJobModel.getLogs() instead, however a strict access is available also via JobLogDao.findJobLogs(de.hybris.platform.cronjob.model.CronJobModel, int, boolean)
      Returns the specified range (from start -> (start + count)) of JobLogs as a Collection . The JobLogs are ordered by their creation time.
      Parameters:
      ctx - the SessionContext, which will be used
      start - start index of the range
      count - number of elements in the range
      Returns:
      the specified range (from start -> (start + count)) of JobLogs as a Collection
    • getChanges

      @Deprecated(since="ages", forRemoval=false) public Collection<ChangeDescriptor> getChanges(SessionContext ctx)
      Deprecated.
      since ages - not supported in future
      Returns a 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.
      Specified by:
      getChanges in class GeneratedCronJob
      Parameters:
      ctx - the SessionContext, which will be used
      Returns:
      a Collection of all ChangeDescriptors which are assigned to the CronJob
    • getChanges

      @Deprecated(since="ages", forRemoval=false) public Collection<ChangeDescriptor> getChanges(SessionContext ctx, Step step)
      Deprecated.
      since ages - not supported in future
      Returns a 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.
      Parameters:
      ctx - the SessionContext, which will be used
      step - the Step, whose ChangeDescriptors should be returned
      Returns:
      a Collection of all ChangeDescriptors which are assigned to the CronJob and the specified Step
    • getChanges

      @Deprecated(since="ages", forRemoval=false) public Collection<ChangeDescriptor> getChanges(Step step)
      Deprecated.
      since ages - not supported in future
      Returns a 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.
      Parameters:
      step - the Step, whose ChangeDescriptors should be returned
      Returns:
      a Collection of all ChangeDescriptors which are assigned to the CronJob and the specified Step
    • getChanges

      @Deprecated(since="ages", forRemoval=false) public Collection<ChangeDescriptor> getChanges(String changeType)
      Deprecated.
      since ages - not supported in future
      Returns a 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).
      Parameters:
      changeType - the changeType
      Returns:
      a 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)
    • getChanges

      @Deprecated(since="ages", forRemoval=false) public Collection<ChangeDescriptor> getChanges(SessionContext ctx, String changeType)
      Deprecated.
      since ages - not supported in future
      Returns a 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).
      Parameters:
      ctx - the SessionContext, which will be used
      changeType - the changeType
      Returns:
      a 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)
    • getChanges

      @Deprecated(since="ages", forRemoval=false) public Collection<ChangeDescriptor> getChanges(Step step, String changeType)
      Deprecated.
      since ages - not supported in future
      Returns a Collection of all ChangeDescriptors with the specified changeType and which are assigned to the CronJob and the specified Step.
      Parameters:
      step - the Step, whose ChangeDescriptors should be returned
      changeType - the changeType
      Returns:
      a Collection of all ChangeDescriptors which are assigned to the CronJob and the specified Step
    • getChanges

      @Deprecated(since="ages", forRemoval=false) public Collection<ChangeDescriptor> getChanges(SessionContext ctx, Step step, String changeType)
      Deprecated.
      since ages - not supported in future
      Returns a Collection of all ChangeDescriptors with the specified changeType and which are assigned to the CronJob and the specified Step.
      Parameters:
      ctx - the SessionContext, which will be used
      step - the Step, whose ChangeDescriptors should be returned
      changeType - the changeType
      Returns:
      a Collection of all ChangeDescriptors which are assigned to the CronJob and the specified Step
    • getChanges

      @Deprecated(since="ages", forRemoval=false) public Collection<ChangeDescriptor> getChanges(int start, int count)
      Deprecated.
      since ages - not supported in future
      Returns the specified range (from start -> (start + count)) of ChangeDescriptors as a Collection. The ChangeDescriptors are ordered by their creation time.
      Parameters:
      start - start index of the range
      count - number of elements in the range
      Returns:
      the specified range (from start -> (start + count)) of ChangeDescriptors as a Collection
    • getChanges

      @Deprecated(since="ages", forRemoval=false) public Collection<ChangeDescriptor> getChanges(SessionContext ctx, int start, int count)
      Deprecated.
      since ages - not supported in future
      Returns the specified range (from start -> (start + count)) of ChangeDescriptors as a Collection. The ChangeDescriptors are ordered by their creation time.
      Parameters:
      ctx - the SessionContext, which will be used
      start - start index of the range
      count - number of elements in the range
      Returns:
      the specified range (from start -> (start + count)) of ChangeDescriptors as a Collection
    • getChanges

      @Deprecated(since="ages", forRemoval=false) public Collection<ChangeDescriptor> getChanges(Step step, int start, int count)
      Deprecated.
      since ages - not supported in future
      Returns the specified range (from start -> (start + count)) of ChangeDescriptors as a Collection which are assigned to the specified Step. The ChangeDescriptors are ordered by their creation time.
      Parameters:
      step - the Step, whose ChangeDescriptors should be returned
      start - start index of the range
      count - number of elements in the range
      Returns:
      the specified range (from start -> (start + count)) of ChangeDescriptors as a Collection
    • getChanges

      @Deprecated(since="ages", forRemoval=false) public Collection<ChangeDescriptor> getChanges(SessionContext ctx, Step step, int start, int count)
      Deprecated.
      since ages - not supported in future
      Returns the specified range (from start -> (start + count)) of ChangeDescriptors as a Collection which are assigned to the specified Step. The ChangeDescriptors are ordered by their creation time.
      Parameters:
      ctx - the SessionContext, which will be used
      step - the Step, whose ChangeDescriptors should be returned
      start - start index of the range
      count - number of elements in the range
      Returns:
      the specified range (from start -> (start + count)) of ChangeDescriptors as a Collection
    • getChanges

      @Deprecated(since="ages", forRemoval=false) public Collection<ChangeDescriptor> getChanges(String changeType, int start, int count)
      Deprecated.
      since ages - not supported in future
      Returns the specified range (from start -> (start + count)) of ChangeDescriptors as a Collection which have the specified changeType. The ChangeDescriptors are ordered by their creation time.
      Parameters:
      changeType - the changeType
      start - start index of the range
      count - number of elements in the range
      Returns:
      the specified range (from start -> (start + count)) of ChangeDescriptors as a Collection
    • getChanges

      @Deprecated(since="ages", forRemoval=false) public Collection<ChangeDescriptor> getChanges(SessionContext ctx, String changeType, int start, int count)
      Deprecated.
      since ages - not supported in future
      Returns the specified range (from start -> (start + count)) of ChangeDescriptors as a Collection which have the specified changeType. The ChangeDescriptors are ordered by their creation time.
      Parameters:
      ctx - the SessionContext, which will be used
      changeType - the changeType
      start - start index of the range
      count - number of elements in the range
      Returns:
      the specified range (from start -> (start + count)) of ChangeDescriptors as a Collection
    • getChanges

      @Deprecated(since="ages", forRemoval=false) public Collection<ChangeDescriptor> getChanges(Step step, String changeType, int start, int count)
      Deprecated.
      since ages - not supported in future
      Returns the specified range (from start -> (start + count)) of ChangeDescriptors as a Collection which have the specified changeType and are assigned to the specified Step. The ChangeDescriptors are ordered by their creation time.
      Parameters:
      step - the Step, whose ChangeDescriptors should be returned
      changeType - the changeType
      start - start index of the range
      count - number of elements in the range
      Returns:
      the specified range (from start -> (start + count)) of ChangeDescriptors as a Collection
    • getChanges

      @Deprecated(since="ages", forRemoval=false) public Collection<ChangeDescriptor> getChanges(SessionContext ctx, Step step, String changeType, int start, int count)
      Deprecated.
      since ages - not supported in future
      Returns the specified range (from start -> (start + count)) of ChangeDescriptors as a Collection which have the specified changeType and are assigned to the specified Step. The ChangeDescriptors are ordered by their creation time.
      Parameters:
      ctx - the SessionContext, which will be used
      step - the Step, whose ChangeDescriptors should be returned
      changeType - the changeType
      start - start index of the range
      count - number of elements in the range
      Returns:
      the specified range (from start -> (start + count)) of ChangeDescriptors as a Collection
    • getChanges

      @Deprecated(since="ages", forRemoval=false) public Collection<ChangeDescriptor> getChanges(Step step, String changeType, int start, int count, boolean ascending)
      Deprecated.
      since ages - not supported in future
      Returns the specified range (from start -> (start + count)) of ChangeDescriptors as a Collection which have the specified changeType and are assigned to the specified Step. The ChangeDescriptors are ordered by their creation time.
      Parameters:
      step - the Step, whose ChangeDescriptors should be returned
      changeType - the changeType
      start - start index of the range
      count - number of elements in the range
      ascending - order of elements by sequencenumber
      Returns:
      the specified range (from start -> (start + count)) of ChangeDescriptors as a Collection
    • getChanges

      @Deprecated(since="ages", forRemoval=false) public Collection<ChangeDescriptor> getChanges(SessionContext ctx, Step step, String changeType, int start, int count, boolean ascending)
      Deprecated.
      since ages - not supported in future
      Returns the specified range (from start -> (start + count)) of ChangeDescriptors as a Collection which have the specified changeType and are assigned to the specified Step. The ChangeDescriptors are ordered by their creation time.
      Parameters:
      ctx - the SessionContext, which will be used
      step - the Step, whose ChangeDescriptors should be returned
      changeType - the changeType
      start - start index of the range
      count - number of elements in the range
      ascending - order of elements by sequencenumber
      Returns:
      the specified range (from start -> (start + count)) of ChangeDescriptors as a Collection
    • getMostRecentChange

      @Deprecated(since="ages", forRemoval=false) public ChangeDescriptor getMostRecentChange(Step step, String changeType)
      Deprecated.
      since ages - not supported in future
      Returns the most recent ChangeDescriptor of the CronJob which is assigned to the specified Step and has the specified changeType.
      Parameters:
      step - the Step, whose ChangeDescriptors should be returned
      changeType - The change type
      Returns:
      the most recent ChangeDescriptor of the CronJob which is assigned to the specified Step and has the specified changeType
    • addChangeDescriptor

      @Deprecated(since="ages", forRemoval=false) protected ChangeDescriptor addChangeDescriptor(Step forStep, String changeType, Item item, String description)
      Deprecated.
      since ages - not supported in future
      Creates a new ChangeDescriptor with the specified Step, changeType, Item and description.
      Parameters:
      forStep - the Step of the new ChangeDescriptor
      changeType - the changeType of the new ChangeDescriptor
      item - the Item of the new ChangeDescriptor
      description - the description of the new ChangeDescriptor
      Returns:
      the new ChangeDescriptor
    • getNextChangeNumber

      @Deprecated(since="ages", forRemoval=false) protected Integer getNextChangeNumber(ComposedType changeDescriptorType)
      Deprecated.
      since ages - not supported in future
      Returns the next sequence number for the specified changeDescriptorType.
      Parameters:
      changeDescriptorType - the changeDescriptorType
      Returns:
      the next sequence number for the specified changeDescriptorType
    • addChangeDescriptor

      @Deprecated(since="ages", forRemoval=false) public ChangeDescriptor addChangeDescriptor(ComposedType changeDescriptorType, Step forStep, String changeType, Item item, String description)
      Deprecated.
      since ages - not supported in future
      Creates a new ChangeDescriptor with the specified Step, changeType, Item and description.
      Parameters:
      changeDescriptorType - the changeDescriptorType
      forStep - the Step of the new ChangeDescriptor
      changeType - the changeType of the new ChangeDescriptor
      item - the Item of the new ChangeDescriptor
      description - the description of the new ChangeDescriptor
      Returns:
      the new ChangeDescriptor
    • addChangeDescriptor

      @Deprecated(since="ages", forRemoval=false) public ChangeDescriptor addChangeDescriptor(ComposedType changeDescriptorType, Step forStep, String changeType, Item item, String description, Map additionalAttributes)
      Deprecated.
      since ages - not supported in future
      Creates a new ChangeDescriptor with the specified Step, changeType, Item and description.
      Parameters:
      changeDescriptorType - the changeDescriptorType
      forStep - the Step of the new ChangeDescriptor
      changeType - the changeType of the new ChangeDescriptor
      item - the Item of the new ChangeDescriptor
      description - the description of the new ChangeDescriptor
      additionalAttributes - the additional attribute values for the specified changeDescriptorType
      Returns:
      the new ChangeDescriptor
    • addChangeDescriptor

      @Deprecated(since="ages", forRemoval=false) public ChangeDescriptor addChangeDescriptor(ComposedType changeDescriptorType, Step forStep, String changeType, PK item, String description, Map additionalAttributes)
      Deprecated.
      since ages - not supported in future
      Creates a new ChangeDescriptor with the specified Step, changeType, Item and description.
      Parameters:
      changeDescriptorType - the changeDescriptorType
      forStep - the Step of the new ChangeDescriptor
      changeType - the changeType of the new ChangeDescriptor
      item - the Item PK of the new ChangeDescriptor
      description - the description of the new ChangeDescriptor
      additionalAttributes - the additional attribute values for the specified changeDescriptorType
      Returns:
      the new ChangeDescriptor
    • setStatus

      public void setStatus(EnumerationValue status)
      Sets the status.

      This attribute is configured to be not writable (items.xml), because the value should only be set by Jalo itself and not by other clients (like the HMC), which are using the generic access methods.

      Overrides:
      setStatus in class GeneratedCronJob
      Parameters:
      status - the new status
    • setResult

      public void setResult(EnumerationValue result)
      Sets the result.

      This attribute is configured to be not writable (items.xml), because the value should only be set by Jalo itself and not by other clients (like the HMC), which are using the generic access methods.

      Overrides:
      setResult in class GeneratedCronJob
      Parameters:
      result - the new result
    • setStartTime

      public void setStartTime(Date start)
      Sets the end time.

      This attribute is configured to be not writable (items.xml), because the value should only be set by Jalo itself and not by other clients (like the HMC), which are using the generic access methods.

      Overrides:
      setStartTime in class GeneratedCronJob
      Parameters:
      start - the new start time
    • setEndTime

      public void setEndTime(Date end)
      Sets the end time.

      This attribute is configured to be not writable (items.xml), because the value should only be set by Jalo itself and not by other clients (like the HMC), which are using the generic access methods.

      Overrides:
      setEndTime in class GeneratedCronJob
      Parameters:
      end - the new end time
    • setCurrentStep

      protected void setCurrentStep(Step step, boolean undo)
      Sets the current
      Parameters:
      step -
      undo -
    • currentStepDone

      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. 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.
      Parameters:
      undo - true if in undo mode, false if in normal mode.
    • toString

      public String toString()
      Description copied from class: Item
      Returns the String representation of this item. This is by default the representation of the primary key of this item.
      Overrides:
      toString in class Item
      Returns:
      the String representation of this item.
    • getFatalLogLevel

      @Deprecated(since="ages", forRemoval=false) public EnumerationValue getFatalLogLevel()
      Deprecated.
      since ages - useJobLogLevel.FATAL instead
      Returns the EnumerationValue for log level FATAL.
      Returns:
      the EnumerationValue for log level FATAL
    • getErrorLogLevel

      @Deprecated(since="ages", forRemoval=false) public EnumerationValue getErrorLogLevel()
      Deprecated.
      since ages - useJobLogLevel.ERROR instead
      Returns the EnumerationValue for log level ERROR.
      Returns:
      the EnumerationValue for log level ERROR
    • getWarnLogLevel

      @Deprecated(since="ages", forRemoval=false) public EnumerationValue getWarnLogLevel()
      Deprecated.
      since ages - useJobLogLevel.WARNING instead
      Returns the EnumerationValue for log level WARNING.
      Returns:
      the EnumerationValue for log level WARNING
    • getInfoLogLevel

      @Deprecated(since="ages", forRemoval=false) public EnumerationValue getInfoLogLevel()
      Deprecated.
      since ages - useJobLogLevel.INFO instead
      Returns the EnumerationValue for log level INFO.
      Returns:
      the EnumerationValue for log level INFO
    • getDebugLogLevel

      @Deprecated(since="ages", forRemoval=false) public EnumerationValue getDebugLogLevel()
      Deprecated.
      since ages - useJobLogLevel.DEBUG instead
      Returns the EnumerationValue for log level DEBUG.
      Returns:
      the EnumerationValue for log level DEBUG
    • getUnknownLogLevel

      @Deprecated(since="ages", forRemoval=false) public EnumerationValue getUnknownLogLevel()
      Deprecated.
      since ages - useJobLogLevel.UNKNOWN instead
      Returns the EnumerationValue for log level UNKNOWN.
      Returns:
      the EnumerationValue for log level UNKNOWN
    • getFinishedStatus

      @Deprecated(since="ages", forRemoval=false) public EnumerationValue getFinishedStatus()
      Deprecated.
      since ages - useCronJobStatus.FINISHED instead
      Returns the EnumerationValue for CronJob status FINISHED.
      Returns:
      the EnumerationValue for CronJob status FINISHED
    • getRunningStatus

      @Deprecated(since="ages", forRemoval=false) public EnumerationValue getRunningStatus()
      Deprecated.
      since ages - useCronJobStatus.RUNNING instead
      Returns the EnumerationValue for CronJob status RUNNING.
      Returns:
      the EnumerationValue for CronJob status RUNNING
    • getRunningRestartStatus

      @Deprecated(since="ages", forRemoval=false) public EnumerationValue getRunningRestartStatus()
      Deprecated.
      since ages - useCronJobStatus.RUNNINGRESTART instead
      Returns the EnumerationValue for CronJob status RUNNINGRESTART.
      Returns:
      the EnumerationValue for CronJob status RUNNINGRESTART
    • getPausedStatus

      @Deprecated(since="ages", forRemoval=false) public EnumerationValue getPausedStatus()
      Deprecated.
      since ages - useCronJobStatus.PAUSED instead
      Returns the EnumerationValue for CronJob status PAUSED.
      Returns:
      the EnumerationValue for CronJob status PAUSED
    • getAbortedStatus

      @Deprecated(since="ages", forRemoval=false) public EnumerationValue getAbortedStatus()
      Deprecated.
      since ages - useCronJobStatus.ABORTED instead
      Returns the EnumerationValue for CronJob status ABORTED.
      Returns:
      the EnumerationValue for CronJob status ABORTED
    • getUnknownStatus

      @Deprecated(since="ages", forRemoval=false) public EnumerationValue getUnknownStatus()
      Deprecated.
      since ages - useCronJobStatus.UNKNOWN instead
      Returns the EnumerationValue for CronJob status UNKNOWN.
      Returns:
      the EnumerationValue for CronJob status UNKNOWN
    • getErrorResult

      @Deprecated(since="ages", forRemoval=false) public EnumerationValue getErrorResult()
      Deprecated.
      since ages - useCronJobResult.ERROR instead
      Returns the EnumerationValue for CronJob result ERROR.
      Returns:
      the EnumerationValue for CronJob result ERROR
    • getFailureResult

      @Deprecated(since="ages", forRemoval=false) public EnumerationValue getFailureResult()
      Deprecated.
      since ages - useCronJobResult.FAILURE instead
      Returns the EnumerationValue for CronJob result FAILURE.
      Returns:
      the EnumerationValue for CronJob result FAILURE
    • getSuccessResult

      @Deprecated(since="ages", forRemoval=false) public EnumerationValue getSuccessResult()
      Deprecated.
      since ages - useCronJobResult.SUCCESS instead
      Returns the EnumerationValue for CronJob result SUCCESS.
      Returns:
      the EnumerationValue for CronJob result SUCCESS
    • getUnknownResult

      @Deprecated(since="ages", forRemoval=false) public EnumerationValue getUnknownResult()
      Deprecated.
      since ages - useCronJobResult.UNKNOWN instead
      Returns the EnumerationValue for CronJob result UNKNOWN.
      Returns:
      the EnumerationValue for CronJob result UNKNOWN
    • tryToStop

      @Deprecated(since="ages", forRemoval=false) public void tryToStop(long maxWait) throws JaloInvalidParameterException
      Tries to stop a cronjob which is currently being executed.
      Parameters:
      maxWait - the maximum time to wait for the cronjob to abort
      Throws:
      JaloInvalidParameterException - if the assoziated job does not support abort
      Since:
      2.10
    • isRunning

      @Deprecated(since="ages", forRemoval=false) public boolean isRunning()
      Returns true if the CronJob is currently running.
      Returns:
      true if the CronJob is currently running
    • isRunningRestart

      @Deprecated(since="ages", forRemoval=false) public boolean isRunningRestart()
      Returns true if the CronJob has been restarted and is currently running.
      Returns:
      true if the CronJob has been restarted and is currently running
    • isPaused

      @Deprecated(since="ages", forRemoval=false) public boolean isPaused()
      Returns true if the CronJob is currently paused.
      Returns:
      true if the CronJob is currently paused
    • isFinished

      @Deprecated(since="ages", forRemoval=false) public boolean isFinished()
      Returns true if the CronJob has been finished.
      Returns:
      true if the CronJob has been finished
    • setRunning

      @Deprecated(since="ages", forRemoval=false) protected void setRunning() throws IllegalStateException
      Deprecated.
      since ages - 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
      Sets the status of the CronJob to RUNNING.
      Throws:
      IllegalStateException - if the status of the CronJob is already RUNNING
    • setRunningRestart

      @Deprecated(since="ages", forRemoval=false) protected void setRunningRestart() throws IllegalStateException
      Deprecated.
      since ages - there is no counterpart in service layer
      Sets the status of the CronJob to RUNNINGRESTART.
      Throws:
      IllegalStateException - if the status of the CronJob is already RUNNING or RUNNINGRESTART
    • setPaused

      @Deprecated(since="ages", forRemoval=false) public void setPaused() throws IllegalStateException
      Deprecated.
      since ages - there is no counterpart in service layer
      Sets the status of the CronJob to PAUSED.
      Throws:
      IllegalStateException - if the status of the CronJob is not RUNNING or RUNNINGRESTART
    • setAborted

      @Deprecated(since="ages", forRemoval=false) protected void setAborted()
      Sets the status of the CronJob to ABORTED.
      Throws:
      IllegalStateException - if the status of the CronJob is not RUNNING or RUNNINGRESTART
    • getFinishedResult

      @Deprecated(since="ages", forRemoval=false) public CronJob.CronJobResult getFinishedResult(boolean success)
      Deprecated.
      since ages - useCronJobResult instead
      Returns a new CronJobResult instance. Depending on the parameter success either a failure result or a success result is returned.
      Parameters:
      success - if true a success result will be returned
      Returns:
      a new CronJobResult instance
    • getUndoFinishedResult

      @Deprecated(since="ages", forRemoval=false) public CronJob.CronJobResult getUndoFinishedResult(boolean success)
      Deprecated.
      no counterpart since 4.3
      Returns a new CronJobResult instance. Depending on the parameter success either a failure result or a success result is returned.
      Parameters:
      success - if true a success result will be returned
      Returns:
      a new CronJobResult instance
    • getAbortResult

      @Deprecated(since="ages", forRemoval=false) public CronJob.CronJobResult getAbortResult()
      Deprecated.
      since ages - useCronJobStatus.ABORTED instead
    • getPausedResult

      @Deprecated(since="ages", forRemoval=false) public CronJob.CronJobResult getPausedResult()
      Deprecated.
      since ages - useCronJobStatus.PAUSED instead
    • setCronJobResult

      @Deprecated(since="ages", forRemoval=false) public void setCronJobResult(CronJob.CronJobResult res)
      Deprecated.
      no counterpart since 4.3
    • createSessionForCronJob

      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().
      Parameters:
      jaloSession - the JaloSession, which should be modified
      Returns:
      the modified JaloSession
    • filterSessionContextValuesFromCronJob

      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!
    • resetFinishedCronJob

      protected void resetFinishedCronJob() throws IllegalStateException
      Reset the CronJob. This includes:
      • Setting the current Step to .
      • Adding all processed Steps to the list of pending steps and clearing the list of processed steps.
      • Setting the status to UNKNOWN.
      • Setting start- and endtime to null.
      Throws:
      IllegalStateException - if the CronJob has not the status FINISHED
    • sendEmail

      public void sendEmail(CronJob.CronJobResult cronJobResult) throws org.apache.commons.mail.EmailException
      Sends a CronJobResult per email. The following properties of your project|local.properties are used:
      • mail.from: Sender address of the email
      • mail.replyto: Replyto address of the email
      The email will be send to the email address specified in GeneratedCronJob.getEmailAddress().
      Parameters:
      cronJobResult - the CronJobResult, which will be send per email
      Throws:
      org.apache.commons.mail.EmailException - if the sending of the email was not successful.
    • getRendererNotificationContext

      protected CronJobNotificationTemplateContext getRendererNotificationContext()
      Gets filled context object used by velocity to access CronJob's significant data. If in any sub types any other fields are needed simple overwrite getRendererNotificationContext returning any others getters
      Returns:
      interface used by velocity to access CronJob's significant data
      Since:
      3.1-u7
    • getFinishedEmailBody

      protected String getFinishedEmailBody(CronJob.CronJobResult cronJobResult)
      Since:
      2.10
    • addChangeListener

      public void addChangeListener(String topic, ChangeListener listener)
      Registers the specified ChangeListener for the specified topic.
      Parameters:
      topic - the topic the ChangeListener will be regiersted for
      listener - the ChangeListener which should be registered
    • removeChangeListener

      public void removeChangeListener(String topic, ChangeListener listener)
      Removes the registration of specified ChangeListener for the specified topic.
      Parameters:
      topic - the topic the ChangeListener should be deregiersted form
      listener - the ChangeListener which should be deregistered
    • removeAllChangeListener

      public void removeAllChangeListener()
      Removes all registered ChangeListeners.
    • notifyChangeListeners

      protected final void notifyChangeListeners(ChangeEvent event)
      Notifies all ChangeListeners, which are registered for the topic of the specified event.
      Parameters:
      event - the ChangeEvent all registered ChangeListeners should be notfied from
    • getTimeTable

      @Deprecated(since="ages", forRemoval=false) public String getTimeTable(SessionContext ctx)
      Deprecated.
      since ages - useCronJobModel.getTimeTable() instead.
      Returns a localized text, representing the timetable(s) of the CronJobs trigger(s).
      Parameters:
      ctx - the SessionContext, which will be used
      Returns:
      the localized timeTable text
    • addToPendingSteps

      @Deprecated(since="4.3", forRemoval=false) public void addToPendingSteps(SessionContext ctx, Step step)
      Deprecated.
      since 4.3
      Appends the specified Step to the list of pending steps. This method is only used, if the assigned Job (GeneratedCronJob.getJob()) is a BatchJob.
      Overrides:
      addToPendingSteps in class GeneratedCronJob
      Parameters:
      ctx - the SessionContext, which will be used
      step - the Step, which will be appended
    • addToPendingSteps

      @Deprecated(since="4.3", forRemoval=false) public void addToPendingSteps(Step step)
      Deprecated.
      since 4.3
      Appends the specified Step to the list of pending steps. This method is only used, if the assigned Job (GeneratedCronJob.getJob()) is a BatchJob.
      Overrides:
      addToPendingSteps in class GeneratedCronJob
      Parameters:
      step - the Step, which will be appended
    • addToProcessedSteps

      @Deprecated(since="4.3", forRemoval=false) public void addToProcessedSteps(SessionContext ctx, Step step)
      Deprecated.
      since 4.3
      Appends the specified Step to the list of processed steps. This method is only used, if the assigned Job (GeneratedCronJob.getJob()) is a BatchJob.
      Overrides:
      addToProcessedSteps in class GeneratedCronJob
      Parameters:
      ctx - the SessionContext, which will be used
      step - the Step, which will be appended
    • addToProcessedSteps

      @Deprecated(since="4.3", forRemoval=false) public void addToProcessedSteps(Step step)
      Deprecated.
      since 4.3
      Appends the specified Step to the list of processed steps. This method is only used, if the assigned Job (GeneratedCronJob.getJob()) is a BatchJob.
      Overrides:
      addToProcessedSteps in class GeneratedCronJob
      Parameters:
      step - the Step, which will be appended
    • mustRunOnOtherNode

      public boolean mustRunOnOtherNode()
      Tells whether or not this cronjob must be run on another node. This may be the case when clustering is enabled and the current server instance is different from the one specified within the conjob (see { GeneratedCronJob.getNodeID()).
    • createRunOnceTrigger

      @Deprecated(since="ages", forRemoval=false) public void createRunOnceTrigger(Date date)
      Deprecated.
    • getTimeTable

      @Deprecated(since="ages", forRemoval=false) public String getTimeTable()
      Deprecated.
      since ages
      Returns a localized text, representing the timetable(s) of the CronJobs trigger(s).
      Returns:
      the localized timeTable text
    • isAbortable

      @Deprecated(since="ages", forRemoval=false) public boolean isAbortable()
      Tells whether this cronjob is abortable. This method simply delegates to Job.isAbortable(CronJob).
    • setRequestAbort

      public void setRequestAbort(SessionContext ctx, Boolean abortRequested)
      Sets the abort flag to the specified value.
      Overrides:
      setRequestAbort in class GeneratedCronJob
      Parameters:
      ctx - the SessionContext, which will be used
      abortRequested -
    • createNewLogFile

      @Deprecated(since="ages", forRemoval=false) public LogFile createNewLogFile(String fileName)
      Deprecated.
      since ages - use plainLogFileModel creation, refer to wiki documentation
    • getLogFiles

      public Collection<LogFile> getLogFiles(SessionContext ctx)
      Description copied from class: GeneratedCronJob
      Generated method - Getter of the CronJob.logFiles attribute.
      Specified by:
      getLogFiles in class GeneratedCronJob
      Returns:
      the logFiles - A list of log files related to the current CronJob
    • setLogFiles

      public void setLogFiles(SessionContext ctx, Collection<LogFile> param)
      Description copied from class: GeneratedCronJob
      Generated method - Setter of the CronJob.logFiles attribute.
      Specified by:
      setLogFiles in class GeneratedCronJob
      param - the logFiles - A list of log files related to the current CronJob
    • setNodeID

      public void setNodeID(SessionContext ctx, Integer value)
      Description copied from class: GeneratedCronJob
      Generated method - Setter of the CronJob.nodeID attribute.
      Overrides:
      setNodeID in class GeneratedCronJob
      value - 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.
    • setNodeGroup

      public void setNodeGroup(SessionContext ctx, String value)
      Description copied from class: GeneratedCronJob
      Generated method - Setter of the CronJob.nodeGroup attribute.
      Overrides:
      setNodeGroup in class GeneratedCronJob
      value - the nodeGroup
    • getCronJobThreadSettings

      public static CronJob.CronJobThreadSettings getCronJobThreadSettings()
      Returns thread settings for currently executing cronjob. Use this to copy thread settings to another thread in case your cronjob starts multiple threads.
      Since:
      3.1-u7
      See Also:
    • activateCronJobThreadSettings

      public 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.
      Since:
      3.1-u7
      See Also:
    • unsetCronJobThreadSettings

      public static void unsetCronJobThreadSettings(CronJob.CronJobThreadSettings settings)
      Deactivates cronjob thread settings for the current thread. Use this after copying thread settings to another thread in case your cronjob starts multiple threads.
      Since:
      3.1-u7
      See Also:
    • instantiateCronJobHistory

      protected CronJobHistory instantiateCronJobHistory() throws JaloGenericCreationException, JaloAbstractTypeException
      Throws:
      JaloGenericCreationException
      JaloAbstractTypeException
    • finalizeCronJobHistory

      protected void finalizeCronJobHistory()