BuildInformation.java revision 37f9a536593b696e5a3dcec443e1475f22fb5afd
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at
* trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
* add the following below this CDDL HEADER, with the fields enclosed
* by brackets "[]" replaced with your own identifying information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Portions Copyright 2006-2007 Sun Microsystems, Inc.
*/
/**
* Represents information about the current build that is
* publicly obtainable by invoking start-ds -F.
*/
public class BuildInformation implements Comparable {
// These string values must be synchronized with Directory
// Server's main method. These string values are considered
// stable by the server team and not candidates for
// internationalization.
/**
* Reads build information for a particular installation by reading the
* output from invoking the start-ds tool with the full information option.
* @param installation from which to gather build information
* @return BuildInformation object populated with information
* @throws ApplicationException if all or some important information could
* not be determined
*/
throws ApplicationException {
try {
if (-1 != colonIndex) {
}
}
} catch (IOException e) {
throw new ApplicationException(
} finally {
try {
} catch (IOException e) {
// ignore;
}
}
}
// Make sure we got values for important properties that are used
// in compareTo, equals, and hashCode
NAME,
return bi;
}
/**
* Creates an instance from a string representing a build number
* of the for MAJOR.MINOR.POINT.REVISION where MAJOR, MINOR, POINT,
* and REVISION are integers.
* @param bn String representation of a build number
* @return a BuildInformation object populated with the information
* provided in <code>bn</code>
* @throws IllegalArgumentException if <code>bn</code> is not a build
* number
*/
{
// -------------------------------------------------------
// NOTE: if you change this be sure to change getBuildString()
// -------------------------------------------------------
if (!m.matches()) {
}
try {
} catch (Exception e) {
}
return bi;
}
/**
* Creates an instance from constants present in the current build.
* @return BuildInformation created from current constant values
* @throws ApplicationException if all or some important information could
* not be determined
*/
// Make sure we got values for important properties that are used
// in compareTo, equals, and hashCode
NAME,
return bi;
}
/**
* Gets the name of this build. This is the first line of the output
* from invoking start-ds -F.
* @return String representing the name of the build
*/
}
/**
* Gets the build ID which is the 14 digit number code like 20070420110336.
*
* @return String representing the build ID
*/
public String getBuildId() {
}
/**
* Gets the major version.
*
* @return String representing the major version
*/
public Integer getMajorVersion() {
}
/**
* Gets the minor version.
*
* @return String representing the minor version
*/
public Integer getMinorVersion() {
}
/**
* Gets the point version.
*
* @return String representing the point version
*/
public Integer getPointVersion() {
}
/**
* Gets the version qualifier.
*
* @return String reprenting the version qualifier
*/
public String getVersionQualifier() {
}
/**
* Gets the SVN revision number.
*
* @return Integer representing the SVN revision number
*/
public Integer getRevisionNumber() {
}
/**
* Gets the set of IDs representing <code>IncompatibleVersionEvents</code>.
* @return set of integers representing events
* @see org.opends.server.util.VersionCompatibilityIssue
*/
try {
} catch (NumberFormatException nfe) {
}
}
}
return ids;
}
/**
* Returns a build string representation of this object. A build
* number is a string formatted MAJOR.MINOR.POINT.REVISION where
* MAJOR, MINOR, POINT and REVISION are integers.
* @return String representation of a build number
*/
public String getBuildString() {
// -------------------------------------------------------
// NOTE: if you change this be sure to change fromBuildString()
// -------------------------------------------------------
}
/**
* {@inheritDoc}
*/
.append(": ")
.append(")");
}
}
/**
* {@inheritDoc}
*/
return 0;
return -1;
}
return -1;
}
return -1;
}
return -1;
}
return 1;
}
/**
* {@inheritDoc}
*/
return this == o ||
compareTo(o) == 0;
}
/**
* {@inheritDoc}
*/
public int hashCode() {
int hc = 11;
return hc;
}
throws ApplicationException {
throw new ApplicationException(
}
}
}
}