Class IsUpgradeInProgressCondition

java.lang.Object
com.atlassian.jira.plugin.webfragment.conditions.AbstractWebCondition
com.atlassian.jira.plugin.adminupdates.conditions.IsUpgradeInProgressCondition
All Implemented Interfaces:
com.atlassian.plugin.web.api.baseconditions.BaseCondition, com.atlassian.plugin.web.Condition, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean

public class IsUpgradeInProgressCondition extends AbstractWebCondition implements org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
This condition returns true when an upgrade is in progress.

The implementation is optimized so that the ClusterUpgradeStateManager is not queried every time, instead it keeps the state internal and reacts to JiraUpgradeStartedEvent, JiraUpgradeCancelledEvent and JiraUpgradeFinishedEvent to keep it up to date.
  • Constructor Details

  • Method Details

    • init

      public void init(Map<String,String> params) throws com.atlassian.plugin.PluginParseException
      Specified by:
      init in interface com.atlassian.plugin.web.Condition
      Overrides:
      init in class AbstractWebCondition
      Throws:
      com.atlassian.plugin.PluginParseException
    • shouldDisplay

      public boolean shouldDisplay(ApplicationUser applicationUser, JiraHelper jiraHelper)
      Specified by:
      shouldDisplay in class AbstractWebCondition
    • onUpgradeStarted

      @EventListener public void onUpgradeStarted(JiraUpgradeStartedEvent event)
    • onUpgradeFinished

      @EventListener public void onUpgradeFinished(JiraUpgradeFinishedEvent event)
    • onUpgradeCancelled

      public void onUpgradeCancelled(JiraUpgradeCancelledEvent event)
    • destroy

      public void destroy() throws Exception
      Specified by:
      destroy in interface org.springframework.beans.factory.DisposableBean
      Throws:
      Exception
    • afterPropertiesSet

      public void afterPropertiesSet() throws Exception
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Throws:
      Exception