Class DefaultCronJobHistoryService

All Implemented Interfaces:
CronJobHistoryService, Serializable, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean

public class DefaultCronJobHistoryService extends AbstractBusinessService implements CronJobHistoryService
See Also:
  • Constructor Details

    • DefaultCronJobHistoryService

      public DefaultCronJobHistoryService()
  • Method Details

    • getCronJobHistoryBy

      public List<CronJobHistoryModel> getCronJobHistoryBy(String cronJobCode)
      Specified by:
      getCronJobHistoryBy in interface CronJobHistoryService
      Parameters:
      cronJobCode - given cron job code
      Returns:
      matching cron job history entry for given cron job code.
    • getCronJobHistoryBy

      public List<CronJobHistoryModel> getCronJobHistoryBy(List<String> cronJobCodes)
      Specified by:
      getCronJobHistoryBy in interface CronJobHistoryService
      Parameters:
      cronJobCodes - given cron job codes
      Returns:
      matching cron job history entries for given cron job code.
    • getCronJobHistoryBy

      public List<CronJobHistoryModel> getCronJobHistoryBy(@Nullable UserModel userModel, JobModel jobModel)
      Description copied from interface: CronJobHistoryService
      Returns cron job history entries triggered by given user for given job.
      Specified by:
      getCronJobHistoryBy in interface CronJobHistoryService
      Parameters:
      userModel - given user model
      jobModel - given job model
      Returns:
      matching cron job history entries
    • getCronJobHistoryBy

      public List<CronJobHistoryModel> getCronJobHistoryBy(UserModel userModel, String jobItemType, Date startDate, Date finishDate)
      Description copied from interface: CronJobHistoryService
      Returns cron job history entries triggered by given user for given job type and time range. Note: Time range means the time period when cron job was performing i.e cron jobs's start date is greater or equal the the given startDate and cron job's finish date is lesser or equal to the given finishDate.
      Specified by:
      getCronJobHistoryBy in interface CronJobHistoryService
      Parameters:
      userModel - given user model
      jobItemType - given job item type - for limit the results to this type only please use following syntax 'SyncItemJob!'.
      startDate - desired time date
      finishDate - desired finish date
      Returns:
      matching cron job history entries
    • getCronJobHistoryBy

      public List<CronJobHistoryModel> getCronJobHistoryBy(UserModel userModel, String jobItemType, Date startDate, Date finishDate, CronJobStatus theStatus)
      Description copied from interface: CronJobHistoryService
      Returns cron job history entries triggered by given user for given job type and time range and the cron job's status. Note: Time range means the time period when cron job was performing i.e cron jobs's start date is greater or equal the the given startDate and cron job's finish date is lesser or equal to the given finishDate.
      Specified by:
      getCronJobHistoryBy in interface CronJobHistoryService
      Parameters:
      userModel - given user model
      jobItemType - given job item type - for limit the results to this type only please use following syntax e.g. 'SyncItemJob!'.
      startDate - desired time date
      finishDate - desired finish date
      theStatus - desired cron job status
      Returns:
      matching cron job history entries
    • getCronJobHistoryBy

      public List<CronJobHistoryModel> getCronJobHistoryBy(UserModel userModel, String jobItemType, Date startDate, Date finishDate, CronJobResult theResult)
      Description copied from interface: CronJobHistoryService
      Returns cron job history entries triggered by given user for given job type and time range and the cron job's result. Note: Time range means the time period when cron job was performing i.e cron jobs's start date is greater or equal the the given startDate and cron job's finish date is lesser or equal to the given finishDate.
      Specified by:
      getCronJobHistoryBy in interface CronJobHistoryService
      Parameters:
      userModel - given user model
      jobItemType - given job item type - for limit the results to this type only please use following syntax e.g. 'SyncItemJob!'.
      startDate - desired time date
      finishDate - desired finish date
      theResult - desired cron job result
      Returns:
      matching cron job history entries
    • getCronJobHistoryBy

      public List<CronJobHistoryModel> getCronJobHistoryBy(Set<CronJobHistoryInclude> includes, UserModel userModel, Date startDate, Date finishDate, CronJobStatus theStatus)
      Description copied from interface: CronJobHistoryService
      Returns list of CronJobHistoryModel where for every include criteria entries matching given user, startDate, finishDate and status are returned. Result of all includes in combined into one Note: Time range means the time period when cron job was performing i.e cron jobs's start date is greater or equal the the given startDate and cron job's finish date is lesser or equal to the given finishDate.
      Specified by:
      getCronJobHistoryBy in interface CronJobHistoryService
      Parameters:
      includes - set of search criteria which allow to specify cronJob's type code, job's type code and list of job's codes.
      userModel - given user model
      startDate - given start date
      finishDate - given finish date
      theStatus - given cron job's status
      Returns:
      a CronJobHistoryModel
    • getAverageExecutionTime

      public Long getAverageExecutionTime(UserModel userModel, String jobCode, TimeUnit timeUnit)
      Description copied from interface: CronJobHistoryService
      Returns average execution time based on historical data.
      Specified by:
      getAverageExecutionTime in interface CronJobHistoryService
      Parameters:
      userModel - given user model
      jobCode - code of job to get data for
      timeUnit - time unit to return
      Returns:
      average execution time in given time unit or null if no data is available
    • getAverageExecutionTime

      public Long getAverageExecutionTime(CronJobModel cronJob, TimeUnit timeUnit)
      Description copied from interface: CronJobHistoryService
      Returns average execution time based on historical data.
      Specified by:
      getAverageExecutionTime in interface CronJobHistoryService
      Parameters:
      cronJob - cronJob to get data for
      timeUnit - time unit to return
      Returns:
      average execution time in given time unit or null if no data is available
    • setCronJobHistoryDao

      public void setCronJobHistoryDao(CronJobHistoryDao cronJobHistoryDao)
    • setCronJobDao

      public void setCronJobDao(CronJobDao cronJobDao)