Package org.broadinstitute.http.nio
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 Summary
FieldsModifier and TypeFieldDescriptionprivate final int
The field for themaxRetries
record component.private final Collection
<Class<? extends Exception>> The field for theretryableExceptions
record component.private final Collection
<Integer> The field for theretryableHttpCodes
record component.private final Collection
<String> The field for theretryableMessages
record component.The field for theretryPredicate
record component. -
Constructor Summary
ConstructorsConstructorDescriptionRetrySettings
(int maxRetries, Collection<Integer> retryableHttpCodes, Collection<Class<? extends Exception>> retryableExceptions, Collection<String> retryableMessages, Predicate<Throwable> retryPredicate) Settings to control retry behavior -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.int
Returns the value of themaxRetries
record component.Collection
<Class<? extends Exception>> Returns the value of theretryableExceptions
record component.Returns the value of theretryableHttpCodes
record component.Returns the value of theretryableMessages
record component.Returns the value of theretryPredicate
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
maxRetries
private final int maxRetriesThe field for themaxRetries
record component. -
retryableHttpCodes
The field for theretryableHttpCodes
record component. -
retryableExceptions
The field for theretryableExceptions
record component. -
retryableMessages
The field for theretryableMessages
record component. -
retryPredicate
The field for theretryPredicate
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 >= 0retryableHttpCodes
- a list of http response codes which will be retried when encounteredretryableExceptions
- a list of exception classes which will be retried when encounteredretryableMessages
- a list of messages which will be retried when found in an exception messageretryPredicate
- 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
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
-
retryableHttpCodes
Returns the value of theretryableHttpCodes
record component.- Returns:
- the value of the
retryableHttpCodes
record component
-
retryableExceptions
Returns the value of theretryableExceptions
record component.- Returns:
- the value of the
retryableExceptions
record component
-
retryableMessages
Returns the value of theretryableMessages
record component.- Returns:
- the value of the
retryableMessages
record component
-
retryPredicate
Returns the value of theretryPredicate
record component.- Returns:
- the value of the
retryPredicate
record component
-