Package com.bitheads.braincloud.services
Class ScriptService
java.lang.Object
com.bitheads.braincloud.services.ScriptService
public class ScriptService extends Object
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classScriptService.Parameter -
Constructor Summary
Constructors Constructor Description ScriptService(BrainCloudClient client) -
Method Summary
Modifier and Type Method Description voidcancelScheduledScript(String jobId, IServerCallback callback)Cancels a scheduled cloud code script Service Name - Script Service Operation - CANCEL_SCHEDULED_SCRIPTvoidgetRunningOrQueuedCloudScripts(IServerCallback callback)Allows 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 - ScheduleCloudScriptvoidscheduleRunScriptUTC(String scriptName, String jsonScriptData, Date startTimeUTC, IServerCallback callback)Deprecated.Use scheduleRunScriptMillisUTC instead - Removal September 1, 2021
-
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
-
scheduleRunScriptUTC
public void scheduleRunScriptUTC(String scriptName, String jsonScriptData, Date startTimeUTC, IServerCallback callback)Deprecated.Use scheduleRunScriptMillisUTC instead - Removal September 1, 2021Schedules a script to run at given UTC time.- Parameters:
scriptName- The name of the script with its path to be run.jsonScriptData- Data to be sent to the script in JSON format.startTimeUTC- The start date. (date in millis UTC)callback- The callback handler
-
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
-