Class 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 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 - The version 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 - The version part of the upgrade task version to create
        upgradeNumber - The number of the upgrade task version to create
        Returns:
        A new upgrade task version
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object