ru.dezhik.sms.sender.api.ApiCallback 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.api;
/**
* Provides a convenient way to execute parsed API response asynchronously.
* Can be bypassed into {@link ru.dezhik.sms.sender.AsyncSenderService}
* @author ilya.dezhin
*/
public interface ApiCallback {
/**
* Checks if this callback is applicable to the following request and response.
* @param request
* @param response could be null if network error occurred
*/
boolean apply(Req request, Resp response);
/**
* This function is called iff {@link #apply ) returned true.
* Is designed for saving or udpdating a row in a database, logging, etc.
* @param request
* @param response could be null if network error occurred.
*/
void execute(Req request, Resp response);
}