Package org.opends.server.tools.upgrade
Class UpgradeTaskVersion
- java.lang.Object
-
- org.opends.server.tools.upgrade.UpgradeTaskVersion
-
- All Implemented Interfaces:
Comparable<UpgradeTaskVersion>
public final class UpgradeTaskVersion extends Object implements Comparable<UpgradeTaskVersion>
Represents the version used for determining if the upgrade tool must be run and whether an upgrade task must run during the upgrade process.An upgrade task version is composed of a
versionplus the upgrade number. The upgrade number corresponds to the total number of upgrade tasks (without the mandatory ones) added since version 2.8.0 included.Mandatory upgrade tasks are not taken into account in the upgrade number because:
- They are the latest to be registered, including them would have prevented us to use a counter to automatically assign a number to an upgrade task)
- They always run when an upgrade is needed
- The upgrade task number is not used for deciding whether an upgrade is needed, only to know if an upgrade task must run or not
-
-
Field Summary
Fields Modifier and Type Field Description static intUPGRADE_NUMBER_NOT_APPLICABLEInt constant to be used for versions when upgrade between builds was not supported (i.e older than 7.0.0).
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(UpgradeTaskVersion other)booleanequals(Object obj)inthashCode()StringtoString()static UpgradeTaskVersionupgradeVersion(com.forgerock.opendj.util.Version version)Creates and returns a new upgrade version with no meaningful upgrade number.static UpgradeTaskVersionupgradeVersion(com.forgerock.opendj.util.Version version, int upgradeNumber)Creates and returns a new upgrade version set with provided parameters.
-
-
-
Field Detail
-
UPGRADE_NUMBER_NOT_APPLICABLE
public static final int UPGRADE_NUMBER_NOT_APPLICABLE
Int constant to be used for versions when upgrade between builds was not supported (i.e older than 7.0.0).- See Also:
- Constant Field Values
-
-
Method Detail
-
upgradeVersion
public static UpgradeTaskVersion upgradeVersion(com.forgerock.opendj.util.Version version)
Creates and returns a new upgrade version with no meaningful upgrade number.This method is used for compatibility with versions where upgrade number is not supported (versions older than 7.0.0).
- Parameters:
version- Theversionpart of the upgrade task version to create- Returns:
- A new
upgrade task versionwith no meaningful upgrade number
-
upgradeVersion
public static UpgradeTaskVersion upgradeVersion(com.forgerock.opendj.util.Version version, int upgradeNumber)
Creates and returns a new upgrade version set with provided parameters.- Parameters:
version- Theversionpart of the upgrade task version to createupgradeNumber- The number of the upgrade task version to create- Returns:
- A new
upgrade task version
-
compareTo
public int compareTo(UpgradeTaskVersion other)
- Specified by:
compareToin interfaceComparable<UpgradeTaskVersion>
-
-