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