com.atlassian.greenhopper.upgrade
Class UpgradeVersionService

java.lang.Object
  extended by com.atlassian.greenhopper.upgrade.UpgradeVersionService

@Service
public class UpgradeVersionService
extends java.lang.Object

Keeps track of the last upgrade task number to run. Checks if upgrades are currently running.


Nested Class Summary
static class UpgradeVersionService.PluginRunInfo
           
static class UpgradeVersionService.UpgradeHistoryDetail
           
 
Field Summary
static java.lang.String GREEN_HOPPER_UPGRADE_LATEST_VERSION
           
static java.lang.Long LATEST_VERSION
          ==================================================================================================== This MUST to be kept in-sync with the largest build number provided by any upgrade task.
 
Constructor Summary
UpgradeVersionService()
           
 
Method Summary
 UpgradeVersionService.PluginRunInfo getCurrentPluginRunInfo()
           
 java.util.List<UpgradeVersionService.PluginRunInfo> getPluginRunHistory()
          This can be called to get a list of the history of a plugin running
 java.util.List<UpgradeVersionService.UpgradeHistoryDetail> getUpgradeHistory()
           
 boolean hasLastUpgradeTaskCompleted()
           
 UpgradeVersionService.PluginRunInfo recordPluginStarted()
          Called to record when a plugin has started and at what version.
 void recordUpgradeTaskEnded(int buildNumber, long timeTaken)
          Call this to record that a plugin upgrade task has been completed
 void recordUpgradeTaskStarted(int buildNumber)
          Call this to record that a plugin upgrade task has been started
 void setLatestUpgradedVersion(long buildNumber)
           
 boolean versionLooksKosher()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LATEST_VERSION

public static final java.lang.Long LATEST_VERSION
==================================================================================================== This MUST to be kept in-sync with the largest build number provided by any upgrade task. If you write an upgrade task you MUST update this value. Notice the word MUST and not should! ====================================================================================================


GREEN_HOPPER_UPGRADE_LATEST_VERSION

public static final java.lang.String GREEN_HOPPER_UPGRADE_LATEST_VERSION
See Also:
Constant Field Values
Constructor Detail

UpgradeVersionService

public UpgradeVersionService()
Method Detail

setLatestUpgradedVersion

public void setLatestUpgradedVersion(long buildNumber)

hasLastUpgradeTaskCompleted

public boolean hasLastUpgradeTaskCompleted()

versionLooksKosher

public boolean versionLooksKosher()
Returns:
true if the version of GH looks kosher from an upgrade and plugin version point of view

recordPluginStarted

public UpgradeVersionService.PluginRunInfo recordPluginStarted()
Called to record when a plugin has started and at what version. If the plugin has changed since the last time it was run it will return information about that

Returns:
information about the current run version of GH

getCurrentPluginRunInfo

public UpgradeVersionService.PluginRunInfo getCurrentPluginRunInfo()
Returns:
the current plugin run info, which can tell if there has been a down grade

getPluginRunHistory

public java.util.List<UpgradeVersionService.PluginRunInfo> getPluginRunHistory()
This can be called to get a list of the history of a plugin running

Returns:
the list of plugin run history

recordUpgradeTaskStarted

public void recordUpgradeTaskStarted(int buildNumber)
Call this to record that a plugin upgrade task has been started

Parameters:
buildNumber - the build number of the upgrade task

recordUpgradeTaskEnded

public void recordUpgradeTaskEnded(int buildNumber,
                                   long timeTaken)
Call this to record that a plugin upgrade task has been completed

Parameters:
buildNumber - the build number of the upgrade task

getUpgradeHistory

public java.util.List<UpgradeVersionService.UpgradeHistoryDetail> getUpgradeHistory()
Returns:
a history of the plugin upgrade that have run


Copyright © 2007-2012 Atlassian. All Rights Reserved.