Interface UpgradeManager

  • All Known Implementing Classes:
    AbstractUpgradeManager, DefaultUpgradeManager

    public interface UpgradeManager
    UpgradeManager is responsible for creating a list of UpgradeTasks. For simple upgrades (standard version build 20 to standard version build 21, for example) it's a simple list for that kind of version. A more sophisticated one (upgrade from standard to enterprise version, for example) can be modeled as a composite subclass of two UpgradeManagers. Note that all license specific code is strictly put into the corresponding subclass, so whatever check for enterprise license or things like that is in a specific subclass and not in form of if(enterprise) do blah code spread here and there.
    • Field Detail


        The lowest build number we will attempt to upgrade from. Any upgrade from a build prior to this number will fail, and a Johnson event will be posted explaining why the upgrade could not be performed.
        See Also:
        Constant Field Values

        The Confluence version corresponding to the build numbers above. This is only used to provide user-friendly error messages.
        See Also:
        Constant Field Values
    • Method Detail

      • needUpgrade

        boolean needUpgrade()
      • isUpgraded

        boolean isUpgraded()
        true if the UpgradeManager was able to successfully upgrade this instance, or if no upgrade was necessary; otherwise false.
      • configuredBuildNumberNewerThan

        boolean configuredBuildNumberNewerThan​(String buildNumber)
        Returns true if the passed build number is less than the configured build number - that is, the version of the currently running Confluence is newer than the version passed.
      • taskNewerThan

        boolean taskNewerThan​(String buildNumber,
                              UpgradeTask upgradeTask)
        Returns true if the build number for the task is greater than the passed build number. Usually indicates that the task should run as part of an upgrade.
      • entireUpgradeFinished

        void entireUpgradeFinished()
        Called when all immediate and deferred upgrade actions have been performed *if* an upgrade was needed.
      • getOldestSpaceImportAllowed

        String getOldestSpaceImportAllowed()
        Calculates the oldest build number from which a space can be imported.
        the build number
      • getExportBuildNumber

        String getExportBuildNumber​(boolean spaceExport)
        Tells the earliest version the exports will be compatible with.
        spaceExport - true if the export is about a space, false for a global export.
        a build number
      • getPluginExportCompatibility

        @NonNull Map<String,​PluginExportCompatibility> getPluginExportCompatibility​(boolean spaceExport)

        Returns the list of plugins with data (especially plugins with Active Objects data) and tells how backward-compatible they are.

        If at least one plugin isn't compatible, the importer silently doesn't import any data.

        What is a compatible version?

        The data is exported as-is in XML and reimported in an earlier version. If the earlier version of the plugin is able to read the data without fault, then it is compatible. Note that there is no downgrade task, obviously.

        spaceExport - true if the export is about a space, false for a global export.
        a matrix of plugin key and minimum versions of the plugins.
      • setDatabaseBuildNumber

        void setDatabaseBuildNumber()
        Once installation is complete, we'll need to set the database build number in the database, so that a subsequent startup of Confluence is able to check that the home directory build number matches the database build number (see