Package akka.javasdk.workflow
Record Class Workflow.RecoverStrategy<T>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
Retry strategy without failover configurationstatic final record
-
Constructor Summary
ConstructorsConstructorDescriptionRecoverStrategy
(int maxRetries, String failoverStepName, Optional<T> failoverStepInput) Creates an instance of aRecoverStrategy
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.Returns the value of thefailoverStepInput
record component.Returns the value of thefailoverStepName
record 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 int
hashCode()
Returns a hash code value for this object.int
Returns the value of themaxRetries
record component.maxRetries
(int maxRetries) Set the number of retries for a failed step,maxRetries
equals 0 means that the step won't retry in case of failure.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
RecoverStrategy
Creates an instance of aRecoverStrategy
record class.- Parameters:
maxRetries
- the value for themaxRetries
record componentfailoverStepName
- the value for thefailoverStepName
record componentfailoverStepInput
- the value for thefailoverStepInput
record component
-
-
Method Details
-
maxRetries
Set the number of retries for a failed step,maxRetries
equals 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 themaxRetries
record component.- Returns:
- the value of the
maxRetries
record component
-
failoverStepName
Returns the value of thefailoverStepName
record component.- Returns:
- the value of the
failoverStepName
record component
-
failoverStepInput
Returns the value of thefailoverStepInput
record component.- Returns:
- the value of the
failoverStepInput
record component
-
failoverTo(akka.japi.function.Function)
instead.