Search in sources :

Example 6 with SelectedCreative

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;
}
Also used : Creative(com.xrtb.common.Creative) SelectedCreative(com.xrtb.bidder.SelectedCreative) SelectedCreative(com.xrtb.bidder.SelectedCreative) BidResponse(com.xrtb.pojo.BidResponse)

Aggregations

SelectedCreative (com.xrtb.bidder.SelectedCreative)6 AbortableCountDownLatch (com.xrtb.bidder.AbortableCountDownLatch)2 CampaignProcessor (com.xrtb.bidder.CampaignProcessor)2 Creative (com.xrtb.common.Creative)2 BidRequest (com.xrtb.pojo.BidRequest)2 BidResponse (com.xrtb.pojo.BidResponse)2 InputStream (java.io.InputStream)2 CountDownLatch (java.util.concurrent.CountDownLatch)2 Campaign (com.xrtb.common.Campaign)1 Configuration (com.xrtb.common.Configuration)1 Entity (com.xrtb.nativeads.assets.Entity)1 Data (com.xrtb.nativeads.creative.Data)1 Impression (com.xrtb.pojo.Impression)1 Test (org.junit.Test)1