Class UpdateLicenseAction
java.lang.Object
org.apache.struts2.ActionSupport
com.atlassian.bamboo.ww2.BambooActionSupport
com.atlassian.bamboo.ww2.actions.setup.AbstractSetupAction
com.atlassian.bamboo.ww2.actions.admin.UpdateLicenseAction
- All Implemented Interfaces:
JsonStreamingAction,ErrorCollection,BambooSessionAware,NavigationAware,DomainObjectSecurityAware,GlobalBypassSecurityAware,GlobalReadSecurityAware,ReturnUrlAware,UserAware,com.atlassian.config.internal.SetupConstants,com.atlassian.core.i18n.I18nTextProvider,Serializable,org.apache.struts2.action.Action,org.apache.struts2.interceptor.ValidationAware,org.apache.struts2.locale.LocaleProvider,org.apache.struts2.text.TextProvider,org.apache.struts2.Validateable
- Direct Known Subclasses:
AdminUpdateLicenseAction,SetupUpdateLicenseAction
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
Class is not intended to be used directly, but can't be abstract due to being used updateLicense.ftl
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.atlassian.bamboo.ww2.BambooActionSupport
BambooActionSupport.JSONStatus -
Field Summary
FieldsFields inherited from class com.atlassian.bamboo.ww2.BambooActionSupport
ACCESS_DENIED, administrationConfigurationAccessor, administrationConfigurationManager, administrationConfigurationPersister, AGGREGATE_URL_PATTERN, authenticationContext, bambooPermissionManager, bambooUserManager, BUILD_KEY_CONTEXT, buildDefinitionManager, cachedPlanManager, CONFIRM, cookieCutter, deploymentProjectService, featureManager, PAGE_NOT_FOUND, PLAN_KEY_CONTEXT, planExecutionManager, planManager, pluginAccessor, projectManager, webInterfaceManagerFields inherited from class org.apache.struts2.ActionSupport
containerFields inherited from interface org.apache.struts2.action.Action
ERROR, INPUT, LOGIN, NONE, SUCCESSFields inherited from interface com.atlassian.config.internal.SetupConstants
SETUP_CONTENT_BLANK, SETUP_CONTENT_DEMO, SETUP_CONTENT_IMPORT, SETUP_CUSTOM, SETUP_DB_CONN_TYPE, SETUP_DB_DATASOURCE, SETUP_DB_EMBEDDED, SETUP_DB_OTHER, SETUP_DB_STANDARD, SETUP_DB_TYPE_DATASOURCE, SETUP_DB_TYPE_EMBEDDED, SETUP_DB_TYPE_STANDARD, SETUP_QUICK -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexecute()Executes the action to update the license.intintintgetAllowedNumberOfRemoteAgents(com.atlassian.extras.api.bamboo.BambooLicense license) com.atlassian.extras.api.bamboo.BambooLicensegetSid()@Nullable String@Nullable StringgetSupportEntitlementNumber(com.atlassian.extras.api.bamboo.BambooLicense license) booleanbooleanbooleanbooleanbooleanvoidsetAuditLogService(AuditLogService auditLogService) voidsetBambooLicenseManager(BambooLicenseManager bambooLicenseManager) voidsetBuildSuspensionCheckBean(@Nullable BuildSuspensionCheckBean buildSuspensionCheckBean) voidsetElasticFunctionalityFacade(ElasticFunctionalityFacade elasticFunctionalityFacade) voidsetLicenseString(String licenseString) voidvalidate()Validates the license string provided by the user.Methods inherited from class com.atlassian.bamboo.ww2.actions.setup.AbstractSetupAction
getSetupPersister, getSetupTypeInstall, getSetupUtilityBean, setSetupPersister, setSetupTypeInstallMethods inherited from class com.atlassian.bamboo.ww2.BambooActionSupport
addActionError, addActionError, addActionWarning, addError, addError, addErrorCollection, addErrorMessage, addErrorMessage, addErrorMessages, addFieldErrors, addHelpPanel, addIllegalArgumentException, areCheckBoxesEmpty, buildJsonObject, buildWebPanelContext, canRunBuild, checkFieldXssSafety, createFieldValidator, doDefault, doesHelpLinkHaveMatchingTitle, doesLabelKeyHaveMatchingDescription, doExecute, doInput, forceRelativeReturnUrl, getActionErrors, getActionWarnings, getAdministrationConfiguration, getAvailableCategoryJson, getBambooContainer, getBambooPermissionManager, getBambooSession, getBambooUrl, getBambooUserManager, getBaseUrl, getBestBaseUrl, getBootstrapManager, getBreadCrumbs, getChainEquiv, getCheckBoxFields, getConcurrentBuildExecutionStrategyOptions, getConcurrentBuildsEnabled, getConglomerateCookieValue, getCookieCutter, getCookieValue, getCurrentFormTheme, getCurrentSystemTime, getCurrentUrl, getDecorator, getDefaultPersister, getDescriptionFromLabelKey, getElasticConfig, getErrorMessages, getErrors, getFeatureManager, getFieldErrorAccessTracker, getFieldErrors, getFormattedActionErrors, getFormattedActionMessages, getFormattedActionWarnings, getHelpPanels, getInstanceName, getJobEquiv, getJsonObject, getNavigationContext, getNavigationUrl, getNodeLifecycleState, getNumberOfCurrentlyBuildingPlans, getPlan, getPlanManager, getPluginAccessor, getRandomString, getReturnUrl, getSecuredDomainObject, getSessionUser, getText, getText, getText, getText, getText, getText, getText, getText, getText, getText, getTextProvider, getTexts, getTexts, getTextWithArgs, getTotalErrors, getUser, getValidatorContext, getWebFragmentsContextMap, getWebItemsForSection, getWebPanelContext, getWebSectionsForLocation, hasActionWarnings, hasAdminPermission, hasAnyErrors, hasBuilds, hasEntityPermission, hasGlobalAdminPermission, hasGlobalPermission, hasGlobalPermission, hasKey, hasPlanPermission, hasPlanPermission, hasProjectPermission, hasProjectPermission, hasRestrictedAdminPermission, hasResultKeyReadPermission, isCheckboxSetInAction, isEnableJavascript, isEnableSignup, isInlineDialog, isRestrictedAdminEnabled, isSelectFieldAndNull, isViewContactDetailsEnabled, renderFreemarkerTemplate, setAdministrationConfigurationAccessor, setAdministrationConfigurationManager, setAdministrationConfigurationPersister, setAuthenticationContext, setBambooPermissionManager, setBambooUserManager, setBuildDefinitionManager, setCachedEnvironmentService, setCachedPlanManager, setChainEquiv, setCheckBoxFields, setCookieCutter, setCurrentFormTheme, setDecorator, setDeploymentProjectService, setDocumentationLinkProvider, setEnableJavascript, setErrorMessages, setFeatureManager, setI18nBeanFactory, setJobEquiv, setJsonator, setLocalizedTextProvider, setNavigationContext, setNodeLifecycleProvider, setPlanExecutionManager, setPlanManager, setPluginAccessor, setProfile, setProjectManager, setReturnUrl, setWebInterfaceManager, streamJson, toJson, toJsonMethods inherited from class org.apache.struts2.ActionSupport
addActionMessage, addFieldError, clearActionErrors, clearErrors, clearErrorsAndMessages, clearFieldErrors, clearMessages, clone, getActionMessages, getContainer, getFormatted, getLocale, getLocaleProvider, hasActionErrors, hasActionMessages, hasErrors, hasFieldErrors, input, isValidLocale, isValidLocaleString, pause, setActionErrors, setActionMessages, setContainer, setFieldErrors, toLocaleMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.bamboo.ww2.aware.permissions.DomainObjectSecurityAware
getSecuredDomainObjectMethods inherited from interface com.atlassian.bamboo.utils.error.ErrorCollection
getAllErrorMessagesMethods inherited from interface org.apache.struts2.interceptor.ValidationAware
addActionMessage, addFieldError, getActionMessages, hasActionErrors, hasActionMessages, hasErrors, hasFieldErrors, setActionErrors, setActionMessages, setFieldErrors
-
Field Details
-
ALMOST_EXPIRED_PERIOD
public static final long ALMOST_EXPIRED_PERIOD- See Also:
-
-
Constructor Details
-
UpdateLicenseAction
public UpdateLicenseAction()
-
-
Method Details
-
getLicense
public com.atlassian.extras.api.bamboo.BambooLicense getLicense() -
getSid
-
getSupportPeriodEnd
-
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
-
getSupportEntitlementNumber
@Nullable public @Nullable String getSupportEntitlementNumber(com.atlassian.extras.api.bamboo.BambooLicense license) -
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:
validatein interfaceorg.apache.struts2.Validateable- Overrides:
validatein classorg.apache.struts2.ActionSupport
-
execute
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:
executein interfaceorg.apache.struts2.action.Action- Overrides:
executein classorg.apache.struts2.ActionSupport- Returns:
- a string indicating the result of the action, typically "SUCCESS".
- Throws:
Exception- if an error occurs during license update.
-
getBambooLicenseManager
- Overrides:
getBambooLicenseManagerin classBambooActionSupport
-
setBambooLicenseManager
- Overrides:
setBambooLicenseManagerin classBambooActionSupport
-
setBuildSuspensionCheckBean
public void setBuildSuspensionCheckBean(@Nullable @Nullable BuildSuspensionCheckBean buildSuspensionCheckBean) -
getLicenseString
-
setLicenseString
-
getVersion
-
setElasticFunctionalityFacade
-
setAuditLogService
-