|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.stackmob.sdk.callback.StackMobRawCallback
public abstract class StackMobRawCallback
The most basic callback you can supply to StackMob methods. This is a specialized method, StackMobCallback should be
used in most cases. This callback receives every detail of the request and response, for cases when you want to check header
values or get other information.
| Field Summary | |
|---|---|
protected String |
requestBody
|
protected List<Map.Entry<String,String>> |
requestHeaders
|
protected String |
requestURL
|
protected com.stackmob.sdk.net.HttpVerb |
requestVerb
|
protected byte[] |
responseBody
|
protected List<Map.Entry<String,String>> |
responseHeaders
|
protected Integer |
responseStatusCode
|
protected int |
retriesRemaining
|
| Constructor Summary | |
|---|---|
StackMobRawCallback()
|
|
| Method Summary | |
|---|---|
abstract void |
circularRedirect(String originalUrl,
Map<String,String> redirectHeaders,
String redirectBody,
String newURL)
Invoked when a circular redirect has been detected. |
abstract void |
done(com.stackmob.sdk.net.HttpVerb requestVerb,
String requestURL,
List<Map.Entry<String,String>> requestHeaders,
String requestBody,
Integer responseStatusCode,
List<Map.Entry<String,String>> responseHeaders,
byte[] responseBody)
the method that will be called when the call to StackMob is complete. |
int |
getRetriesRemaining()
get the number of times the request will be automatically retried if necessary |
static Integer |
getTotalNumberOfItemsFromContentRange(List<Map.Entry<String,String>> responseHeaders)
get the total number of items from the Content-Range header |
int |
getTotalObjectCountFromPagination()
get the total number of items from the Content-Range header |
boolean |
redirected(String originalUrl,
Map<String,String> redirectHeaders,
String redirectBody,
String newURL)
Invoked when a redirect has been issued. |
boolean |
retry(int afterMilliseconds)
The method that will be called when a retry is possible. |
void |
setDone(com.stackmob.sdk.net.HttpVerb requestVerb,
String requestURL,
List<Map.Entry<String,String>> requestHeaders,
String requestBody,
Integer responseStatusCode,
List<Map.Entry<String,String>> responseHeaders,
byte[] responseBody)
the method that will be called when the call to StackMob is complete. |
void |
setRetriesRemaining(int remaining)
override the number of times the request should be retried |
abstract void |
temporaryPasswordResetRequired(StackMobException e)
the method that will be called in the very specific case where a user has done a login with a temporary password, and now they need to reset their password to continue. |
abstract void |
unsent(StackMobException e)
the method that will be called when a call to StackMob cannot even be sent for some reason |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected com.stackmob.sdk.net.HttpVerb requestVerb
protected String requestURL
protected List<Map.Entry<String,String>> requestHeaders
protected String requestBody
protected Integer responseStatusCode
protected List<Map.Entry<String,String>> responseHeaders
protected byte[] responseBody
protected int retriesRemaining
| Constructor Detail |
|---|
public StackMobRawCallback()
| Method Detail |
|---|
public abstract void unsent(StackMobException e)
e - an error with the reason whypublic abstract void temporaryPasswordResetRequired(StackMobException e)
StackMobUser.loginResettingTemporaryPassword(String, StackMobCallback)
with the new password
e - an error with the reason why
public void setDone(com.stackmob.sdk.net.HttpVerb requestVerb,
String requestURL,
List<Map.Entry<String,String>> requestHeaders,
String requestBody,
Integer responseStatusCode,
List<Map.Entry<String,String>> responseHeaders,
byte[] responseBody)
requestVerb - the HTTP verb that was requestedrequestURL - the URL that was requestedrequestHeaders - the headers in the requestrequestBody - the body of the request. will be an empty string for GET, DELETE, etc...responseStatusCode - the status code of the HTTP response from StackMobresponseHeaders - the response headers from StackMobresponseBody - the response body from StackMob
public abstract void done(com.stackmob.sdk.net.HttpVerb requestVerb,
String requestURL,
List<Map.Entry<String,String>> requestHeaders,
String requestBody,
Integer responseStatusCode,
List<Map.Entry<String,String>> responseHeaders,
byte[] responseBody)
requestVerb - the HTTP verb that was requestedrequestURL - the URL that was requestedrequestHeaders - the headers in the requestrequestBody - the body of the request. will be an empty string for GET, DELETE, etc...responseStatusCode - the status code of the HTTP response from StackMobresponseHeaders - the response headers from StackMobresponseBody - the response body from StackMobpublic boolean retry(int afterMilliseconds)
afterMilliseconds - the number of milliseconds to wait until retrying the request.
public boolean redirected(String originalUrl,
Map<String,String> redirectHeaders,
String redirectBody,
String newURL)
originalUrl - the url being redirected fromredirectHeaders - headers that came with the redirectredirectBody - the body that came with the redirectnewURL - the url being redirected to
public abstract void circularRedirect(String originalUrl,
Map<String,String> redirectHeaders,
String redirectBody,
String newURL)
originalUrl - the url being redirected fromredirectHeaders - headers that came with the redirectredirectBody - the body that came with the redirectnewURL - the url being redirected topublic int getRetriesRemaining()
public void setRetriesRemaining(int remaining)
remaining - the number of times the request should be retriedpublic int getTotalObjectCountFromPagination()
public static Integer getTotalNumberOfItemsFromContentRange(List<Map.Entry<String,String>> responseHeaders)
responseHeaders - the headers that were returned in the response
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||