com.sponsorpay.sdk.android.publisher.currency
Class VirtualCurrencyConnector.CurrencyServerRequestAsyncTask

java.lang.Object
  extended by 
      extended by com.sponsorpay.sdk.android.publisher.currency.VirtualCurrencyConnector.CurrencyServerRequestAsyncTask
Enclosing class:
VirtualCurrencyConnector

private class VirtualCurrencyConnector.CurrencyServerRequestAsyncTask
extends

VirtualCurrencyConnector.CurrencyServerRequestAsyncTask used to perform the HTTP requests on a background thread and be notified of its results on the calling thread.


Field Summary
 boolean didTriggerException
          Whether the request triggered a local exception, usually denoting a network connectivity problem.
private  java.lang.String mRequestUrl
          URL for the request which will be performed in the background.
private  VirtualCurrencyConnector mVcc
          Tightly coupled host VirtualCurrencyConnector.
 VirtualCurrencyConnector.RequestType requestType
          Type of the request which will be performed in the background.
 java.lang.String responseBody
          Server's response body.
 java.lang.String signature
          Server's response signature, extracted of the "X-Sponsorpay-Response-Signature" header.
private static java.lang.String SIGNATURE_HEADER
          Custom SponsorPay HTTP header containing the signature of the response.
 int statusCode
          Status code of the server's response.
 
Constructor Summary
VirtualCurrencyConnector.CurrencyServerRequestAsyncTask(VirtualCurrencyConnector vcc, VirtualCurrencyConnector.RequestType requestType, java.lang.String requestUrl)
          Initializes a new instance whose #execute() still needs to be invoked to trigger the request.
 
Method Summary
protected  java.lang.Void doInBackground(java.lang.Void... params)
          Performs the request in the background.
protected  void onPostExecute(java.lang.Void result)
          Called in the original thread when a response from the server is available.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SIGNATURE_HEADER

private static final java.lang.String SIGNATURE_HEADER
Custom SponsorPay HTTP header containing the signature of the response.

See Also:
Constant Field Values

mVcc

private VirtualCurrencyConnector mVcc
Tightly coupled host VirtualCurrencyConnector.


mRequestUrl

private java.lang.String mRequestUrl
URL for the request which will be performed in the background.


requestType

public VirtualCurrencyConnector.RequestType requestType
Type of the request which will be performed in the background.


statusCode

public int statusCode
Status code of the server's response.


responseBody

public java.lang.String responseBody
Server's response body.


signature

public java.lang.String signature
Server's response signature, extracted of the "X-Sponsorpay-Response-Signature" header.


didTriggerException

public boolean didTriggerException
Whether the request triggered a local exception, usually denoting a network connectivity problem.

Constructor Detail

VirtualCurrencyConnector.CurrencyServerRequestAsyncTask

public VirtualCurrencyConnector.CurrencyServerRequestAsyncTask(VirtualCurrencyConnector vcc,
                                                               VirtualCurrencyConnector.RequestType requestType,
                                                               java.lang.String requestUrl)
Initializes a new instance whose #execute() still needs to be invoked to trigger the request.

Parameters:
vcc - Host VirtualCurrencyConnector
requestType - Type of the request to be performed. See VirtualCurrencyConnector.RequestType.
requestUrl - Url of the request to be performed.
Method Detail

doInBackground

protected java.lang.Void doInBackground(java.lang.Void... params)
Performs the request in the background. Called by the parent VirtualCurrencyConnector.CurrencyServerRequestAsyncTask when #execute(Void...) is invoked.

Parameters:
-
Returns:

onPostExecute

protected void onPostExecute(java.lang.Void result)
Called in the original thread when a response from the server is available. Notifies the host VirtualCurrencyConnector.

Parameters:
result -