1 package org.onap.msb.apiroute.wrapper.consulextend.async;
3 import com.orbitz.consul.model.ConsulResponse;
6 * For API calls that support long-polling, this callback is used to handle
7 * the result on success or failure for an async HTTP call.
9 * @param <T> The Response type.
11 public interface ConsulResponseCallback<T> {
14 * Callback for a successful {@link com.orbitz.consul.model.ConsulResponse}.
16 * @param consulResponse The Consul response.
18 void onComplete(ConsulResponse<T> consulResponse);
21 * Callback for a successful {@link com.orbitz.consul.model.ConsulResponse}.
23 * @param consulResponse The Consul response.
25 void onDelayComplete(OriginalConsulResponse<T> originalConsulResponse);
28 * Callback for an unsuccessful request.
30 * @param throwable The exception thrown.
32 void onFailure(Throwable throwable);