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 2008 Sun Microsystems, Inc.
025 */
026package org.forgerock.opendj.config;
027
028import static com.forgerock.opendj.ldap.AdminMessages.*;
029
030/**
031 * Thrown when an attempt is made to retrieve a property using its name but the
032 * name was not recognized.
033 * <p>
034 * This exception can occur when attempt is made to retrieve inherited default
035 * values from a managed object.
036 */
037public class PropertyNotFoundException extends OperationsException {
038
039    /**
040     * Serialization ID.
041     */
042    private static final long serialVersionUID = -895548482881819610L;
043
044    /** The name of the property that could not be found. */
045    private final String propertyName;
046
047    /**
048     * Create a new property not found exception.
049     *
050     * @param propertyName
051     *            The name of the property that could not be found.
052     */
053    public PropertyNotFoundException(String propertyName) {
054        super(ERR_PROPERTY_NOT_FOUND_EXCEPTION.get(propertyName));
055
056        this.propertyName = propertyName;
057    }
058
059    /**
060     * Get the name of the property that could not be found.
061     *
062     * @return Returns the name of the property that could not be found.
063     */
064    public String getPropertyName() {
065        return propertyName;
066    }
067
068}