001/*
002 * The contents of this file are subject to the terms of the Common Development and
003 * Distribution License (the License). You may not use this file except in compliance with the
004 * License.
005 *
006 * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
007 * specific language governing permission and limitations under the License.
008 *
009 * When distributing Covered Software, include this CDDL Header Notice in each file and include
010 * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
011 * Header, with the fields enclosed by brackets [] replaced by your own identifying
012 * information: "Portions Copyright [year] [name of copyright owner]".
013 *
014 * Copyright 2006-2008 Sun Microsystems, Inc.
015 * Portions Copyright 2014 ForgeRock AS.
016 */
017
018package org.opends.quicksetup;
019
020import org.forgerock.i18n.LocalizableMessage;
021import org.opends.server.types.OpenDsException;
022
023/**
024 * This exception is used when there is an error with the data provided by
025 * the user.  It will be thrown by the class that is in charge of validating
026 * the user data (the Application class).
027 *
028 */
029public class UserDataException extends OpenDsException {
030
031  private static final long serialVersionUID = 1798143194655443132L;
032
033  private WizardStep step;
034
035  /**
036   * Constructor for UserDataException.
037   * @param step the step in the wizard where the exception occurred.
038   * @param message the localized message describing the error.
039   */
040  public UserDataException(WizardStep step, LocalizableMessage message)
041  {
042    super(message);
043    this.step = step;
044  }
045
046  /**
047   * Constructor for UserDataException.
048   * @param step the step in the wizard where the exception occurred.
049   * @param message the localized message describing the error.
050   * @param t the Exception that generated this exception.
051   */
052  public UserDataException(WizardStep step, LocalizableMessage message, Throwable t)
053  {
054    super(message, t);
055    this.step = step;
056  }
057
058  /**
059   * Returns the step of the wizard in which this exception occurred.
060   * @return the step of the wizard in which this exception occurred.
061   */
062  public WizardStep getStep()
063  {
064    return step;
065  }
066}