summaryrefslogtreecommitdiff
path: root/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/http/HttpRequest.java
diff options
context:
space:
mode:
authortobrun <tobrun.van.nuland@gmail.com>2018-07-17 15:05:53 +0200
committerTobrun <tobrun@mapbox.com>2018-08-24 18:40:11 +0200
commitd297bf10ef89e97da30e1a00dd49560e18bcb3f0 (patch)
tree7f7eea2ffd8125777d258a62683d3ffbeb66820f /platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/http/HttpRequest.java
parent0f58d956d7b525f3722f24494784c8b97801105a (diff)
downloadqtlocation-mapboxgl-d297bf10ef89e97da30e1a00dd49560e18bcb3f0.tar.gz
[android] - modularise the sdk
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/http/HttpRequest.java')
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/http/HttpRequest.java31
1 files changed, 31 insertions, 0 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/http/HttpRequest.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/http/HttpRequest.java
new file mode 100644
index 0000000000..fdbb589fef
--- /dev/null
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/http/HttpRequest.java
@@ -0,0 +1,31 @@
+package com.mapbox.mapboxsdk.http;
+
+/**
+ * Interface definition for performing http requests.
+ * <p>
+ * This allows to provide alternative implementations for the http interaction of this library.
+ * </p>
+ */
+public interface HttpRequest {
+
+ int CONNECTION_ERROR = 0;
+ int TEMPORARY_ERROR = 1;
+ int PERMANENT_ERROR = 2;
+
+ /**
+ * Executes the request.
+ *
+ * @param httpRequest callback to be invoked when we receive a response
+ * @param nativePtr the pointer associated to the request
+ * @param resourceUrl the resource url to download
+ * @param etag http header, identifier for a specific version of a resource
+ * @param modified http header, used to determine if a resource hasn't been modified since
+ */
+ void executeRequest(HttpResponder httpRequest, long nativePtr, String resourceUrl,
+ String etag, String modified);
+
+ /**
+ * Cancels the request.
+ */
+ void cancelRequest();
+}