001/*
002 * CDDL HEADER START
003 *
004 * The contents of this file are subject to the terms of the
005 * Common Development and Distribution License, Version 1.0 only
006 * (the "License").  You may not use this file except in compliance
007 * with the License.
008 *
009 * You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
010 * or http://forgerock.org/license/CDDLv1.0.html.
011 * See the License for the specific language governing permissions
012 * and limitations under the License.
013 *
014 * When distributing Covered Code, include this CDDL HEADER in each
015 * file and include the License file at legal-notices/CDDLv1_0.txt.
016 * If applicable, add the following below this CDDL HEADER, with the
017 * fields enclosed by brackets "[]" replaced with your own identifying
018 * information:
019 *      Portions Copyright [yyyy] [name of copyright owner]
020 *
021 * CDDL HEADER END
022 *
023 *
024 *      Copyright 2006-2009 Sun Microsystems, Inc.
025 *      Portions Copyright 2011-2015 ForgeRock AS
026 */
027package org.opends.server.util;
028
029/**
030 * This file contains a number of constants that are used throughout the
031 * Directory Server source.  It was dynamically generated as part of the
032 * Directory Server build process and should not be edited directly.
033 */
034@org.opends.server.types.PublicAPI(
035     stability=org.opends.server.types.StabilityLevel.UNCOMMITTED,
036     mayInstantiate=false,
037     mayExtend=false,
038     mayInvoke=true)
039public final class DynamicConstants
040{
041  /**
042   * The official full product name for the Directory Server.
043   */
044  public static String PRODUCT_NAME = "OpenDJ";
045
046  /**
047   * The short product name for the Directory Server.
048   */
049  public static String SHORT_NAME = "OpenDJ";
050
051  /**
052   * The major version number for the Directory Server.
053   */
054  public static int MAJOR_VERSION = 3;
055
056  /**
057   * The minor version number for the Directory Server.
058   */
059  public static int MINOR_VERSION = 0;
060
061  /**
062   * The point version number for the Directory Server.
063   */
064  public static int POINT_VERSION = 0;
065
066  /**
067   * The official build number for the Directory Server.
068   */
069  public static int BUILD_NUMBER = 0;
070
071  /**
072   * The version qualifier string for the Directory Server.
073   */
074  public static String VERSION_QUALIFIER = "";
075
076  /**
077   * The set of bug IDs for fixes included in this build of the Directory
078   * Server.
079   */
080  public static String FIX_IDS = "";
081
082  /**
083   * The build ID for the generated build of the Directory Server.
084   */
085  public static String BUILD_ID = "20160108162510";
086
087  /**
088   * The username of the user that created this build.
089   */
090  public static String BUILD_USER = "jenkins";
091
092  /**
093   * The Java version used to generate this build.
094   */
095  public static String BUILD_JAVA_VERSION = "1.7.0_79";
096
097  /**
098   * The vendor for the Java version used to generate this build.
099   */
100  public static String BUILD_JAVA_VENDOR = "Oracle Corporation";
101
102  /**
103   * The JVM version used to generate this build.
104   */
105  public static String BUILD_JVM_VERSION = "24.79-b02";
106
107  /**
108   * The vendor for the JVM used to generate this build.
109   */
110  public static String BUILD_JVM_VENDOR = "Oracle Corporation";
111
112  /**
113   * The operating system on which this build was generated.
114   */
115  public static String BUILD_OS = "Linux 2.6.32-504.23.4.el6.x86_64 amd64";
116
117  /**
118   * Indicates whether this is a debug build of the Directory Server that may
119   * include additional debugging facilities not available in standard release
120   * versions.
121   */
122  public static boolean DEBUG_BUILD = false;
123
124  /** The revision on which this build is based. */
125  public static String REVISION = "185acee3ba68d8da1782007eebacb3701dc996d6";
126
127  /**
128   * The Subversion url repository location on which this build is based.
129   */
130  public static String URL_REPOSITORY =
131      "https://stash.forgerock.org/projects/OPENDJ/repos/opendj/browse/opendj-server-legacy";
132
133  /**
134   * The documentation home.
135   */
136  public static String DOC_REFERENCE_HOME =
137      "https://backstage.forgerock.com/#!/docs/opendj";
138
139  /**
140   * The documentation url.
141   */
142  public static String DOC_REFERENCE_WIKI =
143      "https://backstage.forgerock.com/#!/docs/opendj";
144
145  /**
146   * The documentation url.
147   */
148  public static String DOC_QUICK_REFERENCE_GUIDE =
149      "https://backstage.forgerock.com/#!/docs/opendj/3/admin-guide";
150
151  /**
152   * The administration guide.
153   */
154   public static String ADMINISTRATION_GUIDE_URL =
155      "https://backstage.forgerock.com/#!/docs/opendj/3/admin-guide";
156
157  /**
158   * A string representation of the version number.
159   */
160  public static String VERSION_NUMBER_STRING = String.format("%s.%s.%s", MAJOR_VERSION, MINOR_VERSION, POINT_VERSION);
161
162  /**
163   * A string representation of the version number.
164   */
165  public static String OPENDJ_NUMBER_STRING = VERSION_NUMBER_STRING;
166
167  /**
168   * A string representation of the release version.
169   */
170  public static String RELEASE_VERSION_STRING =
171       OPENDJ_NUMBER_STRING;
172
173
174  /**
175   * Test if a specific class is provided to overwrite the BUILD definitions
176   * By the release definitions provided by
177   * org.opends.server.util.ReleaseDefinition
178   */
179
180  static {
181
182     try {
183        Class c = Class.forName("org.opends.server.util.ReleaseDefinition");
184        Object obj = c.newInstance();
185
186        try {
187         PRODUCT_NAME = (String)c.getField("PRODUCT_NAME").get(obj);
188        }
189        catch (Exception ex) {}
190        try {
191         SHORT_NAME = (String)c.getField("SHORT_NAME").get(obj);
192        }
193        catch (Exception ex) {}
194        try {
195         MAJOR_VERSION = (Integer)c.getField("MAJOR_VERSION").get(obj);
196        }
197        catch (Exception ex) {}
198        try {
199         MINOR_VERSION = (Integer)c.getField("MINOR_VERSION").get(obj);
200        }
201        catch (Exception ex) {}
202        try {
203         POINT_VERSION = (Integer)c.getField("POINT_VERSION").get(obj);
204        }
205        catch (Exception ex) {}
206        try {
207         BUILD_NUMBER = (Integer)c.getField("BUILD_NUMBER").get(obj);
208        }
209        catch (Exception ex) {}
210        try {
211         VERSION_QUALIFIER = (String)c.getField("VERSION_QUALIFIER").get(obj);
212        }
213        catch (Exception ex) {}
214        try {
215         FIX_IDS = (String)c.getField("FIX_IDS").get(obj);
216        }
217        catch (Exception ex) {}
218        try{
219         BUILD_ID = (String)c.getField("BUILD_ID").get(obj);
220        }
221        catch (Exception ex) {}
222        try{
223         BUILD_USER = (String)c.getField("BUILD_USER").get(obj);
224        }
225        catch (Exception ex) {}
226        try{
227         REVISION = (String)c.getField("REVISION_NUMBER").get(obj);
228        }
229        catch (Exception ex) {}
230        try{
231         BUILD_JAVA_VERSION = (String)c.getField("BUILD_JAVA_VERSION").get(obj);
232        }
233        catch (Exception ex) {}
234        try{
235         BUILD_JAVA_VENDOR = (String)c.getField("BUILD_JAVA_VENDOR").get(obj);
236        }
237        catch (Exception ex) {}
238        try{
239         BUILD_JVM_VERSION = (String)c.getField("BUILD_JVM_VERSION").get(obj);
240        }
241        catch (Exception ex) {}
242        try{
243         BUILD_JVM_VENDOR = (String)c.getField("BUILD_JVM_VENDOR").get(obj);
244        }
245        catch (Exception ex) {}
246        try{
247         BUILD_OS = (String)c.getField("BUILD_OS").get(obj);
248        }
249        catch (Exception ex) {}
250        try{
251         DEBUG_BUILD = (Boolean)c.getField("DEBUG_BUILD").get(obj);
252        }
253        catch (Exception ex) {}
254        try{
255         URL_REPOSITORY = (String)c.getField("URL_REPOSITORY").get(obj);
256        }
257        catch (Exception ex) {}
258        try{
259         DOC_REFERENCE_WIKI =
260            (String)c.getField("DOC_REFERENCE_WIKI").get(obj);
261        }
262        catch(Exception ex) {}
263        try{
264         DOC_QUICK_REFERENCE_GUIDE =
265            (String)c.getField("DOC_QUICK_REFERENCE_GUIDE").get(obj);
266        }
267        catch(Exception ex) {}
268        try{
269         ADMINISTRATION_GUIDE_URL =
270           (String)c.getField("ADMINISTRATION_GUIDE_URL").get(obj);
271        }
272        catch(Exception ex) {}
273        try{
274         VERSION_NUMBER_STRING =
275                 (String)c.getField("VERSION_NUMBER_STRING").get(obj);
276        }
277        catch (Exception ex) {}
278        try{
279         RELEASE_VERSION_STRING = VERSION_NUMBER_STRING
280                 + " (OpenDJ version = "
281                 + OPENDJ_NUMBER_STRING + ")" ;
282        }
283        catch (Exception ex) {}
284      } catch (Exception ex) {
285      }
286  }
287   /**
288   * A compact version string for this product, suitable for use in path
289   * names and similar cases.
290   */
291  public static String COMPACT_VERSION_STRING =
292       SHORT_NAME + "-" + VERSION_NUMBER_STRING;
293
294  /**
295   * A full version string for this product.
296   */
297  public static String FULL_VERSION_STRING = PRODUCT_NAME + " " + RELEASE_VERSION_STRING
298      + (VERSION_QUALIFIER != null && !VERSION_QUALIFIER.isEmpty() ? "-" + VERSION_QUALIFIER : "")
299      + (FIX_IDS != null && !FIX_IDS.isEmpty() ? "+" + FIX_IDS : "");
300
301  /**
302   * A printable version string for this product.
303   */
304  public static final String PRINTABLE_VERSION_STRING =
305       FULL_VERSION_STRING + System.getProperty("line.separator") +
306       "Build " + BUILD_ID + System.getProperty("line.separator");
307
308}