Class ConstrainedBuildUtilsInfo
- All Implemented Interfaces:
BuildUtilsInfo
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 Summary
ConstructorsConstructorDescriptionConstrainedBuildUtilsInfo
(UpgradeConstraints constraints, BuildUtilsInfo buildUtilsInfo) -
Method Summary
Modifier and TypeMethodDescriptionint
Gets the build number of this Jira install.Returns the version of AppLinks that Jira ships with.Returns the version of Atlassian Audit that Jira exports into OSGI-land.Gets a build information summary as a String.Gets the partner name of this Jira buildgetBuildProperty
(String key) Returns the value of the build property with the given key.Returns the id of the SCM commit that was used to make this build of Jira.Gets the date this version of Jira was built on.Gets the current build number of Jira.int
Gets the build number of the database that this Jira instance points to.Return the version used for Jira documentation.Gets the minimal build number that Jira can upgrade fromGet the minimum version of Jira that can be upgraded to this instance version.Returns the version of Atlassian SAL that Jira exports into OSGI-land.Deprecated.Gets the current version of Jiraint[]
Gets the numerical components of the version.boolean
isBeta()
Returns whether the current version is a beta (i.e.boolean
isEap()
Indicates whether the current version is an Early Access Program (EAP) release.boolean
isFinal()
Indicates whether the current version is a final (GA) release.boolean
Returns whether the current version is a milestone (i.e.boolean
isRc()
Returns whether the current version is a release candidate (i.e.boolean
Returns whether the current version is a snapshot (i.e.
-
Constructor Details
-
ConstrainedBuildUtilsInfo
-
-
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 interfaceBuildUtilsInfo
- Returns:
- the build number of this Jira install.
- See Also:
-
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 interfaceBuildUtilsInfo
- 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 interfaceBuildUtilsInfo
- Returns:
- the build number of the database that Jira points to.
- See Also:
-
getMinimumUpgradableBuildNumber
Description copied from interface:BuildUtilsInfo
Gets the minimal build number that Jira can upgrade from- Specified by:
getMinimumUpgradableBuildNumber
in interfaceBuildUtilsInfo
- Returns:
- the minimal build number that Jira can upgrade from
-
getCurrentBuildDate
Description copied from interface:BuildUtilsInfo
Gets the date this version of Jira was built on.- Specified by:
getCurrentBuildDate
in interfaceBuildUtilsInfo
- Returns:
- the date this version of Jira was built on, or
null
if it couldn't be parsed
-
getBuildPartnerName
Description copied from interface:BuildUtilsInfo
Gets the partner name of this Jira build- Specified by:
getBuildPartnerName
in interfaceBuildUtilsInfo
- Returns:
- the partner name of this Jira build.
-
getBuildInformation
Description copied from interface:BuildUtilsInfo
Gets a build information summary as a String.- Specified by:
getBuildInformation
in interfaceBuildUtilsInfo
- Returns:
- a build information summary
-
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 interfaceBuildUtilsInfo
- Returns:
- a String containing the SCM commit id, or an empty 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 interfaceBuildUtilsInfo
- Returns:
- the SCM commit id that was used to make this build of Jira.
-
getMinimumUpgradableVersion
Description copied from interface:BuildUtilsInfo
Get the minimum version of Jira that can be upgraded to this instance version.- Specified by:
getMinimumUpgradableVersion
in interfaceBuildUtilsInfo
- Returns:
- the minimum version that can be upgraded.
-
getSalVersion
Description copied from interface:BuildUtilsInfo
Returns the version of Atlassian SAL that Jira exports into OSGI-land.- Specified by:
getSalVersion
in interfaceBuildUtilsInfo
- Returns:
- the version of Atlassian SAL that Jira exports
-
getApplinksVersion
Description copied from interface:BuildUtilsInfo
Returns the version of AppLinks that Jira ships with.- Specified by:
getApplinksVersion
in interfaceBuildUtilsInfo
- Returns:
- the version of AppLinks that Jira ships with
-
getCrowdOsgiVersion
- Specified by:
getCrowdOsgiVersion
in interfaceBuildUtilsInfo
- Returns:
- the osgi version for the embedded crowd to be exported with
-
getGuavaOsgiVersion
- Specified by:
getGuavaOsgiVersion
in interfaceBuildUtilsInfo
- Returns:
- the osgi version that Guava (com.google.common) should be exported as
-
getBuildProperty
Description copied from interface:BuildUtilsInfo
Returns the value of the build property with the given key.- Specified by:
getBuildProperty
in interfaceBuildUtilsInfo
- 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 interfaceBuildUtilsInfo
- 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 interfaceBuildUtilsInfo
- 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 interfaceBuildUtilsInfo
- 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 interfaceBuildUtilsInfo
- 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 interfaceBuildUtilsInfo
- 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 interfaceBuildUtilsInfo
- Returns:
- true if the version string has -m after its version numbers, otherwise false (case-insensitive)
-
getAuditVersion
Description copied from interface:BuildUtilsInfo
Returns the version of Atlassian Audit that Jira exports into OSGI-land.- Specified by:
getAuditVersion
in interfaceBuildUtilsInfo
- Returns:
- the version of Atlassian Audit that Jira exports
-
getVersion
Description copied from interface:BuildUtilsInfo
Gets the current version of Jira- Specified by:
getVersion
in interfaceBuildUtilsInfo
- Returns:
- the current version of Jira
-
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 interfaceBuildUtilsInfo
- 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 interfaceBuildUtilsInfo
- Returns:
- the leading numerical components of getVersion()
-