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

Public Member Functions

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 ()
 

Public Attributes

JSONObject rawResponseJson
 
- Public Attributes inherited from com.accela.mobile.http.AsyncHttpResponseHandler
HttpResponse httpResponse
 
Header[] responseHeaders
 
String rawResponseBody
 

Protected Member Functions

void handleSuccessMessage (String responseBody)
 
JSONObject parseResponse (String responseBody) throws JSONException
 
- Protected Member Functions inherited from com.accela.mobile.http.AsyncHttpResponseHandler
void sendTimeoutMessage ()
 
void sendSuccessMessage (byte[] responseBody)
 
void sendFailureMessage (Throwable e)
 
void sendStartMessage ()
 
void sendFinishMessage ()
 
void handleSuccessMessage (byte[] responseBody)
 
void handleSuccessMessage (String responseBody)
 
void handleFailureMessage (Throwable e)
 
void handleMessage (Message msg)
 
void sendMessage (Message msg)
 
Message obtainMessage (int responseMessage, Object response)
 
void sendResponseMessage (HttpResponse response)
 

Additional Inherited Members

- Protected Attributes inherited from com.accela.mobile.http.AsyncHttpResponseHandler
int responseStatusCode
 

Detailed Description

 Accela Amobile
 File: JsonHttpResponseHandler.java
 Accela, Inc.
 Copyright (C): 2012
 Description:
 Json response callback handler object, called during an asynchronous request is being processed.
 Notes:
Used to intercept and handle the responses from requests made using 
AsyncHttpClient, with automatic parsing into a JSONObject
or JSONArray.
This class is designed to be passed to get, post, put and delete requests
with the onSuccess(JSONObject) or onSuccess(JSONArray)
methods anonymously overridden.
Additionally, you can override the other event methods from the 
parent class.
 Revision History

   @since 1.0
 

Member Function Documentation

void com.accela.mobile.http.JsonHttpResponseHandler.handleSuccessMessage ( String  responseBody)
inlineprotected

Override the handleSuccessMessage method inherited from its parent class.

abstract void com.accela.mobile.http.JsonHttpResponseHandler.onFailure ( Throwable  error)
pure virtual

Fired when a request fails to complete, *override to handle in your own code.

Parameters
errorThe underlying cause of the failure.
Returns
Void.
@since 1.0
abstract void com.accela.mobile.http.JsonHttpResponseHandler.onSuccess ( JSONObject  response)
pure virtual

Fired when a request returns successfully and contains a json object *at the base of the response string. Override to handle in your own code.

Parameters
responseThe parsed json object found in the server response (if any).
Returns
Void.
@since 1.0
void com.accela.mobile.http.JsonHttpResponseHandler.onSuccess ( JSONArray  response)
inline

Fired when a request returns successfully and contains a json array *at the base of the response string. Override to handle in your own code.

Parameters
responseThe parsed json array found in the server response (if any).
Returns
Void.
@since 1.0
JSONObject com.accela.mobile.http.JsonHttpResponseHandler.parseResponse ( String  responseBody) throws JSONException
inlineprotected

Protected method, used to convert response string to JSON object.


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