Stores the info and metadata for an Ooyala Managed Adspot. More...

Inheritance diagram for com.ooyala.android.ads.ooyala.OoyalaAdSpot:
com.ooyala.android.item.OoyalaManagedAdSpot com.ooyala.android.item.AuthorizableItem com.ooyala.android.item.PlayableItem com.ooyala.android.item.AdSpot Comparable

Public Member Functions

 OoyalaAdSpot (int time, URL clickURL, List< URL > trackingURLs, String embedCode)
 Initialize an OoyalaAdSpot using the specified data. More...
 
 OoyalaAdSpot (JSONObject data)
 Initialize the Ooyala Ad Spot. More...
 
String getEmbedCode ()
 Get the embedCode for this content item. More...
 
ReturnState update (JSONObject data)
 For internal use only. More...
 
boolean fetchPlaybackInfo (OoyalaAPIClient api, PlayerInfo info)
 this is the synchronous call to fetch the api More...
 
Stream getStream ()
 
List< String > embedCodesToAuthorize ()
 For internal use only. More...
 
boolean isAuthorized ()
 Whether or not this AuthorizableItem is authorized. More...
 
int getAuthCode ()
 The Auth Code from the authorization request. More...
 
boolean isHeartbeatRequired ()
 
Set< StreamgetStreams ()
 
int getTime ()
 Fetch the time at which this AdSpot should play. More...
 
URL getClickURL ()
 Fetch the URL to ping when this AdSpot is clicked. More...
 
List< URL > getTrackingURLs ()
 Fetch the list of tracking URLs to ping when this AdSpot is played. More...
 
int getPriority ()
 
void setPriority (int priority)
 set the priority of the ad spot. More...
 
int compareTo (AdSpot ad)
 compare two ad spots based on time, which is required to properly sort ad spots. More...
 
boolean needsPauseContent ()
 

Static Public Member Functions

static OoyalaManagedAdSpot create (JSONObject data, int contentDuration)
 

Static Public Attributes

static String [] authCodeDescription
 

Protected Attributes

Set< Stream_streams = new HashSet<Stream>()
 
String _embedCode = null
 
boolean _authorized = false
 
OoyalaAPIClient _api
 
int _authCode = AuthCode.NOT_REQUESTED
 
int _time = -1
 
int _priority = 0
 
URL _clickURL = null
 
List< URL > _trackingURLs = null
 

Static Protected Attributes

static final String KEY_TYPE = "type"
 
static final String KEY_TIME = "time"
 
static final String KEY_CLICK_URL = "click_url"
 
static final String KEY_TRACKING_URL = "tracking_url"
 
static final String AD_TYPE_OOYALA = "ooyala"
 
static final String AD_TYPE_VAST = "vast"
 

Detailed Description

Stores the info and metadata for an Ooyala Managed Adspot.

Constructor & Destructor Documentation

com.ooyala.android.ads.ooyala.OoyalaAdSpot.OoyalaAdSpot ( int  time,
URL  clickURL,
List< URL >  trackingURLs,
String  embedCode 
)

Initialize an OoyalaAdSpot using the specified data.

Parameters
timethe time at which the VASTAdSpot should play
clickURLthe clickthrough URL
trackingURLsthe tracking URLs that should be pinged when this ad plays
embedCodethe embed code associated with this OoyalaAdSpot
com.ooyala.android.ads.ooyala.OoyalaAdSpot.OoyalaAdSpot ( JSONObject  data)

Initialize the Ooyala Ad Spot.

Parameters
datathe metadata needed to update the Ooyala Ad

Member Function Documentation

int com.ooyala.android.item.AdSpot.compareTo ( AdSpot  ad)
inherited

compare two ad spots based on time, which is required to properly sort ad spots.

Parameters
adthe ad to be compared
static OoyalaManagedAdSpot com.ooyala.android.item.OoyalaManagedAdSpot.create ( JSONObject  data,
int  contentDuration 
)
staticinherited
List<String> com.ooyala.android.ads.ooyala.OoyalaAdSpot.embedCodesToAuthorize ( )

For internal use only.

The embed codes to authorize for the AuthorizableItem

Returns
the embed codes to authorize as a List

Implements com.ooyala.android.item.AuthorizableItem.

boolean com.ooyala.android.ads.ooyala.OoyalaAdSpot.fetchPlaybackInfo ( OoyalaAPIClient  api,
PlayerInfo  info 
)

this is the synchronous call to fetch the api

Parameters
apithe api used to call server
infothe player info used for the server call
Returns
true if success, false otherwise
int com.ooyala.android.ads.ooyala.OoyalaAdSpot.getAuthCode ( )

The Auth Code from the authorization request.

Returns
an int with the status of the authorization request

Implements com.ooyala.android.item.AuthorizableItem.

URL com.ooyala.android.item.OoyalaManagedAdSpot.getClickURL ( )
inherited

Fetch the URL to ping when this AdSpot is clicked.

Returns
the click URL
String com.ooyala.android.ads.ooyala.OoyalaAdSpot.getEmbedCode ( )

Get the embedCode for this content item.

Returns
embedCode of this content item
int com.ooyala.android.item.OoyalaManagedAdSpot.getPriority ( )
inherited
Stream com.ooyala.android.ads.ooyala.OoyalaAdSpot.getStream ( )
Set<Stream> com.ooyala.android.ads.ooyala.OoyalaAdSpot.getStreams ( )
int com.ooyala.android.item.OoyalaManagedAdSpot.getTime ( )
inherited

Fetch the time at which this AdSpot should play.

Returns
The time at which this AdSpot should play in milliseconds.
List<URL> com.ooyala.android.item.OoyalaManagedAdSpot.getTrackingURLs ( )
inherited

Fetch the list of tracking URLs to ping when this AdSpot is played.

Returns
the priority
boolean com.ooyala.android.ads.ooyala.OoyalaAdSpot.isAuthorized ( )

Whether or not this AuthorizableItem is authorized.

Returns
true if authorized, false if not

Implements com.ooyala.android.item.AuthorizableItem.

boolean com.ooyala.android.ads.ooyala.OoyalaAdSpot.isHeartbeatRequired ( )
boolean com.ooyala.android.item.AdSpot.needsPauseContent ( )
inherited
Returns
if the ad spot needs to pause content and play an ad stream return true if content needs to be paused, e.g. VAST Linear ads false if content does not need to be paused, e.g. VAST Nonlinear ads
void com.ooyala.android.item.OoyalaManagedAdSpot.setPriority ( int  priority)
inherited

set the priority of the ad spot.

if two adspot have the same time, the one with higher priority(smaller value) will be played first.

ReturnState com.ooyala.android.ads.ooyala.OoyalaAdSpot.update ( JSONObject  data)

For internal use only.

Update the AuthorizableItem using the specified data (subclasses should override and call this)

Parameters
datathe data to use to update this AuthorizableItem
Returns
a ReturnState based on if the data matched or not (or parsing failed)

Implements com.ooyala.android.item.AuthorizableItem.

Member Data Documentation

OoyalaAPIClient com.ooyala.android.ads.ooyala.OoyalaAdSpot._api
protected
int com.ooyala.android.ads.ooyala.OoyalaAdSpot._authCode = AuthCode.NOT_REQUESTED
protected
boolean com.ooyala.android.ads.ooyala.OoyalaAdSpot._authorized = false
protected
URL com.ooyala.android.item.OoyalaManagedAdSpot._clickURL = null
protectedinherited
String com.ooyala.android.ads.ooyala.OoyalaAdSpot._embedCode = null
protected
int com.ooyala.android.item.OoyalaManagedAdSpot._priority = 0
protectedinherited
Set<Stream> com.ooyala.android.ads.ooyala.OoyalaAdSpot._streams = new HashSet<Stream>()
protected
int com.ooyala.android.item.OoyalaManagedAdSpot._time = -1
protectedinherited
List<URL> com.ooyala.android.item.OoyalaManagedAdSpot._trackingURLs = null
protectedinherited
final String com.ooyala.android.item.OoyalaManagedAdSpot.AD_TYPE_OOYALA = "ooyala"
staticprotectedinherited
final String com.ooyala.android.item.OoyalaManagedAdSpot.AD_TYPE_VAST = "vast"
staticprotectedinherited
String [] com.ooyala.android.item.AuthorizableItem.authCodeDescription
staticinherited
final String com.ooyala.android.item.OoyalaManagedAdSpot.KEY_CLICK_URL = "click_url"
staticprotectedinherited
final String com.ooyala.android.item.OoyalaManagedAdSpot.KEY_TIME = "time"
staticprotectedinherited
final String com.ooyala.android.item.OoyalaManagedAdSpot.KEY_TRACKING_URL = "tracking_url"
staticprotectedinherited
final String com.ooyala.android.item.OoyalaManagedAdSpot.KEY_TYPE = "type"
staticprotectedinherited