Class FaultInjectionRuleBuilder
java.lang.Object
com.azure.cosmos.test.faultinjection.FaultInjectionRuleBuilder
The fault injection rule builder.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Create a new fault injection rule.condition
(FaultInjectionCondition condition) Set the condition of the rule.Set the effective duration of the rule.enabled
(boolean enabled) Flag to indicate whether the rule is enabled.hitLimit
(int hitLimit) Set the total hit limit of the rule.result
(IFaultInjectionResult faultInjectionResult) Set the result of the rule.startDelay
(Duration startDelay) Set the start time of the rule.
-
Constructor Details
-
FaultInjectionRuleBuilder
The constructor.- Parameters:
id
- the fault injection rule id.
-
-
Method Details
-
condition
Set the condition of the rule. The rule will not be applicable if not all conditions are met.- Parameters:
condition
- theFaultInjectionCondition
.- Returns:
- the builder.
-
result
Set the result of the rule.- Parameters:
faultInjectionResult
- theIFaultInjectionResult
.- Returns:
- the builder.
-
duration
Set the effective duration of the rule. The rule will not be applicable if after the effective duration. By default, it is null which means it will be effective until the end of the application.- Parameters:
duration
- the effective duration.- Returns:
- the builder.
-
startDelay
Set the start time of the rule. The rule will not be applicable before the start time. By default, it is null which means the rule will be effective right away.- Parameters:
startDelay
- the delay of the rule.- Returns:
- the builder.
-
hitLimit
Set the total hit limit of the rule. The rule will be not applicable anymore once it has applied hitLimit times. By default, it is null which means there is no limit.- Parameters:
hitLimit
- the hit limit.- Returns:
- the builder.
-
enabled
Flag to indicate whether the rule is enabled. The rule will not be applicable if it is disabled. A rule can be disabled/enable multiple times. By default, it is enabled.- Parameters:
enabled
- flag to indicate whether the rule is enabled.- Returns:
- the builder.
-
build
Create a new fault injection rule.- Returns:
- the
FaultInjectionRule
.
-