Nitido Inc.

com.nitido.nimbox.http.services.ad
Class SkinAdMap

java.lang.Object
  extended by com.nitido.nimbox.http.services.ad.SkinAdMap
All Implemented Interfaces:
java.io.Serializable

public class SkinAdMap
extends java.lang.Object
implements java.io.Serializable

This class contains all the Ads for a given skin.

See Also:
Serialized Form

Field Summary
protected  java.util.HashMap _ads
          contains the set of Ads for a given skin.
protected  boolean _displayTrackingEnabled
          If set, AD display tracking is enabled
protected  Entity _entity
          Reference to the Entity object making the request
protected  java.lang.String _skinID
          reference to the skin ID associated to this map
protected  NiMTrackingService _trackingService
          reference to the tracking service used to record when an AD is placed on a skin
static java.lang.String KEY_DEFAULT_AD
          Key to retrieve the default AD from the map
 
Constructor Summary
protected SkinAdMap(SkinAdMap original)
          This method creates a deep copy of the given SkinAdMap
protected SkinAdMap(java.lang.String skinID, boolean displayTrackingEnabled)
          Default class constructor.
 
Method Summary
 void addSkinAd(java.lang.String locationID, SkinAd ad)
          Adds a new Ad for a skin under the given id parameter.
 java.lang.String getAdContent(java.lang.String locationID)
          This method returns the URL of the Ad image that appears on the given skin location
 java.lang.String getAdDescription(java.lang.String locationID)
          This method returns the text to be displayed if the client browser does not support image display.
 java.lang.String getLinkURL(java.lang.String locationID)
          This method returns the link URL of the Ad that appears on the given skin location
 SkinAd getSkinAd(java.lang.String locationID)
          Given a skin location (locationID), this method returns a reference to the Ad object for the given location.
 java.lang.String[] getSkinAdLocationIDs()
          This method returns the location IDs for each SkinAd in this map.
 void removeSkinAd(java.lang.String locationID)
          Removes the Ad object, identified by the given ID, from the map.
 void setEntity(Entity entity)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY_DEFAULT_AD

public static final java.lang.String KEY_DEFAULT_AD
Key to retrieve the default AD from the map

See Also:
Constant Field Values

_trackingService

protected transient NiMTrackingService _trackingService
reference to the tracking service used to record when an AD is placed on a skin


_skinID

protected java.lang.String _skinID
reference to the skin ID associated to this map


_ads

protected java.util.HashMap _ads
contains the set of Ads for a given skin.


_entity

protected Entity _entity
Reference to the Entity object making the request


_displayTrackingEnabled

protected boolean _displayTrackingEnabled
If set, AD display tracking is enabled

Constructor Detail

SkinAdMap

protected SkinAdMap(java.lang.String skinID,
                    boolean displayTrackingEnabled)
Default class constructor. Creates an empty SkinAdMap.


SkinAdMap

protected SkinAdMap(SkinAdMap original)
This method creates a deep copy of the given SkinAdMap

Parameters:
original - The SkinAdMap that is to be copied
Method Detail

setEntity

public void setEntity(Entity entity)

getSkinAdLocationIDs

public java.lang.String[] getSkinAdLocationIDs()
This method returns the location IDs for each SkinAd in this map.

Returns:
The list of SkinAd locations IDs

getSkinAd

public SkinAd getSkinAd(java.lang.String locationID)
                 throws AdNotFoundException
Given a skin location (locationID), this method returns a reference to the Ad object for the given location.

Parameters:
locationID - The skin location where the Ad is placed.
Returns:
Reference to the Ad object to be placed under the given skin location. If no Ad is found for the given location, this method returns null.
Throws:
AdNotFoundException - If no AD is found for the given skin location

getLinkURL

public java.lang.String getLinkURL(java.lang.String locationID)
                            throws AdNotFoundException
This method returns the link URL of the Ad that appears on the given skin location

Parameters:
locationID - The skin location where the Ad is placed.
Returns:
Reference to the link URL of the Ad. If no Ad is found for the given location, this method returns null.
Throws:
AdNotFoundException - If no AD is found for the given skin location

getAdContent

public java.lang.String getAdContent(java.lang.String locationID)
                              throws AdNotFoundException
This method returns the URL of the Ad image that appears on the given skin location

Parameters:
locationID - The skin location where the Ad is placed.
Returns:
The AD content
Throws:
AdNotFoundException - If no AD is found for the given skin location

getAdDescription

public java.lang.String getAdDescription(java.lang.String locationID)
                                  throws AdNotFoundException
This method returns the text to be displayed if the client browser does not support image display.

Parameters:
locationID - The skin location where the Ad is placed.
Returns:
The AD description
Throws:
AdNotFoundException - If no AD is found for the given skin location

addSkinAd

public void addSkinAd(java.lang.String locationID,
                      SkinAd ad)
Adds a new Ad for a skin under the given id parameter.

Parameters:
locationID - Reference to the location of the skin where the given Ad should be placed.
ad - Reference to the new Ad object
Throws:
java.lang.IllegalArgumentException - If the given parameters are null.

removeSkinAd

public void removeSkinAd(java.lang.String locationID)
Removes the Ad object, identified by the given ID, from the map.

Parameters:
locationID - Reference to the location of the skin.

Nitido NiM 2.5 Java API

These JavaDoc pages are generated for release/nim_2_5-2.5.44

Copyright © 1999-2009 Nitido Inc.    Proprietary and Confidential.    All Rights Reserved.