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 *      Portions Copyright 2015 ForgeRock AS.
026 */
027package org.forgerock.opendj.config.client;
028
029import static com.forgerock.opendj.ldap.config.AdminMessages.*;
030
031import org.forgerock.i18n.LocalizableMessage;
032import org.forgerock.opendj.config.OperationsException;
033
034/**
035 * This exception is thrown when a critical concurrent modification is detected
036 * by the client. This may be caused by another client application removing a
037 * managed object whilst it is being managed.
038 */
039public class ConcurrentModificationException extends OperationsException {
040
041    /**
042     * Serialization ID.
043     */
044    private static final long serialVersionUID = -1467024486347612820L;
045
046    /**
047     * Create a concurrent modification exception with a default message.
048     */
049    public ConcurrentModificationException() {
050        super(ERR_CONCURRENT_MODIFICATION_EXCEPTION_DEFAULT.get());
051    }
052
053    /**
054     * Create a concurrent modification exception with a cause and a default
055     * message.
056     *
057     * @param cause
058     *            The cause.
059     */
060    public ConcurrentModificationException(Throwable cause) {
061        super(ERR_CONCURRENT_MODIFICATION_EXCEPTION_DEFAULT.get(), cause);
062    }
063
064    /**
065     * Create a concurrent modification exception with a message and cause.
066     *
067     * @param message
068     *            The message.
069     * @param cause
070     *            The cause.
071     */
072    public ConcurrentModificationException(LocalizableMessage message, Throwable cause) {
073        super(message, cause);
074    }
075
076    /**
077     * Create a concurrent modification exception with a message.
078     *
079     * @param message
080     *            The message.
081     */
082    public ConcurrentModificationException(LocalizableMessage message) {
083        super(message);
084    }
085}