Class UpdateLicenseAction

java.lang.Object
com.opensymphony.xwork2.ActionSupport
All Implemented Interfaces:
JsonStreamingAction, ErrorCollection, BambooSessionAware, NavigationAware, DomainObjectSecurityAware, GlobalBypassSecurityAware, GlobalReadSecurityAware, ReturnUrlAware, com.atlassian.config.internal.SetupConstants, com.atlassian.core.i18n.I18nTextProvider, com.atlassian.struts.TextProvider, com.atlassian.struts.ValidationAware, com.opensymphony.xwork.ValidationAware, com.opensymphony.xwork2.Action, com.opensymphony.xwork2.interceptor.ValidationAware, com.opensymphony.xwork2.LocaleProvider, com.opensymphony.xwork2.TextProvider, com.opensymphony.xwork2.Validateable, Serializable
Direct Known Subclasses:
AdminUpdateLicenseAction, SetupUpdateLicenseAction

public class UpdateLicenseAction extends AbstractSetupAction implements GlobalBypassSecurityAware
This class may be accessed with the context not set up. Dependencies may not be set up.
Class is not intended to be used directly, but can't be abstract due to being used updateLicense.ftl
See Also:
  • Field Details

  • Constructor Details

    • UpdateLicenseAction

      public UpdateLicenseAction()
  • Method Details

    • getLicense

      public com.atlassian.extras.api.bamboo.BambooLicense getLicense()
    • getSid

      public String getSid()
    • isSupportPeriodExpired

      public boolean isSupportPeriodExpired()
    • isSupportPeriodAlmostExpired

      public boolean isSupportPeriodAlmostExpired()
    • isOldLicenseWithNewInstall

      public boolean isOldLicenseWithNewInstall()
    • isEvaluationLicense

      public boolean isEvaluationLicense()
    • getAllowedNumberOfRemoteAgents

      public int getAllowedNumberOfRemoteAgents()
    • getAllowedNumberOfRemoteAgents

      public int getAllowedNumberOfRemoteAgents(com.atlassian.extras.api.bamboo.BambooLicense license)
    • getAllowedNumberOfPlans

      public int getAllowedNumberOfPlans()
    • isDataCenter

      public boolean isDataCenter()
    • getSupportEntitlementNumber

      @Nullable public @Nullable String getSupportEntitlementNumber(com.atlassian.extras.api.bamboo.BambooLicense license)
    • getVersionInfo

      public String getVersionInfo()
    • validate

      public void validate()
      Validates the license string provided by the user. This method checks if the license string is empty or invalid. Additionally, it verifies if the current number of plans exceeds the allowed number of plans as per the new license.
      Specified by:
      validate in interface com.opensymphony.xwork2.Validateable
      Overrides:
      validate in class com.opensymphony.xwork2.ActionSupport
    • execute

      public String execute() throws Exception
      Executes the action to update the license.

      This method performs the following tasks:

      • Updates the license using the provided license string.
      • Reinitialize the elastic support if necessary.
      • Sends a license updated event if there is a change in the license status (e.g., from Data Center to Server).
      • Checks if a restart is required due to the license update.
      • Checks and handles build suspension status post-license update.
      • Logs the license changes for audit purposes.
      Specified by:
      execute in interface com.opensymphony.xwork2.Action
      Overrides:
      execute in class com.opensymphony.xwork2.ActionSupport
      Returns:
      a string indicating the result of the action, typically "SUCCESS".
      Throws:
      Exception - if an error occurs during license update.
    • getBambooLicenseManager

      public BambooLicenseManager getBambooLicenseManager()
      Overrides:
      getBambooLicenseManager in class BambooActionSupport
    • setBambooLicenseManager

      public void setBambooLicenseManager(BambooLicenseManager bambooLicenseManager)
      Overrides:
      setBambooLicenseManager in class BambooActionSupport
    • setBuildSuspensionCheckBean

      public void setBuildSuspensionCheckBean(@Nullable @Nullable BuildSuspensionCheckBean buildSuspensionCheckBean)
    • getLicenseString

      public String getLicenseString()
    • setLicenseString

      public void setLicenseString(String licenseString)
    • getVersion

      public String getVersion()
    • setElasticFunctionalityFacade

      public void setElasticFunctionalityFacade(ElasticFunctionalityFacade elasticFunctionalityFacade)
    • setAuditLogService

      public void setAuditLogService(AuditLogService auditLogService)