Class CronJobSpec

  • All Implemented Interfaces:
    com.marcnuri.yakc.model.Model

    public class CronJobSpec
    extends java.lang.Object
    implements com.marcnuri.yakc.model.Model
    CronJobSpec describes how the job execution will look like and when it will actually run.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  CronJobSpec.Builder  
    • Constructor Summary

      Constructors 
      Constructor Description
      CronJobSpec()  
      CronJobSpec​(java.lang.String concurrencyPolicy, java.lang.Number failedJobsHistoryLimit, @NonNull JobTemplateSpec jobTemplate, @NonNull java.lang.String schedule, java.lang.Number startingDeadlineSeconds, java.lang.Number successfulJobsHistoryLimit, java.lang.Boolean suspend)  
    • Constructor Detail

      • CronJobSpec

        public CronJobSpec​(java.lang.String concurrencyPolicy,
                           java.lang.Number failedJobsHistoryLimit,
                           @NonNull
                           @NonNull JobTemplateSpec jobTemplate,
                           @NonNull
                           @NonNull java.lang.String schedule,
                           java.lang.Number startingDeadlineSeconds,
                           java.lang.Number successfulJobsHistoryLimit,
                           java.lang.Boolean suspend)
      • CronJobSpec

        public CronJobSpec()
    • Method Detail

      • getConcurrencyPolicy

        public java.lang.String getConcurrencyPolicy()
        Specifies how to treat concurrent executions of a Job. Valid values are: - "Allow" (default): allows CronJobs to run concurrently; - "Forbid": forbids concurrent runs, skipping next run if previous run hasn't finished yet; - "Replace": cancels currently running job and replaces it with a new one
      • getFailedJobsHistoryLimit

        public java.lang.Number getFailedJobsHistoryLimit()
        The number of failed finished jobs to retain. This is a pointer to distinguish between explicit zero and not specified.
      • getJobTemplate

        @NonNull
        public @NonNull JobTemplateSpec getJobTemplate()
      • getSchedule

        @NonNull
        public @NonNull java.lang.String getSchedule()
        The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
      • getStartingDeadlineSeconds

        public java.lang.Number getStartingDeadlineSeconds()
        Optional deadline in seconds for starting the job if it misses scheduled time for any reason. Missed jobs executions will be counted as failed ones.
      • getSuccessfulJobsHistoryLimit

        public java.lang.Number getSuccessfulJobsHistoryLimit()
        The number of successful finished jobs to retain. This is a pointer to distinguish between explicit zero and not specified.
      • getSuspend

        public java.lang.Boolean getSuspend()
        This flag tells the controller to suspend subsequent executions, it does not apply to already started executions. Defaults to false.
      • setConcurrencyPolicy

        public void setConcurrencyPolicy​(java.lang.String concurrencyPolicy)
        Specifies how to treat concurrent executions of a Job. Valid values are: - "Allow" (default): allows CronJobs to run concurrently; - "Forbid": forbids concurrent runs, skipping next run if previous run hasn't finished yet; - "Replace": cancels currently running job and replaces it with a new one
      • setFailedJobsHistoryLimit

        public void setFailedJobsHistoryLimit​(java.lang.Number failedJobsHistoryLimit)
        The number of failed finished jobs to retain. This is a pointer to distinguish between explicit zero and not specified.
      • setJobTemplate

        public void setJobTemplate​(@NonNull
                                   @NonNull JobTemplateSpec jobTemplate)
      • setSchedule

        public void setSchedule​(@NonNull
                                @NonNull java.lang.String schedule)
        The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
      • setStartingDeadlineSeconds

        public void setStartingDeadlineSeconds​(java.lang.Number startingDeadlineSeconds)
        Optional deadline in seconds for starting the job if it misses scheduled time for any reason. Missed jobs executions will be counted as failed ones.
      • setSuccessfulJobsHistoryLimit

        public void setSuccessfulJobsHistoryLimit​(java.lang.Number successfulJobsHistoryLimit)
        The number of successful finished jobs to retain. This is a pointer to distinguish between explicit zero and not specified.
      • setSuspend

        public void setSuspend​(java.lang.Boolean suspend)
        This flag tells the controller to suspend subsequent executions, it does not apply to already started executions. Defaults to false.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • canEqual

        protected boolean canEqual​(java.lang.Object other)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object