Class ConstrainedBuildUtilsInfo

java.lang.Object
com.atlassian.jira.bc.dataimport.ConstrainedBuildUtilsInfo
All Implemented Interfaces:
BuildUtilsInfo

public class ConstrainedBuildUtilsInfo extends Object implements BuildUtilsInfo
Temporary class used during transition period (will be deleted afterwards). In dark ages mode we do not want to allow importing data that was exported from renaissance. As DefaultDataImportService uses BuildUtilsInfoImpl class to determine if data can be imported, this class returns com.atlassian.jira.util.BuildUtils#CLOUD_DARK_AGES_BUILD_NUMBER as build number which would prevent import from renaissance happening (as downgrade from com.atlassian.jira.upgrade.tasks.UpgradeTask_Build70100 is not possible).

NOTE: this class will change default JIRA behaviour only if roles are not enabled (dark ages) and instance is running in Cloud. In any other case it will work as before.

Since:
7.0
  • Constructor Details

  • Method Details

    • getApplicationBuildNumber

      public int getApplicationBuildNumber()
      Description copied from interface: BuildUtilsInfo
      Gets the build number of this Jira install.

      That is, the build number of the currently running installation files. The DB also stores a build number.

      Specified by:
      getApplicationBuildNumber in interface BuildUtilsInfo
      Returns:
      the build number of this Jira install.
      See Also:
    • getCurrentBuildNumber

      public String getCurrentBuildNumber()
      Description copied from interface: BuildUtilsInfo
      Gets the current build number of Jira.

      This is the same value as BuildUtilsInfo.getApplicationBuildNumber() except it is returned as a String.

      Specified by:
      getCurrentBuildNumber in interface BuildUtilsInfo
      Returns:
      the current build number of Jira
      See Also:
    • getDatabaseBuildNumber

      public int getDatabaseBuildNumber()
      Description copied from interface: BuildUtilsInfo
      Gets the build number of the database that this Jira instance points to.

      Under normal circumstances this will be the same as the build number of the Jira installation. However, when you first upgrade a Jira database or import data exported from an older Jira, the existing database will start on the previous build number. Jira will then run "Upgrade Tasks" to update the data in the DB.

      Specified by:
      getDatabaseBuildNumber in interface BuildUtilsInfo
      Returns:
      the build number of the database that Jira points to.
      See Also:
    • getMinimumUpgradableBuildNumber

      public String getMinimumUpgradableBuildNumber()
      Description copied from interface: BuildUtilsInfo
      Gets the minimal build number that Jira can upgrade from
      Specified by:
      getMinimumUpgradableBuildNumber in interface BuildUtilsInfo
      Returns:
      the minimal build number that Jira can upgrade from
    • getCurrentBuildDate

      public Date getCurrentBuildDate()
      Description copied from interface: BuildUtilsInfo
      Gets the date this version of Jira was built on.
      Specified by:
      getCurrentBuildDate in interface BuildUtilsInfo
      Returns:
      the date this version of Jira was built on, or null if it couldn't be parsed
    • getBuildPartnerName

      public String getBuildPartnerName()
      Description copied from interface: BuildUtilsInfo
      Gets the partner name of this Jira build
      Specified by:
      getBuildPartnerName in interface BuildUtilsInfo
      Returns:
      the partner name of this Jira build.
    • getBuildInformation

      public String getBuildInformation()
      Description copied from interface: BuildUtilsInfo
      Gets a build information summary as a String.
      Specified by:
      getBuildInformation in interface BuildUtilsInfo
      Returns:
      a build information summary
    • getSvnRevision

      @Deprecated public String getSvnRevision()
      Deprecated.
      Description copied from interface: BuildUtilsInfo
      Returns the SCM commit id that was used to make this build of Jira. This used to be an SVN revision, but is now a Git commit id (aka a SHA1). This method returns an empty string if Jira was built from the source distribution.
      Specified by:
      getSvnRevision in interface BuildUtilsInfo
      Returns:
      a String containing the SCM commit id, or an empty String.
    • getCommitId

      public String getCommitId()
      Description copied from interface: BuildUtilsInfo
      Returns the id of the SCM commit that was used to make this build of Jira. This method returns an empty string if Jira was built from the source distribution.
      Specified by:
      getCommitId in interface BuildUtilsInfo
      Returns:
      the SCM commit id that was used to make this build of Jira.
    • getMinimumUpgradableVersion

      public String getMinimumUpgradableVersion()
      Description copied from interface: BuildUtilsInfo
      Get the minimum version of Jira that can be upgraded to this instance version.
      Specified by:
      getMinimumUpgradableVersion in interface BuildUtilsInfo
      Returns:
      the minimum version that can be upgraded.
    • getUnavailableLocales

      public Collection<Locale> getUnavailableLocales()
      Specified by:
      getUnavailableLocales in interface BuildUtilsInfo
    • getSalVersion

      public String getSalVersion()
      Description copied from interface: BuildUtilsInfo
      Returns the version of Atlassian SAL that Jira exports into OSGI-land.
      Specified by:
      getSalVersion in interface BuildUtilsInfo
      Returns:
      the version of Atlassian SAL that Jira exports
    • getApplinksVersion

      public String getApplinksVersion()
      Description copied from interface: BuildUtilsInfo
      Returns the version of AppLinks that Jira ships with.
      Specified by:
      getApplinksVersion in interface BuildUtilsInfo
      Returns:
      the version of AppLinks that Jira ships with
    • getCrowdOsgiVersion

      public String getCrowdOsgiVersion()
      Specified by:
      getCrowdOsgiVersion in interface BuildUtilsInfo
      Returns:
      the osgi version for the embedded crowd to be exported with
    • getGuavaOsgiVersion

      public String getGuavaOsgiVersion()
      Specified by:
      getGuavaOsgiVersion in interface BuildUtilsInfo
      Returns:
      the osgi version that Guava (com.google.common) should be exported as
    • getBuildProperty

      public String getBuildProperty(String key)
      Description copied from interface: BuildUtilsInfo
      Returns the value of the build property with the given key.
      Specified by:
      getBuildProperty in interface BuildUtilsInfo
      Parameters:
      key - the key for which to retrieve the value
      Returns:
      null if the key is unknown
    • isBeta

      public boolean isBeta()
      Description copied from interface: BuildUtilsInfo
      Returns whether the current version is a beta (i.e. has -beta after its version numbers)
      Specified by:
      isBeta in interface BuildUtilsInfo
      Returns:
      true if the version string has -beta after its version numbers, otherwise false (case-insensitive)
    • isEap

      public boolean isEap()
      Description copied from interface: BuildUtilsInfo
      Indicates whether the current version is an Early Access Program (EAP) release.
      Specified by:
      isEap in interface BuildUtilsInfo
      Returns:
      see above
    • isFinal

      public boolean isFinal()
      Description copied from interface: BuildUtilsInfo
      Indicates whether the current version is a final (GA) release.
      Specified by:
      isFinal in interface BuildUtilsInfo
      Returns:
      see above
    • isRc

      public boolean isRc()
      Description copied from interface: BuildUtilsInfo
      Returns whether the current version is a release candidate (i.e. has -rc after its version numbers)
      Specified by:
      isRc in interface BuildUtilsInfo
      Returns:
      true if the version string has -rc after its version numbers, otherwise false (case-insensitive)
    • isSnapshot

      public boolean isSnapshot()
      Description copied from interface: BuildUtilsInfo
      Returns whether the current version is a snapshot (i.e. has -SNAPSHOT after its version numbers)
      Specified by:
      isSnapshot in interface BuildUtilsInfo
      Returns:
      true if the version string has -SNAPSHOT after its version numbers, otherwise false (case-insensitive)
    • isMilestone

      public boolean isMilestone()
      Description copied from interface: BuildUtilsInfo
      Returns whether the current version is a milestone (i.e. has -mXX after its version numbers)
      Specified by:
      isMilestone in interface BuildUtilsInfo
      Returns:
      true if the version string has -m after its version numbers, otherwise false (case-insensitive)
    • getAuditVersion

      public String getAuditVersion()
      Description copied from interface: BuildUtilsInfo
      Returns the version of Atlassian Audit that Jira exports into OSGI-land.
      Specified by:
      getAuditVersion in interface BuildUtilsInfo
      Returns:
      the version of Atlassian Audit that Jira exports
    • getVersion

      public String getVersion()
      Description copied from interface: BuildUtilsInfo
      Gets the current version of Jira
      Specified by:
      getVersion in interface BuildUtilsInfo
      Returns:
      the current version of Jira
    • getDocVersion

      public String getDocVersion()
      Description copied from interface: BuildUtilsInfo
      Return the version used for Jira documentation.

      This is the version that Jira uses when generating links to its externally hosted documentation.

      Specified by:
      getDocVersion in interface BuildUtilsInfo
      Returns:
      the version used for Jira documentation.
    • getVersionNumbers

      public int[] getVersionNumbers()
      Description copied from interface: BuildUtilsInfo
      Gets the numerical components of the version.

      • "5.0" gives [5, 0, 0]
        "5.0.1" gives [5, 0, 1]
        "5.0-beta1" gives [5, 0, 0]
        "5.0.1-SNAPSHOT" gives [5, 0, 1]
    • The returned array is guaranteed to have at least 3 elements. Any non-numeric suffix in getVersion() is ignored.

      A simple way to use this information is with Guava's Ints.lexicographicalComparator():

        int[] v510 = {5, 1, 0};
        if (Ints.lexicographicalComparator().compare(buildUtils.getVersionNumbers(), v510) >= 0 ) { ...
       
      Specified by:
      getVersionNumbers in interface BuildUtilsInfo
      Returns:
      the leading numerical components of getVersion()