Class DeliveryRequest

java.lang.Object
ai.promoted.delivery.client.DeliveryRequest
All Implemented Interfaces:
Cloneable

public class DeliveryRequest extends Object implements Cloneable
DeliveryRequest is the input into delivery.
  • Constructor Details

    • DeliveryRequest

      public DeliveryRequest(Request request, CohortMembership experiment, boolean onlyLog, int retrievalInsertionOffset, DeliveryRequestValidator validator)
      Instantiates a new delivery request.
      Parameters:
      request - the request to process
      experiment - the experiment that the user is in, may be null, which means apply the treatment
      onlyLog - if true, will log to Promoted.ai Metrics but not call Delivery API to re-rank
      retrievalInsertionOffset - start index in the request insertions in the list of ALL insertions
    • DeliveryRequest

      public DeliveryRequest(Request request, CohortMembership experiment, boolean onlyLog, int retrievalInsertionOffset)
      Instantiates a new delivery request.
      Parameters:
      request - the request to process
      experiment - the experiment that the user is in, may be null, which means apply the treatment
      onlyLog - if true, will log to Promoted.ai Metrics but not call Delivery API to re-rank
      retrievalInsertionOffset - start index in the request insertions in the list of ALL insertions
    • DeliveryRequest

      public DeliveryRequest(Request request, CohortMembership experiment)
      Instantiates a new delivery request.
      Parameters:
      request - the request to process
      experiment - the experiment that the user is in, may be null, which means apply the treatment
    • DeliveryRequest

      public DeliveryRequest(Request request)
      Instantiates a new delivery request.
      Parameters:
      request - the request to process =
  • Method Details

    • getRequest

      public Request getRequest()
      Gets the underlying request for ranked content.
      Returns:
      the request
    • isOnlyLog

      public boolean isOnlyLog()
      Checks whether or not to only perform logging and not call Delivery API.
      Returns:
      true, if is only log
    • getRetrievalInsertionOffset

      public int getRetrievalInsertionOffset()
      Gets the insertion start.
      Returns:
      the insertion start
    • getExperiment

      public CohortMembership getExperiment()
      Gets the experiment to use for this request, if any.
      Returns:
      the experiment
    • clone

      Overrides:
      clone in class Object
      Throws:
      CloneNotSupportedException
    • validate

      public List<String> validate(boolean isShadowTraffic)
      Checks the state of this delivery requests and collects/returns any validation errors.
      Parameters:
      isShadowTraffic -
      Returns:
      a list of validation errors, which may be empty.