Class AbstractUpgradeTask

java.lang.Object
com.atlassian.confluence.upgrade.AbstractUpgradeTask
All Implemented Interfaces:
BackupSupport, UpgradeTask, UpgradeTaskInfo, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware
Direct Known Subclasses:
AbstractConstraintCreationUpgradeTask, AbstractDeferredRunUpgradeTask, BandanaComplexTypesUpgradeTask, BandanaToPluginSettingsUpgradeTask, DbTrueFalseTypeFixUpgradeTask, DecoratorLangMacroReplacementUpgradeTask, DenormalisedContentStatusUpgradeTask, DenormalisedPermissionsTriggersUpgradeTask, DropIncrementalSyncSubscriptionUpgradeTask, LabelUniqueIndexUpgradeTask, MigrateScheduledJobCacheUpgradeTask, MigrateTrashDateUpgradeTask, NullModificationDateDraftUpgradeTask, RenameTempDirPropertyUpgradeTask, ReplaceC3p0ConnectionPoolWithHikariCPUpgradeTask, ResetJournalStateUpgradeTask, SecureLocalConfigSecretsUpgradeTask, SecureMailServerSecretUpgradeTask, SecureSharedConfigSecretsUpgradeTask, SynchronyPidFileRemovalUpgradeTask, TurnFastPermissionsOnByDefaultUpgradeTask, UserDirectoryPasswordEncryptionUpgradeTask

public abstract class AbstractUpgradeTask extends Object implements UpgradeTask, BackupSupport, org.springframework.beans.factory.BeanNameAware
A useful base class for UpgradeTasks. Note that this base class has a default implementation of validate which does nothing. This is a common case but if you do need validation be sure to override it.
  • Constructor Details

    • AbstractUpgradeTask

      public AbstractUpgradeTask()
  • Method Details

    • getShortDescription

      public String getShortDescription()
      Description copied from interface: UpgradeTaskInfo
      A short (invalid input: '<'50 chars) description of the upgrade action
      Specified by:
      getShortDescription in interface UpgradeTaskInfo
    • addError

      protected void addError(UpgradeError error)
    • addError

      protected void addError(String errorMessage)
    • addAllErrors

      protected void addAllErrors(Collection<UpgradeError> errors)
    • getErrors

      public Collection<UpgradeError> getErrors()
      Description copied from interface: UpgradeTask
      Return any errors that occur. Each entry is an UpgradeError.
      Specified by:
      getErrors in interface UpgradeTask
      Returns:
      a collection of UpgradeError objects, sometimes null.
    • setBuildNumber

      public void setBuildNumber(String buildNumber)
    • getBuildNumber

      public String getBuildNumber()
      Specified by:
      getBuildNumber in interface UpgradeTaskInfo
      Returns:
      The build number that this upgrade is applicable to
    • validate

      public void validate() throws Exception

      This is only implemented in this abstract base class for the convenience of the large number of older upgrade tasks.

      If you are implementing a new UpgradeTask you must give some consideration to implementing validation as well.

      Specified by:
      validate in interface UpgradeTask
      Throws:
      Exception
    • getConstraint

      public BuildNumberUpgradeConstraint getConstraint()
      Specified by:
      getConstraint in interface UpgradeTask
      Returns:
      the constraint that must be passed for this task to be run.
    • setBeanName

      public void setBeanName(String name)
      Specified by:
      setBeanName in interface org.springframework.beans.factory.BeanNameAware
    • getName

      public String getName()
      Description copied from interface: UpgradeTaskInfo
      The human-readable name of the upgrade task
      Specified by:
      getName in interface UpgradeTaskInfo
    • isDatabaseUpgrade

      public boolean isDatabaseUpgrade()
      Specified by:
      isDatabaseUpgrade in interface UpgradeTaskInfo