Package com.trimblemaps.mapsdk.http
Class NativeHttpRequest
java.lang.Object
com.trimblemaps.mapsdk.http.NativeHttpRequest
- All Implemented Interfaces:
HttpResponder
-
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()voidhandleFailure(int type, String errorMessage) Invoked when a resource failed to be retrieved.voidonResponse(int responseCode, String etag, String lastModified, String cacheControl, String expires, String retryAfter, String xRateLimitReset, byte[] body) Invoked when a resource has finished.
-
Method Details
-
cancel
public void cancel() -
onResponse
public void onResponse(int responseCode, String etag, String lastModified, String cacheControl, String expires, String retryAfter, String xRateLimitReset, byte[] body) Description copied from interface:HttpResponderInvoked when a resource has finished.- Specified by:
onResponsein interfaceHttpResponder- Parameters:
responseCode- http response codeetag- http header, identifier for a specific version of a resourcelastModified- http header, used to determine if a resource hasn't been modified sincecacheControl- http header, used to determine cache strategy of a resourceexpires- http header, used to determine when a resource is staleretryAfter- http header, used to indicate when the service is expected to be unavailable to the clientxRateLimitReset- http header, used to determine the remaining window before the rate limit resetsbody- http response body, in an array of bytes representation
-
handleFailure
Description copied from interface:HttpResponderInvoked when a resource failed to be retrieved.- Specified by:
handleFailurein interfaceHttpResponder- Parameters:
type- the error type, either one ofHttpRequest.CONNECTION_ERROR,HttpRequest.TEMPORARY_ERRORorHttpRequest.PERMANENT_ERRORerrorMessage- the error message associated with the failure
-