001/*
002 * Copyright 1969 Ping Identity Corporation
003 * All Rights Reserved.
004 */
005/*
006 * Copyright (C) 1969 Ping Identity Corporation
007 *
008 * This program is free software; you can redistribute it and/or modify
009 * it under the terms of the GNU General Public License (GPLv2 only)
010 * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
011 * as published by the Free Software Foundation.
012 *
013 * This program is distributed in the hope that it will be useful,
014 * but WITHOUT ANY WARRANTY; without even the implied warranty of
015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
016 * GNU General Public License for more details.
017 *
018 * You should have received a copy of the GNU General Public License
019 * along with this program; if not, see <http://www.gnu.org/licenses>.
020 */
021package com.unboundid.ldap.sdk;
022
023
024
025import java.util.ArrayList;
026import java.util.Collections;
027import java.util.List;
028
029import com.unboundid.util.ThreadSafety;
030import com.unboundid.util.ThreadSafetyLevel;
031
032
033
034/**
035 * This class provides information about the current version of the UnboundID
036 * LDAP SDK for Java.
037 */
038@ThreadSafety(level=ThreadSafetyLevel.COMPLETELY_THREADSAFE)
039public final class Version
040{
041  //
042  // NOTE -- This file is dynamically generated.  Do not edit it.  If you need
043  //         to add something to it, then add it to the
044  //         resource/Version.java.stub file below the LDAP SDK build root.
045  //
046
047
048
049  /**
050   * The official full product name for the LDAP SDK.  For this build, the
051   * value is "UnboundID LDAP SDK for Java".
052   */
053  public static final String PRODUCT_NAME =
054       "UnboundID LDAP SDK for Java";
055
056
057
058  /**
059   * The short product name for the LDAP SDK.  This will not have any spaces.
060   * For this build, the value is "unboundid-ldapsdk".
061   */
062  public static final String SHORT_NAME =
063       "unboundid-ldapsdk";
064
065
066
067  /**
068   * The major version number for the LDAP SDK.  For this build, the value is
069   * 4.
070   */
071  public static final int MAJOR_VERSION = 4;
072
073
074
075  /**
076   * The minor version number for the LDAP SDK.  For this build, the value is
077   * 0.
078   */
079  public static final int MINOR_VERSION = 0;
080
081
082
083  /**
084   * The point version number for the LDAP SDK.  For this build, the value is
085   * 14.
086   */
087  public static final int POINT_VERSION = 14;
088
089
090
091  /**
092   * The version qualifier string for the LDAP SDK.  It will often be a
093   * zero-length string, but may be non-empty for special builds that should be
094   * tagged in some way (e.g., "-beta1" or "-rc2").  For this build, the value
095   * is "".
096   */
097  public static final String VERSION_QUALIFIER =
098       "";
099
100
101
102  /**
103   * A timestamp that indicates when this build of the LDAP SDK was generated.
104   * For this build, the value is "19691212145355Z".
105   */
106  public static final String BUILD_TIMESTAMP = "19691212145355Z";
107
108
109
110  /**
111   * The type of repository from which the source code used to build the LDAP
112   * SDK was retrieved.  It will be one of "subversion", "git", or "{unknown}".
113   * For this build, the value is "git".
114   */
115  public static final String REPOSITORY_TYPE = "git";
116
117
118
119  /**
120   * The URL for the repository from which the source code used to build the
121   * LDAP SDK was retrieved.  If repository information could not be determined
122   * at build time, then this will be a file URL that references the path to the
123   * source code on the system used to build the LDAP SDK library.  For this
124   * build, the value is
125   * "https://github.com/pingidentity/ldapsdk.git".
126   */
127  public static final String REPOSITORY_URL =
128       "https://github.com/pingidentity/ldapsdk.git";
129
130
131
132  /**
133   * The path to the LDAP SDK source code in the repository.  If repository
134   * information could not be determined at build time, then this will be "/".
135   * For this build, the value is
136   * "{unknown}".
137   */
138  public static final String REPOSITORY_PATH =
139       "{unknown}";
140
141
142
143  /**
144   * The string representation of the source revision from which this build of
145   * the LDAP SDK was generated.  For a subversion repository, this will be the
146   * string representation of the revision number.  For a git repository, this
147   * will be the hexadecimal representation of the digest for the most recent
148   * commit.  If repository information could not be determined at build time,
149   * the value will be "{unknown}".  For this build, the value is
150   * "c0fb784eebf9d36a67c736d0428fb3577f2e25bb".
151   */
152  public static final String REVISION_ID =
153       "c0fb784eebf9d36a67c736d0428fb3577f2e25bb";
154
155
156
157  /**
158   * The revision number for the source revision from which this build of the
159   * LDAP SDK was generated.  For a subversion repository, this will be the
160   * revision number.  For a git repository (which uses a hexadecimal digest to
161   * indicate revisions), or if repository information could not be determined
162   * at build time, the value will be -1.  For this build, the value is
163   * -1.
164   *
165   * @deprecated  Use the {@link #REVISION_ID} property instead, since it can
166   *              handle non-numeric revision identifiers.
167   */
168  @Deprecated()
169  public static final long REVISION_NUMBER = -1;
170
171
172
173  /**
174   * The full version string for the LDAP SDK.  For this build, the value is
175   * "UnboundID LDAP SDK for Java 4.0.14".
176   */
177  public static final String FULL_VERSION_STRING =
178       PRODUCT_NAME + ' ' + MAJOR_VERSION + '.' + MINOR_VERSION + '.' +
179       POINT_VERSION + VERSION_QUALIFIER;
180
181
182
183  /**
184   * The short version string for the LDAP SDK.  This will not have any spaces.
185   * For this build, the value is
186   * "unboundid-ldapsdk-4.0.14".
187   */
188  public static final String SHORT_VERSION_STRING =
189       SHORT_NAME + '-' + MAJOR_VERSION + '.' + MINOR_VERSION + '.' +
190       POINT_VERSION + VERSION_QUALIFIER;
191
192
193
194  /**
195   *The version number string for the LDAP SDK, which contains just the major,
196   * minor, and point version, and optional version qualifier.  For this build,
197   * the version string is
198   * "4.0.14".
199   */
200  public static final String NUMERIC_VERSION_STRING =
201       MAJOR_VERSION + "." + MINOR_VERSION + '.' +
202       POINT_VERSION + VERSION_QUALIFIER;
203
204
205
206  /**
207   * Prevent this class from being instantiated.
208   */
209  private Version()
210  {
211    // No implementation is required.
212  }
213
214
215
216  /**
217   * Prints version information from this class to standard output.
218   *
219   * @param  args  The command-line arguments provided to this program.
220   */
221  public static void main(final String... args)
222  {
223    for (final String line : getVersionLines())
224    {
225      System.out.println(line);
226    }
227  }
228
229
230
231  /**
232   * Retrieves a list of lines containing information about the LDAP SDK
233   * version.
234   *
235   * @return  A list of lines containing information about the LDAP SDK
236   *          version.
237   */
238  public static List<String> getVersionLines()
239  {
240    final ArrayList<String> versionLines = new ArrayList<>(11);
241
242    versionLines.add("Full Version String:   " + FULL_VERSION_STRING);
243    versionLines.add("Short Version String:  " + SHORT_VERSION_STRING);
244    versionLines.add("Product Name:          " + PRODUCT_NAME);
245    versionLines.add("Short Name:            " + SHORT_NAME);
246    versionLines.add("Major Version:         " + MAJOR_VERSION);
247    versionLines.add("Minor Version:         " + MINOR_VERSION);
248    versionLines.add("Point Version:         " + POINT_VERSION);
249    versionLines.add("Version Qualifier:     " + VERSION_QUALIFIER);
250    versionLines.add("Build Timestamp:       " + BUILD_TIMESTAMP);
251    versionLines.add("Repository Type:       " + REPOSITORY_TYPE);
252    versionLines.add("Repository URL:        " + REPOSITORY_URL);
253    versionLines.add("Repository Path:       " + REPOSITORY_PATH);
254    versionLines.add("Revision:              " + REVISION_ID);
255
256    return Collections.unmodifiableList(versionLines);
257  }
258}