summaryrefslogtreecommitdiff
path: root/src/mining/Requester.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/mining/Requester.java')
-rw-r--r--src/mining/Requester.java20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/mining/Requester.java b/src/mining/Requester.java
index df6053f..2e0e067 100644
--- a/src/mining/Requester.java
+++ b/src/mining/Requester.java
@@ -21,5 +21,23 @@ public interface Requester {
*/
public JSONObject getJSON(String resource) throws IOException;
- // TODO: retry (after sleeping) on ratelimit
+ /**
+ * Almost equivalent to {@code getJSON(resource, true)}, except that an
+ * IOException is not thrown if the request reports an non-successful status
+ * code.
+ *
+ * @see Requester#getJSON(java.lang.String, boolean)
+ * @throws IOException on network errors or if the response could not be
+ * parsed into a valid JSONObject.
+ */
+ public JSONObject getJSONRelax(String resource) throws IOException;
+
+ /**
+ * Tests whether this instance can dispatch requests.
+ *
+ * @return true if the access tokens are valid, false otherwise.
+ * @throws java.io.IOException if the status cannot reliably be determined
+ * (e.g. network error, parsing error).
+ */
+ public boolean isValid() throws IOException;
}