com.bazaarvoice.ostrich.RetryPolicy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ostrich-core Show documentation
Show all versions of ostrich-core Show documentation
Core classes that form Ostrich
package com.bazaarvoice.ostrich;
/** Abstracts the strategy of determining when to retry operations. */
public interface RetryPolicy {
/**
* Called when an operation has failed for some reason. If this method returns true
* then the operation will be retried.
*
* @param numAttempts The number of attempts that have happened so far. This must be greater than zero.
* @param elapsedTimeMs The amount of time in milliseconds that the operation has been attempted.
* @return true
if the operation can be tried again, false
otherwise.
*/
boolean allowRetry(int numAttempts, long elapsedTimeMs);
}