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    /** Serialization ID. */
032    private static final long serialVersionUID = -1467024486347612820L;
033
034    /** Create a concurrent modification exception with a default message. */
035    public ConcurrentModificationException() {
036        super(ERR_CONCURRENT_MODIFICATION_EXCEPTION_DEFAULT.get());
037    }
038
039    /**
040     * Create a concurrent modification exception with a cause and a default
041     * message.
042     *
043     * @param cause
044     *            The cause.
045     */
046    public ConcurrentModificationException(Throwable cause) {
047        super(ERR_CONCURRENT_MODIFICATION_EXCEPTION_DEFAULT.get(), cause);
048    }
049
050    /**
051     * Create a concurrent modification exception with a message and cause.
052     *
053     * @param message
054     *            The message.
055     * @param cause
056     *            The cause.
057     */
058    public ConcurrentModificationException(LocalizableMessage message, Throwable cause) {
059        super(message, cause);
060    }
061
062    /**
063     * Create a concurrent modification exception with a message.
064     *
065     * @param message
066     *            The message.
067     */
068    public ConcurrentModificationException(LocalizableMessage message) {
069        super(message);
070    }
071}