Page tree


com.pubmatic.sdk.common

Class AdRequest

java.lang.Object

com.pubmatic.sdk.common.AdRequest


Direct Known Subclasses:

PMAdRequest


public abstract class AdRequest
        
extends java.lang.Object

Field Summary

Modifier and TypeField and Description
protected boolean

isAndroidAidEnabled

Indicates whether the Advertising ID is sent in the request.

protected com.pubmatic.sdk.common.CommonConstants.CHANNEL mChannel
protected android.content.Context mContext
protected java.util.Map<java.lang.String, java.util.List<java.lang.String>>

mCustomParams

Lets publisher define custom Ad request parameters via Map.

protected android.location.Location mLocation
protected PMAdSize mPMAdSize
protected java.lang.StringBuffer mPostData
protected com.pubmatic.sdk.common.RRFormatter mRRFormatter
protected java.util.Map<java.lang.String, java.lang.String>

mUrlParams

Request URL params.

protected java.lang.String mUserAgent

Constructor Summary

ModifierConstructor and Description
protected

AdRequest (com.pubmatic.sdk.common.CommonConstants.CHANNEL channel)

Method Summary

Modifier and TypeMethod and Description
protected void addUrlParam(java.lang.String key, java.lang.String value)
abstract boolean checkMandatoryParams()
protected abstract java.lang.String

getAdServerURL()

Returns the base/hostname URL.

PMAdSize getAdSize() Returns the ad size set from setAdSize()
com.pubmatic.sdk.common.CommonConstants.CHANNEL getChannel()
android.content.Context getContext()
java.util.Map<java.lang.String, java.util.List<java.lang.String>> getCustomParams()
abstract com.pubmatic.sdk.common.RRFormatter getFormatter()
android.location.Location

getLocation()

Returns the user's location.

java.lang.String getPostData()
java.lang.String getRequestUrl()
java.util.Map<java.lang.String, java.lang.String> getUrlParams()
java.lang.String getUserAgent()
protected abstract void initializeDefaultParams()
boolean isAndroidAidEnabled()
protected void putPostData(java.lang.String key, java.lang.String value)
void

setAdSize(PMAdSize adSize)

Sets the banner ad size in the ad request to the provided size.

void

setAndroidAidEnabled(boolean isAndroidAidEnabled)

Controls whether the Advertisement ID is sent in the request.

void setContext(android.content.Context mContext)
void

setCustomParams(java.lang.String key, java.lang.String value)

Adds custom key-value parameters in the Ad request.

void

setLocation(android.location.Location location)

Set the user's location.

protected void setupPostData()
protected void setUpUrlParams()
protected void setUrlParams(java.util.Map<java.lang.String,java.lang.String> urlParams)
void setUserAgent(java.lang.String userAgent)

Methods inherited from class java.lang.Object


clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail


mContext

protected android.content.Context mContext

mPostData

protected java.lang.StringBuffer mPostData

mLocation

protected android.location.Location mLocation

mPMAdSize

protected PMAdSize mPMAdSize

mUserAgent

protected java.lang.String mUserAgent

mChannel

protected com.pubmatic.sdk.common.CommonConstants.CHANNEL mChannel

mUrlParams

protected java.util.Map<java.lang.String,java.lang.String> mUrlParams

Request URL parameters.

mCustomParams

protected java.util.Map<java.lang.String,java.util.List<java.lang.String>> mCustomParams

Lets publishers define custom Ad request parameters via Map.

isAndroidAidEnabled

protected boolean isAndroidAidEnabled

Indicates whether Advertising ID or Android ID is sent in the request.

Parameters:

True  - (default) sends Advertising ID in the request.

False  - sends Android ID in the request.

mRRFormatter

protected com.pubmatic.sdk.common.RRFormatter mRRFormatter

Constructor Detail


AdRequest

protected AdRequest(com.pubmatic.sdk.common.CommonConstants.CHANNEL channel)

Method Detail


getFormatter

public abstract com.pubmatic.sdk.common.RRFormatter getFormatter()

getAdServerURL

protected abstract java.lang.String getAdServerURL()

Returns:

The base/hostname URL.

initializeDefaultParams

protected abstract void initializeDefaultParams()

checkMandatoryParams

public abstract boolean checkMandatoryParams()

setUpUrlParams

protected void setUpUrlParams()

setupPostData

protected void setupPostData()>

setUrlParams

protected void setUrlParams(java.util.Map<java.lang.String,java.lang.String> urlParams)

addUrlParam

protected void addUrlParam(java.lang.String key, java.lang.String value)

putPostData

protected void putPostData(java.lang.String key, java.lang.String value)

getContext

public android.content.Context getContext()

setContext

public void setContext(android.content.Context mContext)

setCustomParams

public void setCustomParams(java.lang.String key, java.lang.String value)

Adds custom key-value parameters in the Ad request.

Parameters:

key  - a string that defines the custom key name.

value  - a string that defines the custom key value.

setAndroidAidEnabled

public void setAndroidAidEnabled(boolean isAndroidAidEnabled)

Controls whether the Advertisement ID is sent in the request.

Enabling Limit Ad Tracking always sends the Android device ID instead of the Advertising ID.

Parameters:

isAndroidAidEnabled - a Boolean value.  TRUE  (default) sends the Advertising ID in the ad request.  FALSE  sends the vendor ID in the ad request.

isAndroidAidEnabled

public boolean isAndroidAidEnabled()

Returns:

TRUE by default.

getAdSize

public PMAdSize getAdSize()

Returns the ad size .

Returns:

The size of a banner ad (set using setAdSize()).

setAdSize

public void setAdSize(PMAdSize adSize)

Sets the banner ad size in the ad request with the provided size.

getUserAgent

public java.lang.String getUserAgent()

setUserAgent

public void setUserAgent(java.lang.String userAgent)

getUrlParams

public java.util.Map<java.lang.String,java.lang.String> getUrlParams()

getRequestUrl

public final java.lang.String getRequestUrl()

getPostData

public java.lang.String getPostData()

getCustomParams

public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getCustomParams()

setLocation

public void setLocation(android.location.Location location)

Sets the user's location.

Parameters:

location - User's location.

getLocation

public android.location.Location getLocation()

Returns:

User's location.

getChannel

public com.pubmatic.sdk.common.CommonConstants.CHANNEL getChannel()


⇧ Top