com.sponsorpay.sdk.android.publisher
Class AbstractConnector

java.lang.Object
  extended by com.sponsorpay.sdk.android.publisher.AbstractConnector
All Implemented Interfaces:
AsyncRequest.AsyncRequestResultListener
Direct Known Subclasses:
SponsorPayUnlockConnector, VirtualCurrencyConnector

public abstract class AbstractConnector
extends java.lang.Object
implements AsyncRequest.AsyncRequestResultListener

Abstract class defining some common functionality for contacting the SponsorPay's API.


Field Summary
protected  Context mContext
          Android application context.
protected  java.util.Map<java.lang.String,java.lang.String> mCustomParameters
          Map of custom key/values to add to the parameters on the requests.
protected  HostInfo mHostInfo
          HostInfo containing data about the host device and application, including its application ID.
protected  java.lang.String mSecurityToken
          Security token used to sign requests to the server and verify its responses.
protected  UserId mUserId
          ID of the user for whom the requests will be made.
protected  java.lang.String remoteResourceUrl
          URL of the SponsorPay's API resource to contact.
protected static java.lang.String URL_PARAM_KEY_TIMESTAMP
          Parameter key used to transmit the timestamp of the request.
 
Constructor Summary
protected AbstractConnector(Context context, java.lang.String userId, HostInfo hostInfo, java.lang.String securityToken)
           
 
Method Summary
protected  java.lang.String getCurrentUnixTimestampAsString()
          Gets the current UNIX timestamp (in seconds) for the outbound requests.
 void setCustomParameters(java.util.Map<java.lang.String,java.lang.String> customParams)
          Sets a map of custom key/values to add to the parameters on the requests to the REST API.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sponsorpay.sdk.android.publisher.AsyncRequest.AsyncRequestResultListener
onAsyncRequestComplete
 

Field Detail

URL_PARAM_KEY_TIMESTAMP

protected static final java.lang.String URL_PARAM_KEY_TIMESTAMP
Parameter key used to transmit the timestamp of the request.

See Also:
Constant Field Values

remoteResourceUrl

protected java.lang.String remoteResourceUrl
URL of the SponsorPay's API resource to contact.


mContext

protected Context mContext
Android application context.


mUserId

protected UserId mUserId
ID of the user for whom the requests will be made.


mHostInfo

protected HostInfo mHostInfo
HostInfo containing data about the host device and application, including its application ID.


mSecurityToken

protected java.lang.String mSecurityToken
Security token used to sign requests to the server and verify its responses.


mCustomParameters

protected java.util.Map<java.lang.String,java.lang.String> mCustomParameters
Map of custom key/values to add to the parameters on the requests.

Constructor Detail

AbstractConnector

protected AbstractConnector(Context context,
                            java.lang.String userId,
                            HostInfo hostInfo,
                            java.lang.String securityToken)
Method Detail

setCustomParameters

public void setCustomParameters(java.util.Map<java.lang.String,java.lang.String> customParams)
Sets a map of custom key/values to add to the parameters on the requests to the REST API.


getCurrentUnixTimestampAsString

protected java.lang.String getCurrentUnixTimestampAsString()
Gets the current UNIX timestamp (in seconds) for the outbound requests.

Returns: