Partager via


OperationRetryControl Class

  • java.lang.Object
    • microsoft.servicefabric.services.communication.client.OperationRetryControl

public class OperationRetryControl

Specifies the retry policy for the exceptions got on the communication from client to service.

Method Summary

Modifier and Type Method and Description
Throwable getException()

Exception to report for the operation, if ShouldRetry is false. By default this is the same exception as the reported exception, however in some cases the Factory may choose to transform the reported exception to a more meaningful exception.

String getExceptionId()

String that uniquely identifies the exception type.

int getMaxRetryCount()

Max number of times this operation should be retried if the ShouldRetry is true

Duration getRetryDelay()

The operation should be retried after this delay if the ShouldRetry is true.

boolean isTransient()
void setException(Throwable exception)

Exception to report for the operation, if ShouldRetry is false. By default this is the same exception as the reported exception, however in some cases the Factory may choose to transform the reported exception to a more meaningful exception.

void setExceptionId(String exceptionId)

String that uniquely identifies the exception type.

void setIsTransient(boolean value)
void setMaxRetryCount(int maxRetryCount)

Max number of times this operation should be retried if the ShouldRetry is true

void setRetryDelay(Duration retryDelay)

The operation should be retried after this delay if the ShouldRetry is true.

void setShouldRetry(boolean shouldRetry)

Indicates whether the operation should be retried or not.

boolean shouldRetry()

Indicates whether the operation should be retried or not.

Method Details

getException

public Throwable getException()

Exception to report for the operation, if ShouldRetry is false. By default this is the same exception as the reported exception, however in some cases the Factory may choose to transform the reported exception to a more meaningful exception.

Returns:

Exception

getExceptionId

public String getExceptionId()

String that uniquely identifies the exception type.

Returns:

Unique id for this exception. This id is used to keep track of the number of times this exception is retried

getMaxRetryCount

public int getMaxRetryCount()

Max number of times this operation should be retried if the ShouldRetry is true

Returns:

Max retry count

getRetryDelay

public Duration getRetryDelay()

The operation should be retried after this delay if the ShouldRetry is true.

Returns:

Time delay after which the operation should be retried

isTransient

public boolean isTransient()

setException

public void setException(Throwable exception)

Exception to report for the operation, if ShouldRetry is false. By default this is the same exception as the reported exception, however in some cases the Factory may choose to transform the reported exception to a more meaningful exception.

Parameters:

exception - Exception

setExceptionId

public void setExceptionId(String exceptionId)

String that uniquely identifies the exception type.

Parameters:

exceptionId - Unique id for this exception. This id is used to keep track of the number of times this exception is retried

setIsTransient

public void setIsTransient(boolean value)

Parameters:

value

setMaxRetryCount

public void setMaxRetryCount(int maxRetryCount)

Max number of times this operation should be retried if the ShouldRetry is true

Parameters:

maxRetryCount - Max retry count

setRetryDelay

public void setRetryDelay(Duration retryDelay)

The operation should be retried after this delay if the ShouldRetry is true.

Parameters:

retryDelay - Time delay after which the operation should be retried

setShouldRetry

public void setShouldRetry(boolean shouldRetry)

Indicates whether the operation should be retried or not.

Parameters:

shouldRetry - true if the operation should be retried, false if the exception should be thrown to the user

shouldRetry

public boolean shouldRetry()

Indicates whether the operation should be retried or not.

Returns:

true if the operation should be retried, false if the exception should be thrown to the user

Applies to