Package com.azure.core.amqp
Class AmqpRetryOptions
- java.lang.Object
-
- com.azure.core.amqp.AmqpRetryOptions
-
public class AmqpRetryOptions extends Object
A set of options that can be specified to influence how retry attempts are made.
-
-
Constructor Summary
Constructors Constructor Description AmqpRetryOptions()Creates an instance with the default retry options set.AmqpRetryOptions(AmqpRetryOptions retryOptions)Creates an instance configured withretryOptions.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)DurationgetDelay()Gets the delay between retry attempts for a fixed approach or the delay on which to base calculations for a backoff-approach.DurationgetMaxDelay()Gets the maximum permissible delay between retry attempts.intgetMaxRetries()The maximum number of retry attempts before considering the associated operation to have failed.AmqpRetryModegetMode()Gets the approach to use for calculating retry delays.DurationgetTryTimeout()Gets the maximum duration to wait for completion of a single attempt, whether the initial attempt or a retry.inthashCode()AmqpRetryOptionssetDelay(Duration delay)Gets the delay between retry attempts for a fixed approach or the delay on which to base calculations for a backoff-approach.AmqpRetryOptionssetMaxDelay(Duration maximumDelay)Sets the maximum permissible delay between retry attempts.AmqpRetryOptionssetMaxRetries(int numberOfRetries)Sets the maximum number of retry attempts before considering the associated operation to have failed.AmqpRetryOptionssetMode(AmqpRetryMode retryMode)Sets the approach to use for calculating retry delays.AmqpRetryOptionssetTryTimeout(Duration tryTimeout)Sets the maximum duration to wait for completion of a single attempt, whether the initial attempt or a retry.
-
-
-
Constructor Detail
-
AmqpRetryOptions
public AmqpRetryOptions()
Creates an instance with the default retry options set.
-
AmqpRetryOptions
public AmqpRetryOptions(AmqpRetryOptions retryOptions)
Creates an instance configured withretryOptions. This is not thread-safe.- Parameters:
retryOptions- Retry options to configure new instance with.- Throws:
NullPointerException- ifretryOptionsis null.
-
-
Method Detail
-
setMode
public AmqpRetryOptions setMode(AmqpRetryMode retryMode)
Sets the approach to use for calculating retry delays.- Parameters:
retryMode- The retry approach to use for calculating delays.- Returns:
- The updated
AmqpRetryOptionsobject.
-
setMaxRetries
public AmqpRetryOptions setMaxRetries(int numberOfRetries)
Sets the maximum number of retry attempts before considering the associated operation to have failed.- Parameters:
numberOfRetries- The maximum number of retry attempts.- Returns:
- The updated
AmqpRetryOptionsobject. - Throws:
IllegalArgumentException- WhennumberOfRetriesis negative.
-
setDelay
public AmqpRetryOptions setDelay(Duration delay)
Gets the delay between retry attempts for a fixed approach or the delay on which to base calculations for a backoff-approach.- Parameters:
delay- The delay between retry attempts.- Returns:
- The updated
AmqpRetryOptionsobject. - Throws:
NullPointerException- Whendelayis null.IllegalArgumentException- Whendelayis negative or zero.
-
setMaxDelay
public AmqpRetryOptions setMaxDelay(Duration maximumDelay)
Sets the maximum permissible delay between retry attempts.- Parameters:
maximumDelay- The maximum permissible delay between retry attempts.- Returns:
- The updated
AmqpRetryOptionsobject. - Throws:
NullPointerException- WhenmaximumDelayis null.IllegalArgumentException- WhenmaximumDelayis negative or zero.
-
setTryTimeout
public AmqpRetryOptions setTryTimeout(Duration tryTimeout)
Sets the maximum duration to wait for completion of a single attempt, whether the initial attempt or a retry.- Parameters:
tryTimeout- The maximum duration to wait for completion.- Returns:
- The updated
AmqpRetryOptionsobject. - Throws:
NullPointerException- WhentryTimeoutis null.IllegalArgumentException- WhentryTimeoutis negative or zero.
-
getMode
public AmqpRetryMode getMode()
Gets the approach to use for calculating retry delays.- Returns:
- The approach to use for calculating retry delays.
-
getMaxRetries
public int getMaxRetries()
The maximum number of retry attempts before considering the associated operation to have failed.- Returns:
- The maximum number of retry attempts before considering the associated operation to have failed.
-
getDelay
public Duration getDelay()
Gets the delay between retry attempts for a fixed approach or the delay on which to base calculations for a backoff-approach.- Returns:
- The delay between retry attempts.
-
getMaxDelay
public Duration getMaxDelay()
Gets the maximum permissible delay between retry attempts.- Returns:
- The maximum permissible delay between retry attempts.
-
getTryTimeout
public Duration getTryTimeout()
Gets the maximum duration to wait for completion of a single attempt, whether the initial attempt or a retry.- Returns:
- The maximum duration to wait for completion of a single attempt, whether the initial attempt or a retry.
-
-