Record Class HttpFileSystemProviderSettings.RetrySettings

java.lang.Object
java.lang.Record
org.broadinstitute.http.nio.HttpFileSystemProviderSettings.RetrySettings
Enclosing class:
HttpFileSystemProviderSettings

public static record HttpFileSystemProviderSettings.RetrySettings(int maxRetries, Collection<Integer> retryableHttpCodes, Collection<Class<? extends Exception>> retryableExceptions, Collection<String> retryableMessages, Predicate<Throwable> retryPredicate) extends Record
Settings which control the behavior of http retries
  • Field Details

    • maxRetries

      private final int maxRetries
      The field for the maxRetries record component.
    • retryableHttpCodes

      private final Collection<Integer> retryableHttpCodes
      The field for the retryableHttpCodes record component.
    • retryableExceptions

      private final Collection<Class<? extends Exception>> retryableExceptions
      The field for the retryableExceptions record component.
    • retryableMessages

      private final Collection<String> retryableMessages
      The field for the retryableMessages record component.
    • retryPredicate

      private final Predicate<Throwable> retryPredicate
      The field for the retryPredicate record component.
  • Constructor Details

    • RetrySettings

      public RetrySettings(int maxRetries, Collection<Integer> retryableHttpCodes, Collection<Class<? extends Exception>> retryableExceptions, Collection<String> retryableMessages, Predicate<Throwable> retryPredicate)
      Settings to control retry behavior
      Parameters:
      maxRetries - number of times to retry an attempted network operation, must be >= 0
      retryableHttpCodes - a list of http response codes which will be retried when encountered
      retryableExceptions - a list of exception classes which will be retried when encountered
      retryableMessages - a list of messages which will be retried when found in an exception message
      retryPredicate - an arbitrary predicate which allows handling retries in custom ways, applied after testing response codes and retryable exceptions, if it returns true it will be retried
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • maxRetries

      public int maxRetries()
      Returns the value of the maxRetries record component.
      Returns:
      the value of the maxRetries record component
    • retryableHttpCodes

      public Collection<Integer> retryableHttpCodes()
      Returns the value of the retryableHttpCodes record component.
      Returns:
      the value of the retryableHttpCodes record component
    • retryableExceptions

      public Collection<Class<? extends Exception>> retryableExceptions()
      Returns the value of the retryableExceptions record component.
      Returns:
      the value of the retryableExceptions record component
    • retryableMessages

      public Collection<String> retryableMessages()
      Returns the value of the retryableMessages record component.
      Returns:
      the value of the retryableMessages record component
    • retryPredicate

      public Predicate<Throwable> retryPredicate()
      Returns the value of the retryPredicate record component.
      Returns:
      the value of the retryPredicate record component