package com.capgemini.reports.exceptions;

/**
 * Exception used in the event of a report request received, that matches an already-waiting report.<br>
 * The former report is in this case not executed, and the user is directed to the latter report execution.
 */
public class DuplicateReportEntryFound extends InvalidUserInputException {

  private static final long serialVersionUID = -7724360531026615817L;

  /**
   * Exception used in the event of a report request received, that matches an already-waiting report.<br>
   * Throw this exception if the user himself owns an identical execution request that predates this request.
   */
  public DuplicateReportEntryFound() {
    super(UserInputErrorEnum.DUPLICATE_REPORT_LAUNCHED_RECENTLY_BY_SELF);
  }

  /**
   * Exception used in the event of a report request received, that matches an already-waiting report.<br>
   * Throw this exception if an other user owns an identical execution request that predates this request.
   *
   * @param userName the user name of the person who requested the report again.
   */
  public DuplicateReportEntryFound(final String userName) {
    super(UserInputErrorEnum.DUPLICATE_REPORT_LAUNCHED_RECENTLY, userName);
  }
}
