Class CircuitBreakerRule
java.lang.Object
com.azure.resourcemanager.apimanagement.models.CircuitBreakerRule
- All Implemented Interfaces:
com.azure.json.JsonSerializable<CircuitBreakerRule>
public final class CircuitBreakerRule
extends Object
implements com.azure.json.JsonSerializable<CircuitBreakerRule>
Rule configuration to trip the backend.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the acceptRetryAfter property: flag to accept Retry-After header from the backend.Get the failureCondition property: The conditions for tripping the circuit breaker.static CircuitBreakerRulefromJson(com.azure.json.JsonReader jsonReader) Reads an instance of CircuitBreakerRule from the JsonReader.name()Get the name property: The rule name.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) Get the tripDuration property: The duration for which the circuit will be tripped.voidvalidate()Validates the instance.withAcceptRetryAfter(Boolean acceptRetryAfter) Set the acceptRetryAfter property: flag to accept Retry-After header from the backend.withFailureCondition(CircuitBreakerFailureCondition failureCondition) Set the failureCondition property: The conditions for tripping the circuit breaker.Set the name property: The rule name.withTripDuration(Duration tripDuration) Set the tripDuration property: The duration for which the circuit will be tripped.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
CircuitBreakerRule
public CircuitBreakerRule()Creates an instance of CircuitBreakerRule class.
-
-
Method Details
-
name
Get the name property: The rule name.- Returns:
- the name value.
-
withName
Set the name property: The rule name.- Parameters:
name- the name value to set.- Returns:
- the CircuitBreakerRule object itself.
-
failureCondition
Get the failureCondition property: The conditions for tripping the circuit breaker.- Returns:
- the failureCondition value.
-
withFailureCondition
Set the failureCondition property: The conditions for tripping the circuit breaker.- Parameters:
failureCondition- the failureCondition value to set.- Returns:
- the CircuitBreakerRule object itself.
-
tripDuration
Get the tripDuration property: The duration for which the circuit will be tripped.- Returns:
- the tripDuration value.
-
withTripDuration
Set the tripDuration property: The duration for which the circuit will be tripped.- Parameters:
tripDuration- the tripDuration value to set.- Returns:
- the CircuitBreakerRule object itself.
-
acceptRetryAfter
Get the acceptRetryAfter property: flag to accept Retry-After header from the backend.- Returns:
- the acceptRetryAfter value.
-
withAcceptRetryAfter
Set the acceptRetryAfter property: flag to accept Retry-After header from the backend.- Parameters:
acceptRetryAfter- the acceptRetryAfter value to set.- Returns:
- the CircuitBreakerRule object itself.
-
validate
public void validate()Validates the instance.- Throws:
IllegalArgumentException- thrown if the instance is not valid.
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<CircuitBreakerRule>- Throws:
IOException
-
fromJson
Reads an instance of CircuitBreakerRule from the JsonReader.- Parameters:
jsonReader- The JsonReader being read.- Returns:
- An instance of CircuitBreakerRule if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
- Throws:
IOException- If an error occurs while reading the CircuitBreakerRule.
-