Class ZmBatchCommand
Instead of calling sendRequest(), the command should hand the batch command its SOAP document or JSON object, response callback, and error callback. The last argument that the command receives is a reference to the batch command; that's how it knows it's in batch mode.
After all commands have been added to the batch command, call its run() method. That will
create a BatchRequest out of the individual commands' requests and send it to the
server. Each subrequest gets an ID. When the BatchResponse comes back, it is broken into
individual responses. If a response indicates success (it is a A command does not have to be the method that generates a SOAP document or JSON object. It can be higher-level. Just make sure that the reference to the batch command gets passed down to it. Defined in: ZmBatchCommand.js.
Class Detail
ZmBatchCommand(continueOnError, accountName, useJson)
Creates an empty batch command. Use the #add method to add commands to it,
and #run to invoke it.
Author: Conrad Damon.
Method Detail
add(cmd)
Adds a command to the list of commands to run as part of this batch request.
addNewRequestParams(request, respCallback, errorCallback)
Adds the given command parameters to the batch command, as part of a command's
invocation. Should be called without a previous #add command, when the request
object can immediately generate its request object.
addRequestParams(request, respCallback, errorCallback)
Adds the given command parameters to the batch command, as part of a command's
invocation. Should be called by a function that was added via #add earlier; that
function should pass the request object.
{Boolean}
isSensitive()
Checks if the command is sensitive.
run(callback, errorCallback, offlineCallback)
Runs the batch request. For each individual request, either a response or an
error callback will be called.
setNoAuthToken(noAuthToken)
Sets the noAuthToken flag.
setSensitive(sensitive)
Sets the sensitive flag. This indicates that this batch command
contains a request with sensitive data. Note: There is no way to unset
this value for the batch command.
{int}
size()
Gets the number of commands that are part of this batch request.
{String}
toString()
Returns a string representation of the object.
|
||||||||||||||||||||||||
Documentation generated by JsDoc Toolkit 2.3.0 on Tue Jun 28 2016 21:01:30 GMT-0400 (EDT)
|