DAAsyncRequestDelegate

Overview

The DAAsyncRequestDelegate describes the delegate methods that a DAAsyncRequest will call on its delegate object, to inform it about successful or failed data calls. All delegate methods are @optional.

Location

Optional Methods


asyncRequest:didFailToApplyChange:forTable:

Informs the delegate that one or more changes failed to be applied on the server. The delegate may inspect the passed DADeltaChange to find out more about the specific failures and to decide how to handle them (for example by correcting data itself, or showing a Reconcile Dialog.

@optional - (void) asyncRequest:(DAAsyncRequest *)request didFailToApplyChange:(DADeltaChange *)change forTable:(DADataTable *)table

Parameters:

  • request: Represents the instance of the DAAsyncRequest for which that event happened.
  • change: Instance of the DADeltaChange which failed to apply.
  • table: instance of the table for which given request failed

asyncRequest:didFailWithException:

Informs the delegate that the request has failed with the given exception.

@optional - (void) asyncRequest:(ROAsyncRequest *)request didFailWithException:(NSException *)exception

Parameters:

  • request: Represents the instance of the DAAsyncRequest for which that event happened.
  • exception: Instance of the exception that happened during executing asynchronous request

asyncRequest:didFinishApplyingChangesForTables:withErrors:

Informs the delegate that the request has finished applying changes to all tables contained in the request. If any errors were encountered, the errors parameter contains a list of failing DADeltaChanges. The above delegate method, asyncRequest:didFailToApplyChange:forTable: will have been called for each item in the errors list.

@optional - (void) asyncRequest:(DAAsyncRequest *)request didFinishApplyingChangesForTables:(NSArray *)tables withErrors:(NSArray *)errors

Parameters:

  • request: Represents the instance of the DAAsyncRequest for which that event happened.
  • tables: List of table names that took part in given request.
  • errors: list of failing DADeltaChanges. If no errros were encountered and all changes were applied successfully, errors is nil.

asyncRequest:didFinishExecutingCommand:withResult:andOutputParams:

Informs the delegate that the request has finished executing given command with given result and output parameters.

@optional - (void) asyncRequest:(DAAsyncRequest *)request didFinishExecutingCommand:(NSString *)commandName withResult:(int)result andOutputParams:(NSDictionary *)outParams

Parameters:

  • request: Represents the instance of the DAAsyncRequest for which that event happened.
  • commandName: Name of the comand that has been executed
  • result: Result of command execution
  • outParams: Dictionary of output parameters that can hold some results of execution

asyncRequest:didReceiveData:

Informs the delegate that the raw data for a given DADataTable has been successfully received from the server.

If the request was initiated by calling one of the beginGetDataFor* methods of the DARemoteDataAdapter to request raw data only, it is up to the delegate to further process the received block of data. If the request was initiated by calling one of the beginGetDataTable* methods instead, the async request will continue to process the data, load it into datatable(s) and call one or both of the above two delegate methods, as well.

@optional - (void) asyncRequest:(DAAsyncRequest *)request didReceiveData:(NSData *)data

Parameters:

  • request: Represents the instance of the DAAsyncRequest for which that event happened.
  • data: Instance of the recieved NSData

asyncRequest:didReceiveDataSize:ofExpected:

Informs the delegate that the request is in progress and has received the amount of bytes indicated by size and that a total of totalSize bytes is expected. This delegate method is useful for displaying progress information to the user, or otherwise keeping track of a large download of data.

@optional - (void) asyncRequest:(ROAsyncRequest *)request didReceiveDataSize:(int)size ofExpected:(int)totalSize

Parameters:

  • request: Represents the instance of the DAAsyncRequest for which that event happened.
  • size: Recieved size (in bytes)
  • totalSize: Total size (in bytes)

asyncRequest:didReceiveSchema:

Informs the delegate that the given DASchema has been successfully received from the server.

@optional - (void) asyncRequest:(DAAsyncRequest *)request didReceiveSchema:(DASchema *)schema

Parameters:

  • request: Represents the instance of the DAAsyncRequest for which that event happened.
  • schema: Represents an instance of the recieved schema

asyncRequest:didReceiveTable:

Informs the delegate that the given DADataTable has been successfully received from the server.

@optional - (void) asyncRequest:(DAAsyncRequest *)request didReceiveTable:(DADataTable *)table

Parameters:

  • request: Represents the instance of the DAAsyncRequest for which that event happened.
  • table: Represents an instance of the recieved table

asyncRequest:didReceiveTables:

Informs the delegate that the given dictionary of DADataTables has been successfully received from the server. The tables parameter provides a dictionary containing all tables, keyed on the table name.

@optional - (void) asyncRequest:(DAAsyncRequest *)request didReceiveTables:(NSDictionary *)tables

Parameters:

  • request: Represents the instance of the DAAsyncRequest for which that event happened.
  • tables: Represents a dictionary containing all tables, keyed on the table name.