com.stackmob.sdk.callback
Class StackMobRawCallback

java.lang.Object
  extended by com.stackmob.sdk.callback.StackMobRawCallback
Direct Known Subclasses:
StackMobCallback

public abstract class StackMobRawCallback
extends java.lang.Object


Constructor Summary
StackMobRawCallback()
           
 
Method Summary
abstract  void done(HttpVerb requestVerb, java.lang.String requestURL, java.util.List<java.util.Map.Entry<java.lang.String,java.lang.String>> requestHeaders, java.lang.String requestBody, java.lang.Integer responseStatusCode, java.util.List<java.util.Map.Entry<java.lang.String,java.lang.String>> responseHeaders, byte[] responseBody)
          the method that will be called when the call to StackMob is complete.
static java.lang.Integer getTotalNumberOfItemsFromContentRange(java.util.List<java.util.Map.Entry<java.lang.String,java.lang.String>> responseHeaders)
          get the total number of items from the Content-Range header
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StackMobRawCallback

public StackMobRawCallback()
Method Detail

done

public abstract void done(HttpVerb requestVerb,
                          java.lang.String requestURL,
                          java.util.List<java.util.Map.Entry<java.lang.String,java.lang.String>> requestHeaders,
                          java.lang.String requestBody,
                          java.lang.Integer responseStatusCode,
                          java.util.List<java.util.Map.Entry<java.lang.String,java.lang.String>> responseHeaders,
                          byte[] responseBody)
the method that will be called when the call to StackMob is complete. may be executed in a background thread

Parameters:
requestVerb - the HTTP verb that was requested
requestURL - the URL that was requested
requestHeaders - the headers in the request
requestBody - the body of the request. will be an empty string for GET, DELETE, etc...
responseStatusCode - the status code of the HTTP response from StackMob
responseHeaders - the response headers from StackMob
responseBody - the response body from StackMob

getTotalNumberOfItemsFromContentRange

public static java.lang.Integer getTotalNumberOfItemsFromContentRange(java.util.List<java.util.Map.Entry<java.lang.String,java.lang.String>> responseHeaders)
get the total number of items from the Content-Range header

Parameters:
responseHeaders - the headers that were returned in the response
Returns:
the total number of items returned in the Content-Range header, -1 if there was no Content-Range header or it was malformed, -2 if the Content-Length header was present and well formed but the instance length was "*"


Copyright © 2012 StackMob. All Rights Reserved.