public final class DefaultJobDefinition extends java.lang.Object implements JobDefinition
| Modifier and Type | Method and Description |
|---|---|
java.util.Optional<java.lang.String> |
cron()
Optional cron expression used to specify when a job should be triggered.
|
static JobDefinition |
cronJobDefinition(java.lang.String jobType,
java.lang.String jobName,
java.lang.String description,
java.lang.String cron,
java.util.Optional<java.time.Duration> maxAge)
Create a JobDefinition that is using a cron expression to specify, when and how often the job should be triggered.
|
java.lang.String |
description()
A human-readable description of the job.
|
java.util.Optional<java.time.Duration> |
fixedDelay()
Optional fixed delay after that a job is triggered again.
|
static DefaultJobDefinition |
fixedDelayJobDefinition(java.lang.String jobType,
java.lang.String jobName,
java.lang.String description,
java.time.Duration fixedDelay,
java.util.Optional<java.time.Duration> maxAge)
Create a JobDefinition that is using fixed delays specify, when and how often the job should be triggered.
|
java.lang.String |
jobName()
A human-readable name of the job.
|
java.lang.String |
jobType()
The type of the job that is specified by this JobDefinition.
|
java.util.Optional<java.time.Duration> |
maxAge() |
static JobDefinition |
notTriggerableJobDefinition(java.lang.String jobType,
java.lang.String jobName,
java.lang.String description)
Create a JobDefinition that will not be triggered.
|
int |
retries()
Number of retries when starting a job is failing for some reason.
|
static JobDefinition |
retryableCronJobDefinition(java.lang.String jobType,
java.lang.String jobName,
java.lang.String description,
java.lang.String cron,
int retries,
java.time.Duration retryDelay,
java.util.Optional<java.time.Duration> maxAge)
Create a JobDefinition that is using a cron expression to specify, when and how often the job should be triggered.
|
static DefaultJobDefinition |
retryableFixedDelayJobDefinition(java.lang.String jobType,
java.lang.String jobName,
java.lang.String description,
java.time.Duration fixedDelay,
int retries,
java.util.Optional<java.time.Duration> retryDelay,
java.util.Optional<java.time.Duration> maxAge)
Create a JobDefinition that is using fixed delays specify, when and how often the job should be triggered.
|
java.util.Optional<java.time.Duration> |
retryDelay()
The duration after that a retry should be scheduled.
|
public static JobDefinition cronJobDefinition(java.lang.String jobType, java.lang.String jobName, java.lang.String description, java.lang.String cron, java.util.Optional<java.time.Duration> maxAge)
jobType - The type of the JobjobName - A human readable name of the Jobdescription - A human readable description of the Job.cron - The cron expressionmaxAge - Maximum age of the latest job after that we want to get a warningpublic static JobDefinition notTriggerableJobDefinition(java.lang.String jobType, java.lang.String jobName, java.lang.String description)
jobType - The type of the JobjobName - A human readable name of the Jobdescription - A human readable description of the Job.public static JobDefinition retryableCronJobDefinition(java.lang.String jobType, java.lang.String jobName, java.lang.String description, java.lang.String cron, int retries, java.time.Duration retryDelay, java.util.Optional<java.time.Duration> maxAge)
jobType - The type of the JobjobName - A human readable name of the Jobdescription - A human readable description of the Job.cron - The cron expressionmaxAge - Maximum age of the latest job after that we want to get a warningretries - Specifies how often a job trigger should retry to start the job if triggering fails for some reason.retryDelay - The optional delay between retries.public static DefaultJobDefinition fixedDelayJobDefinition(java.lang.String jobType, java.lang.String jobName, java.lang.String description, java.time.Duration fixedDelay, java.util.Optional<java.time.Duration> maxAge)
jobType - The type of the JobjobName - A human readable name of the Jobdescription - A human readable description of the Job.fixedDelay - The delay duration between to executions of the JobmaxAge - Maximum age of the latest job after that we want to get a warningpublic static DefaultJobDefinition retryableFixedDelayJobDefinition(java.lang.String jobType, java.lang.String jobName, java.lang.String description, java.time.Duration fixedDelay, int retries, java.util.Optional<java.time.Duration> retryDelay, java.util.Optional<java.time.Duration> maxAge)
jobType - The type of the JobjobName - A human readable name of the Jobdescription - A human readable description of the Job.fixedDelay - The delay duration between to executions of the JobmaxAge - Maximum age of the latest job after that we want to get a warningretries - Specifies how often a job trigger should retry to start the job if triggering fails for some reason.retryDelay - The optional delay between retries.public java.lang.String jobType()
Only one JobDefinition per type is supported.
jobType in interface JobDefinitionpublic java.lang.String jobName()
jobName in interface JobDefinitionpublic java.lang.String description()
description in interface JobDefinitionpublic java.util.Optional<java.time.Duration> maxAge()
maxAge in interface JobDefinitionpublic java.util.Optional<java.time.Duration> fixedDelay()
fixedDelay in interface JobDefinitionpublic java.util.Optional<java.lang.String> cron()
cron in interface JobDefinitionpublic int retries()
retries in interface JobDefinitionpublic java.util.Optional<java.time.Duration> retryDelay()
retryDelay in interface JobDefinition