public abstract class AdImpl extends Object implements Ad, Lot49Constants
AD_FILENAME_PREFIX, AUCTION_RESULTS_PATH_ADX, AUCTION_RESULTS_PATH_OPENX, AUCTION_RESULTS_PATH_PUBMATIC, BID_OUTCOME_CONTROL, BID_OUTCOME_INTERNAL_AUCTION_LOSS, BID_OUTCOME_SUBMITTED, BID_PRICE_CALCULATOR_FILENAME_PREFIX, COOKIE_PREFIX_A, DECISION_BIDS_MADE, DECISION_BIDS_NEEDED, DECISION_BIDS_POSSIBLE, DECISION_BRANDSAFETY, DECISION_BROWSER, DECISION_BUDGET, DECISION_CATEGORY, DECISION_DATE, DECISION_DAY, DECISION_DEVICE, DECISION_DOMAIN_REQUIRED, DECISION_DOMAIN_UNMATCHED, DECISION_EVALUATION_ERROR, DECISION_EXCHANGE, DECISION_EXPERIMENT_CONTROL_SET, DECISION_FLOOR, DECISION_FREQ_CAP, DECISION_GEO, DECISION_HOST, DECISION_HOUR, DECISION_INTEGRAL, DECISION_INTEGRAL_URL, DECISION_INTERNAL_AUCTION, DECISION_IP_BLACKLISTED, DECISION_LANGUAGE, DECISION_LOADING_ERROR, DECISION_NO_IMPRESSIONS, DECISION_NO_USER, DECISION_OS, DECISION_PACING, DECISION_PRIVATE_DEAL, DECISION_PROBABILITY, DECISION_PROVIDER, DECISION_SSP, DECISION_TAG, DECISION_TIMEOUT_EXPERIMENT_STATUS, DECISION_TIMEOUT_FC, DECISION_TIMEOUT_INTEGRAL, DECISION_TIMEOUT_UNKNOWN, DECISION_TIMEOUT_USERDATA, DECISION_TRAQ, DECISION_URL, DECISION_USER_UNKNOWN, DECISION_VALIDATION, DECISION_VIEWABILITY, DECISION_WRONG_USER, DEFAULT_CLICK_PATH_ABSOLUTE, DEFAULT_CLICK_PATH_RELATIVE, DEFAULT_IMPRESSION_PATH_ABSOLUTE, DEFAULT_IMPRESSION_PATH_RELATIVE, DEFAULT_NURL_PATH_ABSOLUTE, DEFAULT_NURL_PATH_RELATIVE, DEFAULT_PIXEL_PATH_ABSOLUTE, DEFAULT_PIXEL_PATH_RELATIVE, DEFAULT_PROUST_PATH_ABSOLUTE, DEFAULT_PROUST_PATH_RELATIVE, DEFAULT_REDIR_PATH_ABSOLUTE, DEFAULT_REDIR_PATH_RELATIVE, DEFAULT_TEST_PATH_RELATIVE, EXCHANGE_ADAPTV, EXCHANGE_ADX, EXCHANGE_BIDSWITCH, EXCHANGE_BRX, EXCHANGE_LIVERAIL, EXCHANGE_LOT49_INTERNAL_AUCTION, EXCHANGE_OPENX, EXCHANGE_PUBMATIC, EXCHANGE_SMAATO, EXCHANGE_SPOTXCHANGE, EXCHANGE_TEST1, EXCHANGE_TEST2, LOT49_VERSION_KEY, LOT49_VERSION_VALUE, MEDIA_TYPE_APPLICATION_JAVASCRIPT, MEDIA_TYPE_APPLICATION_SHOCKWAVE_FLASH, MEDIA_TYPE_VIDEO_FLV, MEDIA_TYPE_VIDEO_MP4, MOD_UID_COOKIE_LENGTH_MAX, MOD_UID_COOKIE_LENGTH_MIN, MOD_UID_LOG_LENGTH, NAME, NURL_ONLY_TAG, NURL_ONLY_WIN_NOTIFICATION, NURL_STANDART, QUERY_STRING_EXCHANGE_CLICK_THROUGH_ENCODED_MACRO, QUERY_STRING_EXCHANGE_CLICK_THROUGH_MACRO, QUERY_STRING_LOT49_CLICK_THROUGH_MACRO, REL_PATH_DEBUG_NURL, ROOT_PATH_ADMIN, ROOT_PATH_AUCTIONS, ROOT_PATH_STATS, TAG_DECISION_API, TAG_DECISION_DIMENSIONS, TAG_DECISION_DURATION, TAG_DECISION_MIME, TAG_DECISION_NOT_BANNER, TAG_DECISION_NOT_VIDEO, TAG_DECISION_PROTOCOL, TAG_DECISION_REQUEST_DISALLOWS_MARKUP, TAG_DECISION_SSL_REQUIRED, TAG_DECISION_VIDEO_LINEARITY, TAG_FILENAME_PREFIX, TEST_MOD_UID_COOKIE_1, TEST_MOD_UID_COOKIE_2, TEST_MOD_UID_COOKIE_3, TEST_MOD_UID_COOKIE_4, TEST_MOD_UID_LOG_1, TEST_MOD_UID_LOG_2, TEST_MOD_UID_LOG_3, TEST_MOD_UID_LOG_4B_TOOK_CARE_OF_IT_ERROR, B_TOOK_CARE_OF_IT_LOSS, B_TOOK_CARE_OF_IT_WIN, BID_AMOUNT_DISPLAY_PREFIX, BID_AMOUNT_PREFIX, BID_COUNT_DISPLAY_PREFIX, BID_COUNT_PREFIX, BID_PREFIX, BID_PRICE_PREFIX, BID_REQUEST_PREFIX, BIDDER_COUNT_KEY, BUDGET_CHUNK_SIZE_PREFIX, BUDGET_MAP_KEY, BUDGET_PREFIX, BUDGET_UNLIMITED, COOKIE_TS_CLICK, COOKIE_TS_IMPRESSION, DEBUG_NURL_PREFIX, DECISION_DISPLAY_PREFIX, ENDS_ON_PREFIX, ENV_AWS_REGION, ENV_DYNAMO_ENDPOINT, ENV_EC2_ENDPOINT, ENV_ELB_ENDPOINT, ENV_LOT49_CONFIG_FILE, ENV_LOT49_HOME, ENV_LOT49_MAGIC, ENV_STS_ENDPOINT, LOWER_BID_PROBABILITY, NURL_PREFIX, OWNER_KEY_PREFIX, PACING_ASAP, PACING_LOG_PREFIX, PREFIX_VERSION, PREVIOUS_SPEND_AMOUNT_PREFIX, SEGMENT_PREFIX, SPEND_AMOUNT_DISPLAY_PREFIX, SPEND_AMOUNT_PREFIX, STARTS_ON_PREFIX, USER_DATA_SCORE_KEY, USER_PREFIX_V1, WIN_COUNT_DISPLAY_PREFIX, WIN_COUNT_PREFIX, WIN_RATE_STARTED_TSAPI_MRAID, API_ORMMA, API_VPAID_1, API_VPAID_2, AUCTION_TYPE_FIRST_PRICE, AUCTION_TYPE_FIXED_PRICE, AUCTION_TYPE_SECOND_PRICE_PLUS, AUCTION_TYPE_UNKNOWN, BR_HTML5_1_0_VALUE, BR_HTML5_2_0_VALUE, CONNECTION_TYPE_CELL_2G, CONNECTION_TYPE_CELL_3G, CONNECTION_TYPE_CELL_4G, CONNECTION_TYPE_CELL_UNKNOWN, CONNECTION_TYPE_ETHERNET, CONNECTION_TYPE_UNKNOWN, CONNECTION_TYPE_WIFI, CONTENT_CONTEXT_APP, CONTENT_CONTEXT_GAME, CONTENT_CONTEXT_MUSIC, CONTENT_CONTEXT_OTHER, CONTENT_CONTEXT_TEXT, CONTENT_CONTEXT_UNKNOWN, CONTENT_CONTEXT_VIDEO, DEVICE_TYPE_CONNECTED_DEVICE, DEVICE_TYPE_CONNECTED_TV, DEVICE_TYPE_MOBILE_TABLET, DEVICE_TYPE_PC, DEVICE_TYPE_PHONE, DEVICE_TYPE_STB, DEVICE_TYPE_TABLET, ETHNICITY_AFRICAN_AMERICAN, ETHNICITY_ASIAN, ETHNICITY_HISPANIC, ETHNICITY_OTHER, ETHNICITY_WHITE, LINEARITY_LINEAR, LINEARITY_NON_LINEAR, MARITAL_DIVORCED, MARITAL_MARRIED, MARITAL_SINGLE, VIDEO_PLAYBACK_AUTO_SOUND_OFF, VIDEO_PLAYBACK_AUTO_SOUND_ON, VIDEO_PLAYBACK_CLICK_TO_PLAY, VIDEO_PLAYBACK_MOUSEOVER, VIDEO_PROTOCOL_VAST_1, VIDEO_PROTOCOL_VAST_2, VIDEO_PROTOCOL_VAST_3, VIDEO_PROTOCOL_VAST_WRAPPER_1, VIDEO_PROTOCOL_VAST_WRAPPER_2, VIDEO_PROTOCOL_VAST_WRAPPER_3protected String nodeId
protected boolean domainRequired
protected Map<Provider,ProviderInfoRequired> providerTargeting
protected String clientId
private final AtomicLong winRate
private final AtomicLong bids
private final AtomicLong wins
protected String campaignId
protected String advertiser
private boolean unlimitedBudget
protected TargetingIntegral targetingIntegral
private DomainTargeting realDomainWhitelist
private DomainTargeting realDomainBlacklist
private AtomicLong projectedSpend
protected boolean abTesting
protected double abTestingShare
protected boolean campaignAbTesting
protected double campaignAbTestingShare
protected double abTestingControlShare
protected double campaignAbTestingControlShare
protected String advertiserId
protected AtomicLong budget
protected long bidPrice
private long lastBidTime
protected FrequencyCap frequencyCap
protected FrequencyCap frequencyCapCampaign
private int bidProbability
private long bidFrequency
protected String customUserData
protected String desc
protected String iurl
protected List<TargetingGeo> geos
protected List<TargetingGeo> negativeGeos
private String id
protected String name
private Random rnd
private Expression<String> parsedTargetingSegments
protected String targetingSegments
private AtomicLong requests
private AtomicLong remainingBidsToMake
private AtomicLong originalBidsToMake
private boolean testMode
protected final Map<String,Map<String,Object>> exchangeSpecificInstructions
private SortedMap<String,SortedMap<String,AtomicLong>> optoutsByExchange
private SortedMap<String,AtomicLong> bidsByExchange
private SortedMap<String,AtomicLong> requestsByExchange
private AtomicLong spendAmount
private AtomicLong bidAmount0
private ConcurrentMap<String,String> uniqOptoutReasonMap
protected String adVersion
private final long loadedOn
protected boolean segmentLogicAnd
protected BidPriceCalculator bidPriceCalculator
protected TargetingHour targetingHour
protected TargetingDOW targetingDOW
public static final String REGEXP_NON_ALPHANUM_WITH_WILDCARD
private final AtomicLong realBids
private final AtomicLong realWins
private AtomicLong realBidAmount
private AtomicLong realSpendAmount
private SortedMap<String,AtomicLong> realBidsByExchange
public AdImpl()
throws Lot49Exception
Lot49Exceptionpublic AdImpl(boolean testMode)
throws Lot49Exception
Lot49Exceptionpublic boolean isDomainRequired()
Addomain be not null null in
order to bid.isDomainRequired in interface Adpublic long getLoadedOn()
getLoadedOn in interface Adpublic void addProviderTargeting(String providerName, String json) throws Lot49Exception
addProviderTargeting in interface AdLot49Exceptionpublic Map<Provider,ProviderInfoRequired> getProviderTargeting()
getProviderTargeting in interface Adpublic String getClientId()
AdgetClientId in interface AdClientConfigpublic double getWinRate()
AdgetWinRate in interface Adpublic void setWinRate(double wr)
setWinRate in interface Adpublic Set<String> getOses()
Adpublic Set<Integer> getDeviceTypes()
getDeviceTypes in interface Adpublic Set<String> getDeviceModels()
getDeviceModels in interface Adpublic Set<String> getDeviceMakes()
getDeviceMakes in interface Adpublic Set<String> getLanguages()
getLanguages in interface Adpublic String getCampaignId()
AdgetCampaignId in interface Adpublic String getAdvertiser()
getAdvertiser in interface Adpublic TargetingIntegral getTargetingIntegral()
getTargetingIntegral in interface Adpublic void setTargetingIntegral(TargetingIntegral targetingIntegral)
public void setDomainWhitelistFromUrl(String urlStr)
setDomainWhitelistFromUrl in interface Adpublic void setDomainBlacklistFromUrl(String urlStr)
setDomainBlacklistFromUrl in interface Adpublic Set<String> getDomainWhitelist()
Adconfiguration option.getDomainWhitelist in interface Adpublic Set<String> getDomainBlacklist()
getDomainBlacklist in interface Adpublic Map<String,Set<String>> getTargetingUrls()
Adconfiguration option. Currently exact match is
required.getTargetingUrls in interface Adpublic void setTargetingUrlsFromUrl(String urlStr)
setTargetingUrlsFromUrl in interface Adpublic long getProjectedSpend()
getProjectedSpend in interface Adpublic void setProjectedSpend(long n)
setProjectedSpend in interface Adpublic Set<String> getTargetingCategories()
AdSite.getCat() to target. Assumed to be normalized to upper case, with
colon separator for hierarchy. Targeting categories for page,
section, content are not supported yet.getTargetingCategories in interface Adpublic List<String> validate()
Adpublic boolean doAbTesting()
doAbTesting in interface Adpublic boolean doTargetingStrategyAbTesting()
doTargetingStrategyAbTesting in interface Adpublic boolean doCampaignAbTesting()
doCampaignAbTesting in interface Adpublic double getTargetingStrategyAbTestingShare()
getTargetingStrategyAbTestingShare in interface Adpublic double getCampaignAbTestingShare()
getCampaignAbTestingShare in interface Adpublic double getAbTestingControlShare()
getAbTestingControlShare in interface Adpublic double getCampaignAbTestingControlShare()
getCampaignAbTestingControlShare in interface Adpublic List<String> getAdomain()
getAdomain in interface AdBid.getAdomain()public String getAdvertiserId()
getAdvertiserId in interface Adpublic boolean allocateBudget(OpenRtbRequest req)
public List<String> getLandingPageUrls()
getLandingPageUrls in interface Adpublic long getLastBidTime()
getLastBidTime in interface Adpublic void setLastBidTime(long lastBidTime)
setLastBidTime in interface Adpublic void setFrequencyCap(FrequencyCap fc)
setFrequencyCap in interface Adpublic FrequencyCap getFrequencyCap()
getFrequencyCap in interface Adpublic void setFrequencyCapCampaign(FrequencyCap fcCampaign)
setFrequencyCapCampaign in interface Adpublic FrequencyCap getFrequencyCapCampaign()
getFrequencyCapCampaign in interface Adpublic long getBidFrequency()
AdgetBidFrequency in interface AdAd.getBidProbability()public void setBidFrequency(long bidFrequency)
setBidFrequency in interface AdAd.getBidFrequency()public void setBidProbability(int bidProbability)
setBidProbability in interface AdAd.getBidProbability()public Set<String> getBrowsers()
getBrowsers in interface Adpublic boolean checkMeasurementSegments(UserSegments userSegments)
checkMeasurementSegments in interface Ad@Deprecated public void setUserSegments(Set<String> segments)
public Expression<String> getParsedTargetingSegments()
getParsedTargetingSegments in interface Adprotected void setTargetingSegments(String expression) throws Lot49Exception
Lot49Exceptionprotected Or<String> or(Expression<String>... terms)
protected And<String> and(Expression<String>... terms)
protected Not<String> not(Expression<String> term)
public Set<String> getExchanges()
getExchanges in interface Adpublic void incrRequestCount(String exchange)
incrRequestCount in interface Adpublic void incrRequestCount(String exchange, long n)
incrRequestCount in interface Adpublic long getRequestCount()
getRequestCount in interface Adpublic long getRequestCount(String exchange)
getRequestCount in interface Adpublic boolean haveBidsToMake()
Adset per current
pacing period by AdCache, and every time we make a bid, we decrement the allowed
amount.haveBidsToMake in interface Adpublic long getRemainingBidsToMake()
getRemainingBidsToMake in interface Adpublic long getOriginalBidsToMake()
getOriginalBidsToMake in interface Adpublic void setBidsToMake(long bidsToMake)
setBidsToMake in interface Adpublic Map<String,Map<String,Object>> getExchangeSpecificInstructions()
Adexchange name, for those exchanges that
return non-null in ExchangeAdapter.makeExchangeSpecificInstructionsMap(), to that
Map. It is returned with keys only for ever Ad object, and is checked by the Exchange during
response conversion phase.getExchangeSpecificInstructions in interface Adprivate static final SortedMap<String,AtomicLong> makeSingleExchangeOptoutMap()
public SortedMap<String,AtomicLong> getBidsByExchange()
getBidsByExchange in interface Adpublic SortedMap<String,AtomicLong> getRequestsByExchange()
getRequestsByExchange in interface Adpublic long getSpendAmount()
getSpendAmount in interface Adpublic void incrSpendAmount(long n)
incrSpendAmount in interface Adpublic long getBidAmount()
getBidAmount in interface Adpublic void incrOptout(OpenRtbRequest req, String name)
incrOptout in interface Adpublic void incrOptout(OpenRtbRequest req, String name, long n)
incrOptout in interface Adpublic String getAdVersion()
getAdVersion in interface Adboolean matchOrganizations(Geo lot49Geo)
public Map<String,Set<String>> getTargetingDeals()
getTargetingDeals in interface AdgetTargetingDeals()public void setTargetingDeals(Map<String,List<String>> deals)
exchange name to list of targeted Deal IDssetTargetingDeals in interface AdPMP,
Dealpublic boolean checkIntegralTargeting(OpenRtbRequest req, Site site, IntegralInfoReceived integralInfoReceived)
checkIntegralTargeting in interface Adpublic boolean matchTargetingUrls(OpenRtbRequest req, Site site)
public boolean isTargetingDeals()
isTargetingDeals in interface Adpublic String matchDeals(OpenRtbRequest br, Impression imp)
matchDeals in interface Adbr - requestimp - impressionpublic boolean matchDomainTargeting(OpenRtbRequest br)
public boolean canBid1(OpenRtbRequest br)
Adconstituent config 's
canBid() methods. This only qualifies the bid
request's attributes (including user) in absence of a particular ad tag configuration. Thus,
on a test bid, all of these methods can be assumed to be true, but not all
canBid()s.Lot49Ext.getLot49ExtRemote() is populated.This will always return true if bidRequest
is a
test request.public boolean isSegmentLogicAnd()
isSegmentLogicAnd in interface Adpublic boolean checkSegments(OpenRtbRequest br, UserSegments userSegments)
Return false if:
we have targeted segments and the intersection of it with
looked up segments is empty.checkSegments in interface AdAd.canBid1(com.enremmeta.rtb.api.proto.openrtb.OpenRtbRequest)public boolean checkFrequencyCap(OpenRtbRequest br, UserFrequencyCapAttributes userFrequencyCap)
checkFrequencyCap in interface Adpublic SortedMap<String,SortedMap<String,AtomicLong>> getOptoutsByExchange()
getOptoutsByExchange in interface Adpublic void setBidPrice(long n)
setBidPrice in interface Adprotected void setBidAmount(long n)
public long getBidPrice(OpenRtbRequest req)
AdgetBidPrice in interface Adpublic void setBidPriceCalculator(BidPriceCalculator bpc)
setBidPriceCalculator in interface Adpublic BidPriceCalculator getBidPriceCalculator()
getBidPriceCalculator in interface Adpublic boolean isDynamicPricing()
isDynamicPricing in interface Adpublic double getBidPriceCpm(OpenRtbRequest req)
AdAd.getBidAmount() but as $ CPM.getBidPriceCpm in interface Adpublic int getBidProbability()
AdAd.getBidFrequency(). Values below 0 and above 100 work
the same as 0 and 100 respectively.getBidProbability in interface AdAd.getBidFrequency()private final long getCachebuster()
public String getCustomUserData()
public List<TargetingGeo> getGeos()
public List<TargetingGeo> getNegativeGeos()
getNegativeGeos in interface Adpublic String getId()
AdgetId in interface AdgetId in interface Lot49Pluginpublic String getName()
AdgetName in interface AdgetName in interface Lot49Pluginpublic Random getRnd()
public Tag findTagById(String id)
AdfindTagById in interface Adid - tag identifier we interested in@Deprecated public Set<String> getUserSegments()
getUserSegments in interface Adpublic boolean needUserInfo()
needUserInfo in interface Adpublic boolean needFrequencyCap()
needFrequencyCap in interface Adpublic boolean needIntegralInfo()
needIntegralInfo in interface Adpublic boolean needExperimentInfo()
needExperimentInfo in interface Adpublic boolean isCampaignFrequencyCap()
isCampaignFrequencyCap in interface Adpublic boolean isStrategyFrequencyCap()
isStrategyFrequencyCap in interface Adpublic boolean needCanBid2()
needCanBid2 in interface Adpublic TargetingHour getTargetingHour()
AdAd.getBidProbability(), which is used for pacing purposes, this
probability is for A/B testing.getTargetingHour in interface Adpublic TargetingDOW getTargetingDOW()
getTargetingDOW in interface Adpublic void setOrganizations(Collection<String> o)
public Set<Pattern> getOrganizations()
getOrganizations in interface Adpublic long getRealBids()
getRealBids in interface Adpublic long getRealWins()
getRealWins in interface Adpublic SortedMap<String,AtomicLong> getRealBidsByExchange()
getRealBidsByExchange in interface Adpublic long getRealSpendAmount()
getRealSpendAmount in interface Adpublic long getRealBidAmount()
getRealBidAmount in interface Adpublic void storeAdState()
storeAdState in interface Ad