All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ru.dezhik.sms.sender.api.ApiCallback Maven / Gradle / Ivy

There is a newer version: 0.1.3
Show newest version
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);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy