Class FlowTimeoutHandlerOptions.Builder

java.lang.Object
io.superdurable.dex.FlowTimeoutHandlerOptions.Builder
Enclosing class:
FlowTimeoutHandlerOptions

public static final class FlowTimeoutHandlerOptions.Builder extends Object
Builds immutable FlowTimeoutHandlerOptions values.
  • Method Details

    • methodTimeout

      public FlowTimeoutHandlerOptions.Builder methodTimeout(Duration value)
      Sets the maximum duration of one timeout-handler attempt.
      Parameters:
      value - the timeout, or null for the server default
      Returns:
      this builder
    • heartbeatTimeout

      public FlowTimeoutHandlerOptions.Builder heartbeatTimeout(Duration value)
      Sets the heartbeat timeout for regular timeout-handler attempts.
      Parameters:
      value - a positive whole-second duration, or null for the server default
      Returns:
      this builder
    • retry

      Sets retry behavior for timeout-handler failures.
      Parameters:
      value - the retry policy, or null for server defaults
      Returns:
      this builder
    • onFailureProceedTo

      public FlowTimeoutHandlerOptions.Builder onFailureProceedTo(Class<? extends Step<Void>> stepClass)
      Routes exhausted timeout-handler failures to a registered no-input Step.

      The Step receives null and reads the final error through Context.getRecoveryError().

      Parameters:
      stepClass - the recovery Step class with Void input
      Returns:
      this builder
    • onFailureProceedTo

      public FlowTimeoutHandlerOptions.Builder onFailureProceedTo(Class<? extends Step<Void>> stepClass, StepOptions options)
      Routes exhausted failures to a no-input Step with execution overrides.
      Parameters:
      stepClass - the recovery Step class with Void input
      options - recovery execution options, or null for registered defaults
      Returns:
      this builder
    • durability

      Overrides durability for timeout-handler side effects.
      Parameters:
      value - the durability mode; the default is StepDurability.DEFAULT
      Returns:
      this builder
    • addLock

      Adds an Attribute lock held for the handler invocation.
      Parameters:
      value - the lock definition
      Returns:
      this builder
    • addLoadAttributeMap

      public FlowTimeoutHandlerOptions.Builder addLoadAttributeMap(AttributeMap<?> value)
      Loads every current instance of an AttributeMap.
      Parameters:
      value - an AttributeMap registered by the Flow
      Returns:
      this builder
    • addLoadAttributeMapInstance

      public FlowTimeoutHandlerOptions.Builder addLoadAttributeMapInstance(AttributeMap<?> value, String instance)
      Loads one AttributeMap instance.
      Parameters:
      value - an AttributeMap registered by the Flow
      instance - the slash-free instance key
      Returns:
      this builder
    • addLoadChannel

      public FlowTimeoutHandlerOptions.Builder addLoadChannel(Channel<?> value)
      Loads pending messages from one Channel.
      Parameters:
      value - a Channel registered by the Flow
      Returns:
      this builder
    • addLoadChannelMap

      public FlowTimeoutHandlerOptions.Builder addLoadChannelMap(ChannelMap<?> value)
      Loads pending messages from every current ChannelMap instance.
      Parameters:
      value - a ChannelMap registered by the Flow
      Returns:
      this builder
    • addLoadChannelMapInstance

      public FlowTimeoutHandlerOptions.Builder addLoadChannelMapInstance(ChannelMap<?> value, String instance)
      Loads pending messages from one ChannelMap instance.
      Parameters:
      value - a ChannelMap registered by the Flow
      instance - the slash-free instance key
      Returns:
      this builder
    • build

      public FlowTimeoutHandlerOptions build()
      Builds immutable timeout-handler options.
      Returns:
      the configured options