use of com.xrtb.bidder.SelectedCreative in project XRTB by benmfaul.
the class Appnexus method buildNewBidResponse.
@Override
public BidResponse buildNewBidResponse(Impression imp, List<SelectedCreative> multi, int xtime) throws Exception {
for (int i = 0; i < multi.size(); i++) {
SelectedCreative x = multi.get(i);
Creative c = x.getCreative();
if (c.extensions == null || c.extensions.size() == 0)
throw new Exception(x.getCampaign().adId + "/" + c.impid + " is missing required extensions for Appnexus SSP");
String adid = c.extensions.get("appnexus_crid");
if (adid == null)
adid = "invalid:unassigned";
c.alternateAdId = adid;
}
BidResponse response = new BidResponse(this, imp, multi, xtime);
StringBuilder sb = response.getResponseBuffer();
return response;
}
Aggregations