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 2014 ForgeRock AS.
016 */
017
018package org.opends.server.admin.client;
019
020
021
022import static org.opends.messages.AdminMessages.*;
023
024import org.forgerock.i18n.LocalizableMessage;
025import org.opends.server.admin.OperationsException;
026
027
028
029/**
030 * This exception is thrown when a critical concurrent modification is
031 * detected by the client. This may be caused by another client
032 * application removing a managed object whilst it is being managed.
033 */
034public class ConcurrentModificationException extends OperationsException {
035
036  /**
037   * Serialization ID.
038   */
039  private static final long serialVersionUID = -1467024486347612820L;
040
041
042
043  /**
044   * Create a concurrent modification exception with a default
045   * message.
046   */
047  public ConcurrentModificationException() {
048    super(ERR_CONCURRENT_MODIFICATION_EXCEPTION_DEFAULT.get());
049  }
050
051
052
053  /**
054   * Create a concurrent modification exception with a cause and a
055   * default 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
066  /**
067   * Create a concurrent modification exception with a message and
068   * cause.
069   *
070   * @param message
071   *          The message.
072   * @param cause
073   *          The cause.
074   */
075  public ConcurrentModificationException(LocalizableMessage message, Throwable cause) {
076    super(message, cause);
077  }
078
079
080
081  /**
082   * Create a concurrent modification exception with a message.
083   *
084   * @param message
085   *          The message.
086   */
087  public ConcurrentModificationException(LocalizableMessage message) {
088    super(message);
089  }
090}