forked from prebid/prebid-server-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBidder.java
38 lines (32 loc) · 1.34 KB
/
Bidder.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package org.prebid.server.bidder;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.iab.openrtb.request.BidRequest;
import org.prebid.server.bidder.model.BidderBid;
import org.prebid.server.bidder.model.HttpCall;
import org.prebid.server.bidder.model.HttpRequest;
import org.prebid.server.bidder.model.Result;
import java.util.List;
import java.util.Map;
/**
* Defines the contract needed to participate in an auction.
*/
public interface Bidder<T> {
/**
* Makes the HTTP requests which should be made to fetch bids.
* <p>
* The errors should contain a list of errors which explain why this bidder's bids will be "subpar" in some way.
* For example: the request contained ad types which this bidder doesn't support.
*/
Result<List<HttpRequest<T>>> makeHttpRequests(BidRequest request);
/**
* Unpacks the server's response into bids.
* <p>
* The errors should contain a list of errors which explain why this bidder's bids will be
* "subpar" in some way. For example: the server response didn't have the expected format.
*/
Result<List<BidderBid>> makeBids(HttpCall<T> httpCall, BidRequest bidRequest);
/**
* Extracts targeting from bidder-specific extension. It is safe to assume that {@code ext} is not null.
*/
Map<String, String> extractTargeting(ObjectNode ext);
}