com.stackmob.sdk.callback
Class StackMobIntermediaryCallback

java.lang.Object
  extended by com.stackmob.sdk.callback.StackMobRawCallback
      extended by com.stackmob.sdk.callback.StackMobCallback
          extended by com.stackmob.sdk.callback.StackMobIntermediaryCallback

public class StackMobIntermediaryCallback
extends StackMobCallback

A callback that allows you to inject some logic before the actual callback is called. This is useful when you want to reuse some standard callbacks but inject some custom logic in various places. This is a specialized class and most apps will never need it.


Field Summary
 
Fields inherited from class com.stackmob.sdk.callback.StackMobRawCallback
requestBody, requestHeaders, requestURL, requestVerb, responseBody, responseHeaders, responseStatusCode, retriesRemaining
 
Constructor Summary
StackMobIntermediaryCallback(StackMobCallback furtherCallback)
          Create a callback that by default just passes through to the given callback
 
Method Summary
 void failure(StackMobException e)
          override and call super to inject custom logic before failure
 StackMobCallback getFurtherCallback()
           
 void success(String responseBody)
          override and call super to inject custom logic before success
 
Methods inherited from class com.stackmob.sdk.callback.StackMobCallback
done, temporaryPasswordResetRequired, unsent
 
Methods inherited from class com.stackmob.sdk.callback.StackMobRawCallback
getRetriesRemaining, getTotalNumberOfItemsFromContentRange, getTotalObjectCountFromPagination, retry, setDone, setRetriesRemaining
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StackMobIntermediaryCallback

public StackMobIntermediaryCallback(StackMobCallback furtherCallback)
Create a callback that by default just passes through to the given callback

Parameters:
furtherCallback - the callback that should receive messages in the end
Method Detail

getFurtherCallback

public StackMobCallback getFurtherCallback()

success

public void success(String responseBody)
override and call super to inject custom logic before success

Specified by:
success in class StackMobCallback
Parameters:
responseBody - the response string received from StackMob

failure

public void failure(StackMobException e)
override and call super to inject custom logic before failure

Specified by:
failure in class StackMobCallback
Parameters:
e - a representation of the error that occurred


Copyright © 2013 StackMob. All Rights Reserved.