com.sponsorpay.sdk.android.publisher.unlock
Class UnlockedItemsResponse

java.lang.Object
  extended by com.sponsorpay.sdk.android.publisher.AbstractResponse
      extended by com.sponsorpay.sdk.android.publisher.unlock.UnlockedItemsResponse

public class UnlockedItemsResponse
extends AbstractResponse

Encloses a basic response received from the SponsorPay Unlock Server and methods to perform parsing of the returned JSON-encoded data.


Nested Class Summary
static class UnlockedItemsResponse.Item
          Encloses an SponsorPay Unlock Item and its status as received by the server.
 
Nested classes/interfaces inherited from class com.sponsorpay.sdk.android.publisher.AbstractResponse
AbstractResponse.RequestErrorType
 
Field Summary
private static java.lang.String ITEM_ID_KEY
           
private static java.lang.String ITEM_NAME_KEY
           
protected  SPUnlockResponseListener mListener
          Listener which will be notified after parsing the response.
private  java.util.Map<java.lang.String,UnlockedItemsResponse.Item> mReturnedItems
           
private static java.lang.String TIMESTAMP_KEY
           
private static java.lang.String UNLOCKED_KEY
           
 
Fields inherited from class com.sponsorpay.sdk.android.publisher.AbstractResponse
ERROR_CODE_KEY, ERROR_MESSAGE_KEY, mErrorCode, mErrorMessage, mErrorType, mResponseBody, mResponseSignature, mResponseStatusCode
 
Constructor Summary
UnlockedItemsResponse()
           
 
Method Summary
 java.util.Map<java.lang.String,UnlockedItemsResponse.Item> getItems()
          Gets a dictionary of SponsorPay Unlock items as received from the server, where the keys are each of the item IDs.
 void invokeOnErrorCallback()
          Implement to invoke the response-type-specific on error callback notification.
 void invokeOnSuccessCallback()
          Implement to invoke the response-type-specific on success callback notification.
 void parseSuccessfulResponse()
          Implement to parse a successful-HTTP-status-code containing response.
(package private)  void setErrorType(AbstractResponse.RequestErrorType errorType)
           
 void setResponseListener(SPUnlockResponseListener listener)
          Set the response listener which will be notified when the parsing is complete.
 
Methods inherited from class com.sponsorpay.sdk.android.publisher.AbstractResponse
getErrorCode, getErrorMessage, getErrorType, hasErrorStatusCode, parseAndCallListener, parseErrorResponse, setResponseData, verifySignature
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ITEM_ID_KEY

private static final java.lang.String ITEM_ID_KEY
See Also:
Constant Field Values

ITEM_NAME_KEY

private static final java.lang.String ITEM_NAME_KEY
See Also:
Constant Field Values

TIMESTAMP_KEY

private static final java.lang.String TIMESTAMP_KEY
See Also:
Constant Field Values

UNLOCKED_KEY

private static final java.lang.String UNLOCKED_KEY
See Also:
Constant Field Values

mReturnedItems

private java.util.Map<java.lang.String,UnlockedItemsResponse.Item> mReturnedItems

mListener

protected SPUnlockResponseListener mListener
Listener which will be notified after parsing the response. Every response type may call a different listener method.

Constructor Detail

UnlockedItemsResponse

public UnlockedItemsResponse()
Method Detail

setResponseListener

public void setResponseListener(SPUnlockResponseListener listener)
Set the response listener which will be notified when the parsing is complete. Every response type may call a different listener method.

Parameters:
listener -

getItems

public java.util.Map<java.lang.String,UnlockedItemsResponse.Item> getItems()
Gets a dictionary of SponsorPay Unlock items as received from the server, where the keys are each of the item IDs.

Returns:

parseSuccessfulResponse

public void parseSuccessfulResponse()
Description copied from class: AbstractResponse
Implement to parse a successful-HTTP-status-code containing response.

Specified by:
parseSuccessfulResponse in class AbstractResponse

invokeOnSuccessCallback

public void invokeOnSuccessCallback()
Description copied from class: AbstractResponse
Implement to invoke the response-type-specific on success callback notification.

Specified by:
invokeOnSuccessCallback in class AbstractResponse

invokeOnErrorCallback

public void invokeOnErrorCallback()
Description copied from class: AbstractResponse
Implement to invoke the response-type-specific on error callback notification.

Specified by:
invokeOnErrorCallback in class AbstractResponse

setErrorType

void setErrorType(AbstractResponse.RequestErrorType errorType)