forked from gooddata/gooddata-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPollHandler.java
More file actions
49 lines (39 loc) · 974 Bytes
/
PollHandler.java
File metadata and controls
49 lines (39 loc) · 974 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
* Copyright (C) 2007-2014, GoodData(R) Corporation. All rights reserved.
*/
package com.gooddata;
import org.springframework.http.client.ClientHttpResponse;
import java.io.IOException;
/**
* For internal usage by services employing polling.<p>
* @param <P> polling type
* @param <R> result type
*
* @see com.gooddata.FutureResult
*/
public interface PollHandler<P,R> {
/**
* Get URI used for polling
*
* @return URI string
*/
String getPollingUri();
Class<R> getResultClass();
Class<P> getPollClass();
boolean isDone();
/**
* Return result of polling
*
* @return result
*/
R getResult();
/**
* Check if polling should finish
*
* @param response client side http response
* @return true if polling should finish
* @throws IOException
*/
boolean isFinished(ClientHttpResponse response) throws IOException;
void handlePollResult(P pollResult);
}