ru.dezhik.sms.sender.RetryPolicy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sms-sender Show documentation
Show all versions of sms-sender Show documentation
Library for sending SMS via sms.ru gateway
package ru.dezhik.sms.sender;
import ru.dezhik.sms.sender.api.ApiRequest;
import ru.dezhik.sms.sender.api.ApiResponse;
/**
* @author ilya.dezhin
*/
public interface RetryPolicy {
/**
*
* @param request request instance to the remote API
* @param response response from the remote API, could be null.
* @return true if retry must be done otherwise false
*/
boolean shouldRetry(Req request, Resp response);
/**
* @return delay duration in ms before next retry
*/
long getDelayDurationMs();
}