Package com.bitheads.braincloud.services
Class ScriptService
java.lang.Object
com.bitheads.braincloud.services.ScriptService
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcancelScheduledScript(String jobId, IServerCallback callback) Cancels a scheduled cloud code script Service Name - Script Service Operation - CANCEL_SCHEDULED_SCRIPTvoidAllows cloud script executions to be scheduled Service Name - Script Service Operation - ScheduleCloudScriptvoidgetScheduledCloudScripts(Date startTimeUTC, IServerCallback callback) Allows cloud script executions to be scheduled Service Name - Script Service Operation - ScheduleCloudScriptvoidrunParentScript(String scriptName, String scriptData, String parentLevel, IServerCallback callback) Run a cloud script in a parent app Service Name - Script Service Operation - RUN_PARENT_SCRIPTvoidrunPeerScript(String scriptName, String jsonScriptData, String peer, IServerCallback callback) Runs a script from the context of a peer Service Name - Script Service Operation - RUN_PEER_SCRIPTvoidrunPeerScriptAsync(String scriptName, String jsonScriptData, String peer, IServerCallback callback) Runs a script asynchronously from the context of a peer This method does not wait for the script to complete before returning Service Name - Script Service Operation - RUN_PEER_SCRIPT_ASYNCvoidrunScript(String scriptName, String jsonScriptData, IServerCallback callback) Executes a script on the server.voidscheduleRunScriptMillisUTC(String scriptName, String jsonScriptData, long startTimeUTC, IServerCallback callback) Allows cloud script executions to be scheduled Service Name - Script Service Operation - ScheduleCloudScriptvoidscheduleRunScriptMinutes(String scriptName, String jsonScriptData, int minutesFromNow, IServerCallback callback) Allows cloud script executions to be scheduled Service Name - Script Service Operation - ScheduleCloudScript
-
Constructor Details
-
ScriptService
-
-
Method Details
-
runScript
Executes a script on the server. Service Name - Script Service Operation - Run- Parameters:
scriptName- The name of the script to be runjsonScriptData- Data to be sent to the script in json formatcallback- The callback handler See The API documentation site for more details on cloud code
-
scheduleRunScriptMillisUTC
public void scheduleRunScriptMillisUTC(String scriptName, String jsonScriptData, long startTimeUTC, IServerCallback callback) Allows cloud script executions to be scheduled Service Name - Script Service Operation - ScheduleCloudScript- Parameters:
scriptName- The name of the script to be runjsonScriptData- JSON bundle to pass to scriptstartTimeUTC- The start date as a Date objectcallback- The callback handler See The API documentation site for more details on cloud code
-
scheduleRunScriptMinutes
public void scheduleRunScriptMinutes(String scriptName, String jsonScriptData, int minutesFromNow, IServerCallback callback) Allows cloud script executions to be scheduled Service Name - Script Service Operation - ScheduleCloudScript- Parameters:
scriptName- The name of the script to be runjsonScriptData- JSON bundle to pass to scriptminutesFromNow- Number of minutes from now to run scriptcallback- The callback handler See The API documentation site for more details on cloud code
-
runParentScript
public void runParentScript(String scriptName, String scriptData, String parentLevel, IServerCallback callback) Run a cloud script in a parent app Service Name - Script Service Operation - RUN_PARENT_SCRIPT- Parameters:
scriptName- The name of the script to be runscriptData- Data to be sent to the script in json formatparentLevel- The level name of the parent to run the script fromcallback- The method to be invoked when the server response is received See The API documentation site for more details on cloud code
-
getScheduledCloudScripts
Allows cloud script executions to be scheduled Service Name - Script Service Operation - ScheduleCloudScript- Parameters:
startTimeUTC- The start date as a Date objectcallback- The method to be invoked when the server response is received See The API documentation site for more details on cloud code
-
getRunningOrQueuedCloudScripts
Allows cloud script executions to be scheduled Service Name - Script Service Operation - ScheduleCloudScript- Parameters:
callback- The method to be invoked when the server response is received See The API documentation site for more details on cloud code
-
cancelScheduledScript
Cancels a scheduled cloud code script Service Name - Script Service Operation - CANCEL_SCHEDULED_SCRIPT- Parameters:
jobId- The scheduled script job to cancelcallback- The method to be invoked when the server response is received
-
runPeerScript
public void runPeerScript(String scriptName, String jsonScriptData, String peer, IServerCallback callback) Runs a script from the context of a peer Service Name - Script Service Operation - RUN_PEER_SCRIPT- Parameters:
scriptName- The name of the script to be runjsonScriptData- Data to be sent to the script in json formatpeer- Peer the script belongs tocallback- The method to be invoked when the server response is received
-
runPeerScriptAsync
public void runPeerScriptAsync(String scriptName, String jsonScriptData, String peer, IServerCallback callback) Runs a script asynchronously from the context of a peer This method does not wait for the script to complete before returning Service Name - Script Service Operation - RUN_PEER_SCRIPT_ASYNC- Parameters:
scriptName- The name of the script to be runjsonScriptData- Data to be sent to the script in json formatpeer- Peer the script belongs tocallback- The method to be invoked when the server response is received
-