Divide the MSB source codes into two repos
[msb/apigateway.git] / apiroute / apiroute-service / src / main / java / org / onap / msb / apiroute / wrapper / consulextend / async / ConsulResponseCallback.java
1 package org.onap.msb.apiroute.wrapper.consulextend.async;
2
3 import com.orbitz.consul.model.ConsulResponse;
4
5 /**
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.
8  *
9  * @param <T> The Response type.
10  */
11 public interface ConsulResponseCallback<T> {
12
13     /**
14      * Callback for a successful {@link com.orbitz.consul.model.ConsulResponse}.
15      *
16      * @param consulResponse The Consul response.
17      */
18     void onComplete(ConsulResponse<T> consulResponse);
19
20     /**
21      * Callback for a successful {@link com.orbitz.consul.model.ConsulResponse}.
22      *
23      * @param consulResponse The Consul response.
24      */
25     void onDelayComplete(OriginalConsulResponse<T> originalConsulResponse);
26     
27     /**
28      * Callback for an unsuccessful request.
29      *
30      * @param throwable The exception thrown.
31      */
32     void onFailure(Throwable throwable);
33 }