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