Accela SDK for Android  V3.0
 All Classes Functions Variables Pages
com.accela.mobile.AMRequestDelegate Class Reference
Inheritance diagram for com.accela.mobile.AMRequestDelegate:
com.accela.mobile.http.JsonHttpResponseHandler

Public Member Functions

void amRequestStarted (AMRequest request)
 
void amRequestDidReceiveResponse (AMRequest request)
 
void amRequestDidTimeout (AMRequest request)
 
void amRequestDidFailWithError (AMRequest request, AMError error)
 
void amRequestDidLoad (AMRequest request, JSONObject result)
 
void amRequestReceivedBytes (AMRequest request, long bytes, long total)
 
void amRequestSendBytes (AMRequest request, long bytes)
 
- Public Member Functions inherited from com.accela.mobile.http.JsonHttpResponseHandler
abstract void onSuccess (JSONObject response)
 
abstract void onFailure (Throwable error)
 
void onSuccess (JSONArray response)
 
- Public Member Functions inherited from com.accela.mobile.http.AsyncHttpResponseHandler
 AsyncHttpResponseHandler ()
 
abstract void onStart ()
 
void onFinish ()
 
void onSuccess (String content)
 
void onSuccess (byte[] content)
 
void onFailure (Throwable error)
 
void onTimeout ()
 

Protected Attributes

AMError amError
 
String errorCode
 
String traceId
 
String errorMessage
 

Additional Inherited Members

- Public Attributes inherited from com.accela.mobile.http.JsonHttpResponseHandler
JSONObject rawResponseJson
 
- Protected Member Functions inherited from com.accela.mobile.http.JsonHttpResponseHandler
void handleSuccessMessage (String responseBody)
 
JSONObject parseResponse (String responseBody) throws JSONException
 

Detailed Description

 Accela Amobile
 File: AMRequestDelegate.java
 Accela, Inc.
 Copyright (C): 2013
 Description:
 Request delegate, defines the methods which will be called during the lifecycle of a request.
 Notes:
 Revision History

   @since 1.0
 

Member Function Documentation

void com.accela.mobile.AMRequestDelegate.amRequestDidFailWithError ( AMRequest  request,
AMError  error 
)
inline

Called when an error prevents the request from completing successfully.

Parameters
requestThe AMRequest instance which is processing the current request.
errorThe AMError instance which contains the error information.
Returns
Void.
Since
1.0
void com.accela.mobile.AMRequestDelegate.amRequestDidLoad ( AMRequest  request,
JSONObject  result 
)
inline

Called when a request returns and its response has been parsed into an object. The resulting object format may be a dictionary or an array. Note that the result is null if the amDownloadDestinationPath property bas been set to a valid value.

Parameters
requestThe AMRequest instance which is processing the current request.
resultThe JSON object which contains the result data.
Returns
Void.
Since
1.0
void com.accela.mobile.AMRequestDelegate.amRequestDidReceiveResponse ( AMRequest  request)
inline

Called when the server responds and begins to send back data.

Parameters
requestThe AMRequest instance which is processing the current request.
Returns
Void.
Since
1.0
void com.accela.mobile.AMRequestDelegate.amRequestDidTimeout ( AMRequest  request)
inline

Called when an request times out after waiting the connection time interval defined in AMSetting.

Parameters
requestThe AMRequest instance which is processing the current request.
Returns
Void.
Since
3.1
void com.accela.mobile.AMRequestDelegate.amRequestReceivedBytes ( AMRequest  request,
long  bytes,
long  total 
)
inline

Called when the request receives some data.

Note that the total is 0 if there is no Content-Length variable in the HTTP headers.

Parameters
requestThe AMRequest instance which is processing the current request.
bytesThe bytes of data which has been received.
totalThe total bytes of data which will be received.
Since
1.0
void com.accela.mobile.AMRequestDelegate.amRequestSendBytes ( AMRequest  request,
long  bytes 
)
inline

Called when the request sends some data.

Parameters
requestThe AMRequest instance which is processing the current request.
bytesThe bytes of data which has been sent.
Since
1.0
void com.accela.mobile.AMRequestDelegate.amRequestStarted ( AMRequest  request)
inline

Called just before the request is sent to the server.

Parameters
requestThe AMRequest instance which is processing the current request.
Returns
Void.
Since
1.0

Member Data Documentation

AMError com.accela.mobile.AMRequestDelegate.amError
protected

The AMError instance binded to the current delegate.

Since
3.0
String com.accela.mobile.AMRequestDelegate.errorCode
protected

The error code got from the JSON returned by API.

Since
3.0
String com.accela.mobile.AMRequestDelegate.errorMessage
protected

The message got from the JSON returned by API.

Since
3.0
String com.accela.mobile.AMRequestDelegate.traceId
protected

The trace ID got from the JSON returned by API.

Since
3.0

The documentation for this class was generated from the following file: