Package akka.javasdk.workflow
Record Class Workflow.RecoverStrategy<T>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordRetry strategy without failover configurationstatic final record -
Constructor Summary
ConstructorsConstructorDescriptionRecoverStrategy(int maxRetries, String failoverStepName, Optional<T> failoverStepInput) Creates an instance of aRecoverStrategyrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of thefailoverStepInputrecord component.Returns the value of thefailoverStepNamerecord component.static <W> Workflow.RecoverStrategy<Void> failoverTo(akka.japi.function.Function<W, Workflow.StepEffect> lambda) In case of a step fails, don't retry but transition to a given step method.static <W,I> Workflow.RecoverStrategy.RecoveryInput <I> failoverTo(akka.japi.function.Function2<W, I, Workflow.StepEffect> lambda) In case of a step fails, don't retry but transition to a given step method with input parameter.static Workflow.RecoverStrategy<?> failoverTo(String stepName) Deprecated.static <T> Workflow.RecoverStrategy<T> failoverTo(String stepName, T input) Deprecated.usefailoverTo(akka.japi.function.Function2)instead.final inthashCode()Returns a hash code value for this object.intReturns the value of themaxRetriesrecord component.maxRetries(int maxRetries) Set the number of retries for a failed step,maxRetriesequals 0 means that the step won't retry in case of failure.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
RecoverStrategy
Creates an instance of aRecoverStrategyrecord class.- Parameters:
maxRetries- the value for themaxRetriesrecord componentfailoverStepName- the value for thefailoverStepNamerecord componentfailoverStepInput- the value for thefailoverStepInputrecord component
-
-
Method Details
-
maxRetries
Set the number of retries for a failed step,maxRetriesequals 0 means that the step won't retry in case of failure. -
failoverTo
Deprecated.usefailoverTo(akka.japi.function.Function)instead. -
failoverTo
public static <W> Workflow.RecoverStrategy<Void> failoverTo(akka.japi.function.Function<W, Workflow.StepEffect> lambda) In case of a step fails, don't retry but transition to a given step method.- Type Parameters:
W- The workflow type containing the step method- Parameters:
lambda- Reference to the step method to transition to- Returns:
- A recovery strategy transitioning to the specified step
-
failoverTo
Deprecated.usefailoverTo(akka.japi.function.Function2)instead. -
failoverTo
public static <W,I> Workflow.RecoverStrategy.RecoveryInput<I> failoverTo(akka.japi.function.Function2<W, I, Workflow.StepEffect> lambda) In case of a step fails, don't retry but transition to a given step method with input parameter.- Type Parameters:
W- The workflow type containing the step methodI- The input parameter type for the step- Parameters:
lambda- Reference to the step method to transition to- Returns:
- A builder to provide the input parameter for the recovery strategy
-
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. -
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. -
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 '=='. -
maxRetries
public int maxRetries()Returns the value of themaxRetriesrecord component.- Returns:
- the value of the
maxRetriesrecord component
-
failoverStepName
Returns the value of thefailoverStepNamerecord component.- Returns:
- the value of the
failoverStepNamerecord component
-
failoverStepInput
Returns the value of thefailoverStepInputrecord component.- Returns:
- the value of the
failoverStepInputrecord component
-
failoverTo(akka.japi.function.Function)instead.