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-2009 Sun Microsystems, Inc.
015 * Portions Copyright 2013-2016 ForgeRock AS.
016 */
017package org.opends.quicksetup;
018
019/** This class defines enumeration of application return code. */
020public class ReturnCode {
021
022  /** Return code: Application successful. */
023  public static final ReturnCode SUCCESSFUL = new ReturnCode(0);
024  /** Return code: User Cancelled operation. */
025  public static final ReturnCode CANCELED = new ReturnCode(0);
026  /** Return code: User provided invalid data. */
027  public static final ReturnCode USER_DATA_ERROR = new ReturnCode(2);
028  /** Return code: Error accessing file system (reading/writing). */
029  public static final ReturnCode FILE_SYSTEM_ACCESS_ERROR = new ReturnCode(3);
030  /** Error during the configuration of the Directory Server. */
031  public static final ReturnCode CONFIGURATION_ERROR = new ReturnCode(5);
032  /**
033   * Error during the import of data (base entry, from LDIF file or
034   * automatically generated data).
035   */
036  public static final ReturnCode IMPORT_ERROR = new ReturnCode(6);
037  /** Error starting the Open DS server. */
038  public static final ReturnCode START_ERROR = new ReturnCode(7);
039  /** Error stopping the Open DS server. */
040  public static final ReturnCode STOP_ERROR = new ReturnCode(8);
041  /** Error enabling the Windows service. */
042  public static final ReturnCode WINDOWS_SERVICE_ERROR = new ReturnCode(9);
043  /** Application specific error. */
044  public static final ReturnCode APPLICATION_ERROR = new ReturnCode(10);
045  /** Error invoking an OpenDS tool. */
046  public static final ReturnCode TOOL_ERROR = new ReturnCode(11);
047  /** Return code: Bug. */
048  public static final ReturnCode BUG = new ReturnCode(12);
049  /** Return code: java version non-compatible. */
050  public static final ReturnCode JAVA_VERSION_INCOMPATIBLE = new ReturnCode(13);
051  /** Return code: user provided invalid input. */
052  public static final ReturnCode USER_INPUT_ERROR = new ReturnCode(14);
053  /** Return code: Print Version. */
054  public static final ReturnCode PRINT_VERSION = new ReturnCode(50);
055  /** Return code for errors that are non-specified. */
056  public static final ReturnCode UNKNOWN = new ReturnCode(100);
057
058  private final int code;
059
060  /**
061   * Creates a new parameterized instance.
062   *
063   * @param code to return
064   */
065  private ReturnCode(int code)
066  {
067    this.code = code;
068  }
069
070  /**
071   * Gets the return code to return to the console.
072   *
073   * @return int code
074   */
075  public int getReturnCode() {
076    return code;
077  }
078}