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
version
plus 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 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).
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(UpgradeTaskVersion other)
boolean
equals(Object obj)
int
hashCode()
String
toString()
static UpgradeTaskVersion
upgradeVersion(com.forgerock.opendj.util.Version version)
Creates and returns a new upgrade version with no meaningful upgrade number.static UpgradeTaskVersion
upgradeVersion(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
- Theversion
part of the upgrade task version to create- Returns:
- A new
upgrade task version
with 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
- Theversion
part 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:
compareTo
in interfaceComparable<UpgradeTaskVersion>
-
-