Class sap.ui.model.analytics.BatchResponseCollectorModule: sap/ui/model/analytics/BatchResponseCollector


Simple Response Collection Component, collects the responses for each sub-request inside a bigger batch request.

Also handles clean-up after all responses (either success or error) have been collected. Instantiated in AnalyticalBinding.prototype._executeBatchRequest()

Constructor Summary
new sap.ui.model.analytics.BatchResponseCollector(mParams?)Constructor for a batch response collecting component.
Method Summary
collect(oResponse, sResponseType?)Collects responses of type BatchResponseCollector.TYPE_SUCCESS and BatchResponseCollector.TYPE_ERROR.
error(oResponse)Convenience function to collect an error response.
setup(mParams?)Setup-Function to initialize/reset the BatchResponseCollector.
success(oResponse)Convenience function to collect a success response.
Constructor Detail
new sap.ui.model.analytics.BatchResponseCollector(mParams?)
Constructor for a batch response collecting component.
Parameters:
{object}mParams? optional Setup-Parameter, @see BatchResponseCollector#setup
Method Detail
collect(oResponse, sResponseType?)
Collects responses of type BatchResponseCollector.TYPE_SUCCESS and BatchResponseCollector.TYPE_ERROR.

Keeps track of all collected responses and fires the necessary events after all responses for the requests, given in the constructor, have returned.

Parameters:
{object}oResponse the response which should be collected
{string}sResponseType? the type of the response, either BatchResponseCollector.TYPE_SUCCESS or BatchResponseCollector.TYPE_ERROR
error(oResponse)
Convenience function to collect an error response.

Internally BatchResponseCollector#collect is called, the second parameter is set to BatchResponseCollector.TYPE_ERROR

Parameters:
{object}oResponse the erroneous response object
setup(mParams?)
Setup-Function to initialize/reset the BatchResponseCollector.
Parameters:
{object}mParams? optional Setup-Parameter
{array}mParams.executedRequests an Array with detail informations for all executed batch sub-requests
{object}mParams.binding a reference to the AnalyticalBinding which started the batch request
{int}mParams.lastAnalyticalInfoVersion the analyticalInfo version at the time of the creation of this BatchResponseCollector instance, this may change during the process of a pending request. Typically changed via a call to AnalyticalBinding#updateAnalyticalInfo.
{function}mParam.success a success handler function, which is called after all requests in mParams.executedRequests have returned.
{function}mParam.error an error handler function, which is called if one or more requests have returned with an error
success(oResponse)
Convenience function to collect a success response.

Internally BatchResponseCollector#collect is called with second parameter BatchResponseCollector.TYPE_SUCCESS

Parameters:
{object}oResponse the successful response, which should be collected