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 Details

    • CircuitBreakerRule

      public CircuitBreakerRule()
      Creates an instance of CircuitBreakerRule class.
  • Method Details

    • name

      public String name()
      Get the name property: The rule name.
      Returns:
      the name value.
    • withName

      public CircuitBreakerRule withName(String name)
      Set the name property: The rule name.
      Parameters:
      name - the name value to set.
      Returns:
      the CircuitBreakerRule object itself.
    • failureCondition

      public CircuitBreakerFailureCondition failureCondition()
      Get the failureCondition property: The conditions for tripping the circuit breaker.
      Returns:
      the failureCondition value.
    • withFailureCondition

      public CircuitBreakerRule withFailureCondition(CircuitBreakerFailureCondition failureCondition)
      Set the failureCondition property: The conditions for tripping the circuit breaker.
      Parameters:
      failureCondition - the failureCondition value to set.
      Returns:
      the CircuitBreakerRule object itself.
    • tripDuration

      public Duration tripDuration()
      Get the tripDuration property: The duration for which the circuit will be tripped.
      Returns:
      the tripDuration value.
    • withTripDuration

      public CircuitBreakerRule withTripDuration(Duration tripDuration)
      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

      public Boolean acceptRetryAfter()
      Get the acceptRetryAfter property: flag to accept Retry-After header from the backend.
      Returns:
      the acceptRetryAfter value.
    • withAcceptRetryAfter

      public CircuitBreakerRule withAcceptRetryAfter(Boolean acceptRetryAfter)
      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

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<CircuitBreakerRule>
      Throws:
      IOException
    • fromJson

      public static CircuitBreakerRule fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      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.