0N/A/*
0N/A * CDDL HEADER START
0N/A *
0N/A * The contents of this file are subject to the terms of the
0N/A * Common Development and Distribution License, Version 1.0 only
0N/A * (the "License"). You may not use this file except in compliance
0N/A * with the License.
0N/A *
0N/A * You can obtain a copy of the license at
0N/A * trunk/opends/resource/legal-notices/OpenDS.LICENSE
0N/A * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
0N/A * See the License for the specific language governing permissions
0N/A * and limitations under the License.
0N/A *
0N/A * When distributing Covered Code, include this CDDL HEADER in each
0N/A * file and include the License file at
0N/A * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
0N/A * add the following below this CDDL HEADER, with the fields enclosed
873N/A * by brackets "[]" replaced with your own identifying information:
0N/A * Portions Copyright [yyyy] [name of copyright owner]
0N/A *
0N/A * CDDL HEADER END
0N/A *
0N/A *
3215N/A * Copyright 2006-2008 Sun Microsystems, Inc.
0N/A */
0N/Apackage org.opends.server.tools;
2086N/Aimport org.opends.messages.Message;
0N/A
0N/A
0N/A
1156N/Aimport org.opends.server.types.IdentifiedException;
1156N/A
1156N/A
1156N/A
0N/A/**
0N/A * This class defines an exception that may be thrown if a local problem occurs
0N/A * in a Directory Server client.
0N/A */
0N/Apublic class ClientException
1156N/A extends IdentifiedException
0N/A{
0N/A /**
0N/A * The serial version identifier required to satisfy the compiler because this
0N/A * class extends <CODE>java.lang.Exception</CODE>, which implements the
0N/A * <CODE>java.io.Serializable</CODE> interface. This value was generated
0N/A * using the <CODE>serialver</CODE> command-line utility included with the
0N/A * Java SDK.
0N/A */
0N/A private static final long serialVersionUID = 1384120263337669664L;
0N/A
0N/A
0N/A
0N/A // The exit code that may be used if the client considers this to be a fatal
0N/A // problem.
0N/A private int exitCode;
0N/A
0N/A
0N/A
0N/A /**
0N/A * Creates a new client exception with the provided message.
0N/A *
0N/A * @param exitCode The exit code that may be used if the client considers
0N/A * this to be a fatal problem.
0N/A * @param message The message that explains the problem that occurred.
0N/A */
2086N/A public ClientException(int exitCode, Message message)
0N/A {
0N/A super(message);
0N/A
0N/A this.exitCode = exitCode;
0N/A }
0N/A
0N/A
0N/A
0N/A /**
0N/A * Creates a new client exception with the provided message and root cause.
0N/A *
0N/A * @param exitCode The exit code that may be used if the client considers
0N/A * this to be a fatal problem.
0N/A * @param message The message that explains the problem that occurred.
0N/A * @param cause The exception that was caught to trigger this exception.
0N/A */
2086N/A public ClientException(int exitCode, Message message, Throwable cause)
0N/A {
0N/A super(message, cause);
0N/A
0N/A this.exitCode = exitCode;
0N/A }
0N/A
0N/A
0N/A
0N/A /**
0N/A * Retrieves the exit code that the client may use if it considers this to be
0N/A * a fatal problem.
0N/A *
0N/A * @return The exit code that the client may use if it considers this to be
0N/A * a fatal problem.
0N/A */
0N/A public int getExitCode()
0N/A {
0N/A return exitCode;
0N/A }
0N/A
0N/A
0N/A}
0N/A