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 key
displayName - operator-facing name
version - definition schema version
maximumAttempts - maximum automatic attempts
initialBackoff - first retry delay
maximumBackoff - maximum retry delay
jitter - retry jitter fraction
timeoutSeconds - maximum time one action of this job may execute for
minimumRerunInterval - shortest gap between two scheduled runs of this job type
concurrencyPolicy - cross-worker concurrency policy
idempotencyPolicy - duplicate-execution safety contract
retryableFailureKinds - failure kinds an attempt may be automatically retried after
actionFactory - 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 Details

  • Method Details

    • buildActions

      public List<JobActionPlan> buildActions(T payload)
      Builds and validates the ordered action plan.
      Parameters:
      payload - typed payload
      Returns:
      ordered action plans
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • key

      public JobDefinitionKey<T> key()
      Returns the value of the key record component.
      Returns:
      the value of the key record component
    • displayName

      public String displayName()
      Returns the value of the displayName record component.
      Returns:
      the value of the displayName record component
    • version

      public int version()
      Returns the value of the version record component.
      Returns:
      the value of the version record component
    • maximumAttempts

      public int maximumAttempts()
      Returns the value of the maximumAttempts record component.
      Returns:
      the value of the maximumAttempts record component
    • initialBackoff

      public Duration initialBackoff()
      Returns the value of the initialBackoff record component.
      Returns:
      the value of the initialBackoff record component
    • maximumBackoff

      public Duration maximumBackoff()
      Returns the value of the maximumBackoff record component.
      Returns:
      the value of the maximumBackoff record component
    • jitter

      public double jitter()
      Returns the value of the jitter record component.
      Returns:
      the value of the jitter record component
    • timeoutSeconds

      public int timeoutSeconds()
      Returns the value of the timeoutSeconds record component.
      Returns:
      the value of the timeoutSeconds record component
    • minimumRerunInterval

      public Duration minimumRerunInterval()
      Returns the value of the minimumRerunInterval record component.
      Returns:
      the value of the minimumRerunInterval record component
    • concurrencyPolicy

      public JobConcurrencyPolicy concurrencyPolicy()
      Returns the value of the concurrencyPolicy record component.
      Returns:
      the value of the concurrencyPolicy record component
    • idempotencyPolicy

      public JobIdempotencyPolicy idempotencyPolicy()
      Returns the value of the idempotencyPolicy record component.
      Returns:
      the value of the idempotencyPolicy record component
    • retryableFailureKinds

      public Set<String> retryableFailureKinds()
      Returns the value of the retryableFailureKinds record component.
      Returns:
      the value of the retryableFailureKinds record component
    • actionFactory

      public Function<T, List<JobActionPlan>> actionFactory()
      Returns the value of the actionFactory record component.
      Returns:
      the value of the actionFactory record component