class ReservationInputValidator {

  public Plan validateReservationSubmissionRequest(
      ReservationSystem reservationSystem,
      ReservationSubmissionRequest request, ReservationId reservationId)
      throws YarnException {
    // Check if it is a managed queue
    String queueName = request.getQueue();
    if (queueName == null || queueName.isEmpty()) {
      String errMsg =
          "The queue to submit is not specified."
              + " Please try again with a valid reservable queue.";
      RMAuditLogger.logFailure("UNKNOWN",
          AuditConstants.SUBMIT_RESERVATION_REQUEST,
          "validate reservation input", "ClientRMService", errMsg);
      throw RPCUtil.getRemoteException(errMsg);
    }
    Plan plan = reservationSystem.getPlan(queueName);
    if (plan == null) {
      String errMsg =
          "The specified queue: " + queueName
              + " is not managed by reservation system."
              + " Please try again with a valid reservable queue.";
      RMAuditLogger.logFailure("UNKNOWN",
          AuditConstants.SUBMIT_RESERVATION_REQUEST,
          "validate reservation input", "ClientRMService", errMsg);
      throw RPCUtil.getRemoteException(errMsg);
    }
    validateReservationDefinition(reservationId,
        request.getReservationDefinition(), plan,
        AuditConstants.SUBMIT_RESERVATION_REQUEST);
    return plan;
  }

  public  ReservationInputValidator(Clock clock);

}