public class RemoteHttpClient
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
boolean |
finishBatch(ResponseHandler callback) |
boolean |
finishBatch(ResponseHandler callback,
int timeoutMs)
Finish batch - perform all delayed calls in one AJAX request
|
void |
get(java.lang.String url,
java.util.Map<java.lang.String,java.lang.String> params,
ResponseHandler callback) |
BaseSdkHttpClient |
getHttpClient() |
static RemoteHttpClient |
getInstance() |
void |
post(java.lang.String url,
java.util.Map<java.lang.String,java.lang.String> params,
ResponseHandler callback) |
void |
post(java.lang.String url,
java.util.Map<java.lang.String,java.lang.String> params,
ResponseHandler callback,
int timeoutMs) |
void |
remoteCall(java.lang.String svc,
com.google.gson.JsonElement params,
ResponseHandler callback) |
void |
remoteCall(java.lang.String svc,
java.lang.String params,
ResponseHandler callback) |
void |
remoteCall(java.lang.String svc,
java.lang.String params,
ResponseHandler callback,
int timeoutMs)
Perform remote service AJAX request
|
void |
setHttpClient(BaseSdkHttpClient client) |
boolean |
startBatch()
Start batch - set of remote calls in one AJAX request
|
void |
uploadFile(java.io.File file,
java.lang.String svc,
java.lang.String params,
ResponseHandler callback,
int timeout)
Upload file method
|
public static RemoteHttpClient getInstance()
public void setHttpClient(BaseSdkHttpClient client)
public BaseSdkHttpClient getHttpClient()
public boolean startBatch()
public boolean finishBatch(ResponseHandler callback, int timeoutMs)
callback
- function to call with result of AJAX call: callback(code, combinedCode). code is zero if no errors. combinedCode is zero if all combined requests where successfully.public boolean finishBatch(ResponseHandler callback)
public void remoteCall(java.lang.String svc, java.lang.String params, ResponseHandler callback, int timeoutMs)
svc
- service nameparams
- request propertiescallback
- function to call with result of AJAX callpublic void remoteCall(java.lang.String svc, java.lang.String params, ResponseHandler callback)
public void remoteCall(java.lang.String svc, com.google.gson.JsonElement params, ResponseHandler callback)
public void uploadFile(java.io.File file, java.lang.String svc, java.lang.String params, ResponseHandler callback, int timeout)
file
- File object to sendsvc
- service nameparams
- optional parameterscallback
- callback that will receive file upload resulttimeout
- int - secpublic void post(java.lang.String url, java.util.Map<java.lang.String,java.lang.String> params, ResponseHandler callback, int timeoutMs)
public void post(java.lang.String url, java.util.Map<java.lang.String,java.lang.String> params, ResponseHandler callback)
public void get(java.lang.String url, java.util.Map<java.lang.String,java.lang.String> params, ResponseHandler callback)