public class NCMBScript
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
NCMBScript.MethodType
HTTP method types
|
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
mBaseUrl |
protected NCMBScript.MethodType |
mMethod |
protected java.lang.String |
mScriptName |
Constructor and Description |
---|
NCMBScript(java.lang.String scriptName,
NCMBScript.MethodType method)
Create NCMBScript instance with specified script name and request method
|
NCMBScript(java.lang.String scriptName,
NCMBScript.MethodType method,
java.lang.String baseUrl)
Create NCMBScript instance with specified script name and request method
This constructor can set the custom endpoint for debug
|
Modifier and Type | Method and Description |
---|---|
byte[] |
execute(java.util.Map<java.lang.String,java.lang.String> header,
org.json.JSONObject body,
org.json.JSONObject query)
Execute the script with request parameters
|
void |
executeInBackground(java.util.Map<java.lang.String,java.lang.String> header,
org.json.JSONObject body,
org.json.JSONObject query,
ExecuteScriptCallback callback)
Execute the script asynchronously with request parameters
|
java.lang.String |
getBaseUrl()
get the script base url
|
NCMBScript.MethodType |
getMethod()
get the HTTP method
|
java.lang.String |
getScriptName()
get the script name
|
void |
setBaseUrl(java.lang.String baseUrl)
set the script base url
|
void |
setMethod(NCMBScript.MethodType method)
set the HTTP method
|
void |
setScriptName(java.lang.String scriptName)
set the script name
|
protected java.lang.String mScriptName
protected NCMBScript.MethodType mMethod
protected java.lang.String mBaseUrl
public NCMBScript(java.lang.String scriptName, NCMBScript.MethodType method)
scriptName
- script namemethod
- HTTP methodpublic NCMBScript(java.lang.String scriptName, NCMBScript.MethodType method, java.lang.String baseUrl)
scriptName
- script namemethod
- HTTP methodbaseUrl
- script base urlpublic void setScriptName(java.lang.String scriptName)
scriptName
- script namepublic java.lang.String getScriptName()
public void setMethod(NCMBScript.MethodType method)
method
- HTTP method typepublic NCMBScript.MethodType getMethod()
public void setBaseUrl(java.lang.String baseUrl)
baseUrl
- script base urlpublic java.lang.String getBaseUrl()
public byte[] execute(java.util.Map<java.lang.String,java.lang.String> header, org.json.JSONObject body, org.json.JSONObject query) throws NCMBException
header
- header databody
- content dataquery
- query paramsNCMBException
- exception from NIFCLOUD mobile backendpublic void executeInBackground(java.util.Map<java.lang.String,java.lang.String> header, org.json.JSONObject body, org.json.JSONObject query, ExecuteScriptCallback callback)
header
- header databody
- content dataquery
- query paramscallback
- callback after execute script