com.atlassian.jira.upgrade
Class DefaultBuildVersionRegistry

java.lang.Object
  extended by com.atlassian.jira.upgrade.DefaultBuildVersionRegistry
All Implemented Interfaces:
BuildVersionRegistry

@InjectableComponent
public class DefaultBuildVersionRegistry
extends Object
implements BuildVersionRegistry

Default implementation which looks up the known versions from the file build-versions.properties.

Since:
v4.1

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.atlassian.jira.upgrade.BuildVersionRegistry
BuildVersionRegistry.BuildVersion
 
Constructor Summary
DefaultBuildVersionRegistry(BuildUtilsInfo buildUtilsInfo)
           
 
Method Summary
 BuildVersionRegistry.BuildVersion getVersionForBuildNumber(String targetBuildNumber)
          Takes a build number and attempts to resolve it to a released (or unreleased during development) version of JIRA.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultBuildVersionRegistry

public DefaultBuildVersionRegistry(BuildUtilsInfo buildUtilsInfo)
Method Detail

getVersionForBuildNumber

public BuildVersionRegistry.BuildVersion getVersionForBuildNumber(String targetBuildNumber)
Description copied from interface: BuildVersionRegistry

Takes a build number and attempts to resolve it to a released (or unreleased during development) version of JIRA. If the build number does not directly correspond to a released version of JIRA, we attempt to infer the version by searching for the next known build number above the input.

For example, if the build number is 207, the version returned would be 3.8, as it has a build number of 209. In this case, the resulting BuildVersionRegistry.BuildVersion object will have a build number corresponding to the target build number and not the input build number, as the target build number is the official number against that version.

If the input build number is higher than any known build number, we return the currently running version of JIRA.

Specified by:
getVersionForBuildNumber in interface BuildVersionRegistry
Parameters:
targetBuildNumber - the build number to look up; must be not null and parseable to an integer.
Returns:
the version that corresponds to this build number.


Copyright © 2002-2013 Atlassian. All Rights Reserved.