com.atlassian.confluence.upgrade
Class AbstractUpgradeTask

java.lang.Object
  extended by com.atlassian.confluence.upgrade.AbstractUpgradeTask
All Implemented Interfaces:
BackupSupport, UpgradeTask, UpgradeTaskInfo, org.springframework.beans.factory.BeanNameAware
Direct Known Subclasses:
AbstractConstraintCreationUpgradeTask, AbstractDeferredRunUpgradeTask, AbstractUserMappingUpgradeTask, AddSpaceStatusColumnUpgradeTask, AddUniqueAttachmentIdConstraintToAttachmentDataUpgradeTask, AtlassianUserToEmbeddedCrowdConfigurationUpgradeTask, AttachmentLabellingUpgradeTask, BandanaKeyUniqueConstraintUpgradeTask, ContentParentTypeFixingUpgradeTask, ContentPermissionConstraintsUpgradeTask, ContentPermissionUserDeduplicationUpgradeTask, CorrectPNGImageAttachmentMimeTypeUpgradeTask, DefaultSpaceContentPageLayoutsUpgradeTask, DeleteDidYouMeanIndexFolderUpgradeTask, DropContentLockTableUpgradeTask, EhCacheConfigMigrationUpgradeTask, EmbeddedCrowdInitUpgradeTask, EmbeddedCrowdPropertySetFactoryMigrationUpgradeTask, EmbeddedCrowdSynchronisationUpgradeTask, InstallationDateUpgradeTask, LikesDanglingFKCleanupUpgradeTask, LoginInfoDuplicateEntryRemovalUpgradeTask, LowerCaseUsernameReferencesUpgradeTask, MailConvertToCustomContentUpgradeTask, MailServerUpgradeTask, MigrateMailArchiveConfigurationUpgradeTask, MigrateOndemandDocThemeCustomizations, MinorEditAttachmentsUpgradeTask, NewColourUpgradeTask, NotificationPageColumnUpgradeTask, OnDemandSpacePermissionsDefaultUpgradeTask, PersonalSpaceCreatorCheckUpgradeTask, RemoveEmailToPageWelcomeUpgradeTask, RemoveFixedWidthThemeUpgradeTask, RemoveRemoteAppsPluginUpgradeTask, SetAttachmentStorageSettingForClustersUpgradeTask, UserIndexingUpgradeTask, UserKeyReferenceUpgradeTask, UserMappingLowerUsernameSchemaUpgradeTask, UserMappingSchemaUpgradeTask

public abstract class AbstractUpgradeTask
extends java.lang.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.


Field Summary
 
Fields inherited from interface com.atlassian.confluence.upgrade.UpgradeTask
log
 
Constructor Summary
AbstractUpgradeTask()
           
 
Method Summary
protected  void addAllErrors(java.util.Collection<UpgradeError> errors)
           
protected  void addError(java.lang.String errorMessage)
           
protected  void addError(UpgradeError error)
           
 java.lang.String getBuildNumber()
           
 BuildNumberUpgradeConstraint getConstraint()
           
 java.util.Collection<UpgradeError> getErrors()
          Return any errors that occur.
 java.lang.String getName()
          The human-readable name of the upgrade task
 java.lang.String getShortDescription()
          A short (<50 chars) description of the upgrade action
 boolean isDatabaseUpgrade()
           
 void setBeanName(java.lang.String name)
           
 void setBuildNumber(java.lang.String buildNumber)
           
 void validate()
           This is only implemented in this abstract base class for the convenience of the large number of older upgrade tasks.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.confluence.upgrade.UpgradeTask
doUpgrade
 
Methods inherited from interface com.atlassian.confluence.upgrade.BackupSupport
breaksBackwardCompatibility, runOnSpaceImport
 

Constructor Detail

AbstractUpgradeTask

public AbstractUpgradeTask()
Method Detail

getShortDescription

public java.lang.String getShortDescription()
Description copied from interface: UpgradeTaskInfo
A short (<50 chars) description of the upgrade action

Specified by:
getShortDescription in interface UpgradeTaskInfo

addError

protected void addError(UpgradeError error)

addError

protected void addError(java.lang.String errorMessage)

addAllErrors

protected void addAllErrors(java.util.Collection<UpgradeError> errors)

getErrors

public java.util.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(java.lang.String buildNumber)

getBuildNumber

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

validate

public void validate()
              throws java.lang.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:
java.lang.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(java.lang.String name)
Specified by:
setBeanName in interface org.springframework.beans.factory.BeanNameAware

getName

public java.lang.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


Copyright © 2003-2014 Atlassian. All Rights Reserved.