Class UpdateLicenseAction
java.lang.Object
com.opensymphony.xwork2.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
,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
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
Fields 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, webInterfaceManager
Fields inherited from class com.opensymphony.xwork2.ActionSupport
container
Fields inherited from interface com.opensymphony.xwork2.Action
ERROR, INPUT, LOGIN, NONE, SUCCESS
Fields 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
-
Method Summary
Modifier and TypeMethodDescriptionexecute()
Executes the action to update the license.int
int
int
getAllowedNumberOfRemoteAgents
(com.atlassian.extras.api.bamboo.BambooLicense license) com.atlassian.extras.api.bamboo.BambooLicense
getSid()
@Nullable String
getSupportEntitlementNumber
(com.atlassian.extras.api.bamboo.BambooLicense license) boolean
boolean
boolean
boolean
boolean
void
setAuditLogService
(AuditLogService auditLogService) void
setBambooLicenseManager
(BambooLicenseManager bambooLicenseManager) void
setBuildSuspensionCheckBean
(@Nullable BuildSuspensionCheckBean buildSuspensionCheckBean) void
setElasticFunctionalityFacade
(ElasticFunctionalityFacade elasticFunctionalityFacade) void
setLicenseString
(String licenseString) void
validate()
Validates the license string provided by the user.Methods inherited from class com.atlassian.bamboo.ww2.actions.setup.AbstractSetupAction
getSetupPersister, getSetupTypeInstall, getSetupUtilityBean, setSetupPersister, setSetupTypeInstall
Methods inherited from class com.atlassian.bamboo.ww2.BambooActionSupport
addActionError, addActionError, addActionWarning, addError, addError, addErrorCollection, addErrorMessage, addErrorMessage, addErrorMessages, addErrors, addFieldErrors, addHelpPanel, addIllegalArgumentException, areCheckBoxesEmpty, buildJsonObject, buildWebPanelContext, canRunBuild, checkFieldXssSafety, createFieldValidator, doDefault, doesHelpLinkHaveMatchingTitle, doesLabelKeyHaveMatchingDescription, doExecute, doInput, forceRelativeReturnUrl, getActionWarnings, getAdministrationConfiguration, getAvailableCategoryJson, getBamboo, getBambooPermissionManager, getBambooSession, getBambooUrl, getBambooUserManager, getBaseUrl, getBestBaseUrl, getBootstrapManager, getBreadCrumbs, getChainEquiv, getConcurrentBuildExecutionStrategyOptions, getConcurrentBuildsEnabled, getConglomerateCookieValue, getCookieCutter, getCookieValue, getCurrentFormTheme, getCurrentSystemTime, getCurrentUrl, getDefaultPersister, getDescriptionFromLabelKey, getElasticConfig, getErrorMessages, getErrors, getFeatureManager, getFieldErrorAccessTracker, getFieldErrors, getFlushedErrorMessages, 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, 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, setCachedPlanManager, setChainEquiv, setCheckBoxFields, setCookieCutter, setCurrentFormTheme, setDecorator, setDeploymentProjectService, setDocumentationLinkProvider, setEnableJavascript, setEnvironmentService, setErrorMessages, setFeatureManager, setI18nBeanFactory, setJobEquiv, setJsonator, setLocalizedTextProvider, setNavigationContext, setNodeLifecycleProvider, setPlanExecutionManager, setPlanManager, setPluginAccessor, setProfile, setProjectManager, setReturnUrl, setWebInterfaceManager, streamJson, toJson, toJson
Methods inherited from class com.opensymphony.xwork2.ActionSupport
addActionMessage, addFieldError, clearActionErrors, clearErrors, clearErrorsAndMessages, clearFieldErrors, clearMessages, clone, getActionErrors, getActionMessages, getContainer, getFormatted, getLocale, getLocaleProvider, hasActionErrors, hasActionMessages, hasErrors, hasFieldErrors, input, isValidLocale, isValidLocaleString, pause, setActionErrors, setActionMessages, setContainer, setFieldErrors
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.atlassian.bamboo.ww2.aware.permissions.DomainObjectSecurityAware
getSecuredDomainObject
Methods inherited from interface com.atlassian.bamboo.utils.error.ErrorCollection
getAllErrorMessages
Methods inherited from interface com.opensymphony.xwork2.interceptor.ValidationAware
addActionMessage, addFieldError, getActionErrors, 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
-
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
-
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 interfacecom.opensymphony.xwork2.Validateable
- Overrides:
validate
in classcom.opensymphony.xwork2.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:
execute
in interfacecom.opensymphony.xwork2.Action
- Overrides:
execute
in classcom.opensymphony.xwork2.ActionSupport
- Returns:
- a string indicating the result of the action, typically "SUCCESS".
- Throws:
Exception
- if an error occurs during license update.
-
getBambooLicenseManager
- Overrides:
getBambooLicenseManager
in classBambooActionSupport
-
setBambooLicenseManager
- Overrides:
setBambooLicenseManager
in classBambooActionSupport
-
setBuildSuspensionCheckBean
public void setBuildSuspensionCheckBean(@Nullable @Nullable BuildSuspensionCheckBean buildSuspensionCheckBean) -
getLicenseString
-
setLicenseString
-
getVersion
-
setElasticFunctionalityFacade
-
setAuditLogService
-