Package com.google.openrtb.util
Class OpenRtbValidator
- java.lang.Object
-
- com.google.openrtb.util.OpenRtbValidator
-
@Singleton public class OpenRtbValidator extends Object
Validates a pair ofOpenRtb.BidRequestand its correspondingOpenRtb.BidResponse.Builder. Bids with any validation problems will cause debug logs and metric updates. Fatal validation errors (that would likely cause the bid to be rejected by the exchange) will also be removed from the response.This class is threadsafe. Recommended use is as a singleton, but you may also want to create multiple instances if you need to keep track of metrics separately for different uses (for that to make sense, provide a different
MetricRegistryto each instance).
-
-
Constructor Summary
Constructors Constructor Description OpenRtbValidator(com.codahale.metrics.MetricRegistry metricRegistry)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static <T> List<T>check(List<T> reqAttrs, List<T> respAttrs)protected static StringlogId(OpenRtb.BidResponse.SeatBid.Bid.Builder bid)booleanvalidate(OpenRtb.BidRequest request, OpenRtb.BidResponse.Builder response)booleanvalidate(OpenRtb.BidRequest request, OpenRtb.BidResponse.SeatBid.Bid.Builder bid)protected booleanvalidateCompanions(OpenRtb.BidResponse.SeatBid.Bid.Builder bid, List<OpenRtb.BidRequest.Imp.Banner> companions)protected booleanvalidateCreats(OpenRtb.BidResponse.SeatBid.Bid.Builder bid, List<OpenRtb.CreativeAttribute> badCreats)
-
-
-
Method Detail
-
validate
public boolean validate(OpenRtb.BidRequest request, OpenRtb.BidResponse.Builder response)
-
validate
public boolean validate(OpenRtb.BidRequest request, OpenRtb.BidResponse.SeatBid.Bid.Builder bid)
-
validateCreats
protected boolean validateCreats(OpenRtb.BidResponse.SeatBid.Bid.Builder bid, List<OpenRtb.CreativeAttribute> badCreats)
-
validateCompanions
protected boolean validateCompanions(OpenRtb.BidResponse.SeatBid.Bid.Builder bid, List<OpenRtb.BidRequest.Imp.Banner> companions)
-
logId
protected static String logId(OpenRtb.BidResponse.SeatBid.Bid.Builder bid)
-
-