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 2010 Sun Microsystems, Inc.
015 * Portions Copyright 2013-2014 ForgeRock AS.
016 */
017
018package org.forgerock.opendj.ldap;
019
020import org.forgerock.opendj.ldap.responses.Result;
021
022/**
023 * Thrown when the result code returned in a Result indicates that the update
024 * Request failed because it would have left the Directory in an inconsistent
025 * state. More specifically, this exception is used for the following error
026 * result codes:
027 * <ul>
028 * <li>{@link ResultCode#ATTRIBUTE_OR_VALUE_EXISTS ATTRIBUTE_OR_VALUE_EXISTS} -
029 * the Request failed because it would have resulted in a conflict with an
030 * existing attribute or attribute value in the target entry.
031 * <li>{@link ResultCode#NO_SUCH_ATTRIBUTE NO_SUCH_ATTRIBUTE} - the Request
032 * failed because it targeted an attribute or attribute value that did not exist
033 * in the specified entry.
034 * <li>{@link ResultCode#CONSTRAINT_VIOLATION CONSTRAINT_VIOLATION} - the
035 * Request failed because it would have violated some constraint defined in the
036 * server.
037 * <li>{@link ResultCode#ENTRY_ALREADY_EXISTS ENTRY_ALREADY_EXISTS} - the
038 * Request failed because it would have resulted in an entry that conflicts with
039 * an entry that already exists.
040 * <li>{@link ResultCode#INVALID_ATTRIBUTE_SYNTAX INVALID_ATTRIBUTE_SYNTAX} -
041 * the Request failed because it violated the syntax for a specified attribute.
042 * <li>{@link ResultCode#INVALID_DN_SYNTAX INVALID_DN_SYNTAX} - the Request
043 * failed because it would have resulted in an entry with an invalid or
044 * malformed DN.
045 * <li>{@link ResultCode#NAMING_VIOLATION NAMING_VIOLATION} - the Request failed
046 * becauseit would have violated the server's naming configuration.
047 * <li>{@link ResultCode#NOT_ALLOWED_ON_NONLEAF NOT_ALLOWED_ON_NONLEAF} - the
048 * Request failed because it is not allowed for non-leaf entries.
049 * <li>{@link ResultCode#NOT_ALLOWED_ON_RDN NOT_ALLOWED_ON_RDN} - the Request
050 * failed because it is not allowed on an RDN attribute.
051 * <li>{@link ResultCode#OBJECTCLASS_MODS_PROHIBITED
052 * OBJECTCLASS_MODS_PROHIBITED} - the Request failed because it would have
053 * modified the objectclasses associated with an entry in an illegal manner.
054 * <li>{@link ResultCode#OBJECTCLASS_VIOLATION OBJECTCLASS_VIOLATION} - the
055 * Request failed because it would have resulted in an entry that violated the
056 * server schema.
057 * <li>{@link ResultCode#UNDEFINED_ATTRIBUTE_TYPE UNDEFINED_ATTRIBUTE_TYPE} -
058 * the Request failed because it referenced an attribute that is not defined in
059 * the server schema.
060 * </ul>
061 */
062@SuppressWarnings("serial")
063public class ConstraintViolationException extends LdapException {
064    ConstraintViolationException(final Result result) {
065        super(result);
066    }
067}