Record Class JobDefinition<T extends JobPayload>
java.lang.Object
java.lang.Record
com.bluebell.greenhouse.platform.models.core.nonentities.job.JobDefinition<T>
- Type Parameters:
T- payload type- Record Components:
key- typed definition keydisplayName- operator-facing nameversion- definition schema versionmaximumAttempts- maximum automatic attemptsinitialBackoff- first retry delaymaximumBackoff- maximum retry delayjitter- retry jitter fractiontimeoutSeconds- maximum time one action of this job may execute forminimumRerunInterval- shortest gap between two scheduled runs of this job typeconcurrencyPolicy- cross-worker concurrency policyidempotencyPolicy- duplicate-execution safety contractretryableFailureKinds- failure kinds an attempt may be automatically retried afteractionFactory- ordered action plan factory
public record JobDefinition<T extends JobPayload>(JobDefinitionKey<T extends JobPayload> key, String displayName, int version, int maximumAttempts, Duration initialBackoff, Duration maximumBackoff, double jitter, int timeoutSeconds, Duration minimumRerunInterval, JobConcurrencyPolicy concurrencyPolicy, JobIdempotencyPolicy idempotencyPolicy, Set<String> retryableFailureKinds, Function<T extends JobPayload, List<JobActionPlan>> actionFactory)
extends Record
Registered execution contract for a typed job.
- Version:
- 3.0.6
- Author:
- Stephen Prizio
-
Constructor Summary
ConstructorsConstructorDescriptionJobDefinition(JobDefinitionKey<T> key, String displayName, int version, int maximumAttempts, Duration initialBackoff, Duration maximumBackoff, double jitter, int timeoutSeconds, Duration minimumRerunInterval, JobConcurrencyPolicy concurrencyPolicy, JobIdempotencyPolicy idempotencyPolicy, Set<String> retryableFailureKinds, Function<T, List<JobActionPlan>> actionFactory) Creates an instance of aJobDefinitionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theactionFactoryrecord component.buildActions(T payload) Builds and validates the ordered action plan.Returns the value of theconcurrencyPolicyrecord component.Returns the value of thedisplayNamerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theidempotencyPolicyrecord component.Returns the value of theinitialBackoffrecord component.doublejitter()Returns the value of thejitterrecord component.key()Returns the value of thekeyrecord component.intReturns the value of themaximumAttemptsrecord component.Returns the value of themaximumBackoffrecord component.Returns the value of theminimumRerunIntervalrecord component.Returns the value of theretryableFailureKindsrecord component.intReturns the value of thetimeoutSecondsrecord component.final StringtoString()Returns a string representation of this record class.intversion()Returns the value of theversionrecord component.
-
Constructor Details
-
JobDefinition
public JobDefinition(JobDefinitionKey<T> key, String displayName, int version, int maximumAttempts, Duration initialBackoff, Duration maximumBackoff, double jitter, int timeoutSeconds, Duration minimumRerunInterval, JobConcurrencyPolicy concurrencyPolicy, JobIdempotencyPolicy idempotencyPolicy, Set<String> retryableFailureKinds, Function<T, List<JobActionPlan>> actionFactory) Creates an instance of aJobDefinitionrecord class.- Parameters:
key- the value for thekeyrecord componentdisplayName- the value for thedisplayNamerecord componentversion- the value for theversionrecord componentmaximumAttempts- the value for themaximumAttemptsrecord componentinitialBackoff- the value for theinitialBackoffrecord componentmaximumBackoff- the value for themaximumBackoffrecord componentjitter- the value for thejitterrecord componenttimeoutSeconds- the value for thetimeoutSecondsrecord componentminimumRerunInterval- the value for theminimumRerunIntervalrecord componentconcurrencyPolicy- the value for theconcurrencyPolicyrecord componentidempotencyPolicy- the value for theidempotencyPolicyrecord componentretryableFailureKinds- the value for theretryableFailureKindsrecord componentactionFactory- the value for theactionFactoryrecord component
-
-
Method Details
-
buildActions
Builds and validates the ordered action plan.- Parameters:
payload- typed payload- Returns:
- ordered action plans
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
key
-
displayName
Returns the value of thedisplayNamerecord component.- Returns:
- the value of the
displayNamerecord component
-
version
-
maximumAttempts
public int maximumAttempts()Returns the value of themaximumAttemptsrecord component.- Returns:
- the value of the
maximumAttemptsrecord component
-
initialBackoff
Returns the value of theinitialBackoffrecord component.- Returns:
- the value of the
initialBackoffrecord component
-
maximumBackoff
Returns the value of themaximumBackoffrecord component.- Returns:
- the value of the
maximumBackoffrecord component
-
jitter
-
timeoutSeconds
public int timeoutSeconds()Returns the value of thetimeoutSecondsrecord component.- Returns:
- the value of the
timeoutSecondsrecord component
-
minimumRerunInterval
Returns the value of theminimumRerunIntervalrecord component.- Returns:
- the value of the
minimumRerunIntervalrecord component
-
concurrencyPolicy
Returns the value of theconcurrencyPolicyrecord component.- Returns:
- the value of the
concurrencyPolicyrecord component
-
idempotencyPolicy
Returns the value of theidempotencyPolicyrecord component.- Returns:
- the value of the
idempotencyPolicyrecord component
-
retryableFailureKinds
Returns the value of theretryableFailureKindsrecord component.- Returns:
- the value of the
retryableFailureKindsrecord component
-
actionFactory
Returns the value of theactionFactoryrecord component.- Returns:
- the value of the
actionFactoryrecord component
-