com.atlassian.confluence.upgrade
Class AbstractUpgradeTask

java.lang.Object
  extended by com.atlassian.confluence.upgrade.AbstractUpgradeTask
All Implemented Interfaces:
UpgradeTask
Direct Known Subclasses:
AbstractConstraintCreationUpgradeTask, AbstractDeferredRunUpgradeTask, AddSpaceStatusColumnUpgradeTask, AddUniqueAttachmentIdConstraintToAttachmentDataUpgradeTask, AtlassianUpgradeFollowersUpgradeTask, AtlassianUserToEmbeddedCrowdConfigurationUpgradeTask, AtlassianUserToEmbeddedCrowdDataUpgradeTask, AttachmentLabellingUpgradeTask, BandanaKeyUniqueConstraintUpgradeTask, BodyTypeUpgradeTask, BundleUserMacrosUpgradeTask, ChangeLogoStorageUpgradeTask, ClickrLeftNavMigrationUpgradeTask, ContentPermissionConstraintsUpgradeTask, CorrectAttachmentCreatorUpgradeTask, DefaultSpaceContentPageLayoutsUpgradeTask, DefaultSpaceContentUpgradeTask, DraftDataCleaningUpgradeTask, DropContentLockTableUpgradeTask, EmbeddedCrowdInitUpgradeTask, EmbeddedCrowdSynchronisationUpgradeTask, EnableAntiXssModeUpgradeTask, FollowFavouriteUpgradeTask, HierarchicalFileSystemAttachmentUpgradeTask, HsqlLockModeUpgradeTask, LoginInfoUpgradeTask, MailConvertToCustomContentUpgradeTask, MigrateMailArchiveConfigurationUpgradeTask, MoveBackupSettingsToDatabaseUpgradeTask, NetworkAndSiteNotificationTypesRestoreUpgradeTask, NetworkAndSiteNotificationTypesUpgradeTask, OnDemandSpacePermissionsDefaultUpgradeTask, OSUserToEmbeddedCrowdMigrationUpgradeTask, PersonalInformationRepairUpgradeTask, PurgeThumbnailsUpgradeTask, RebuildAncestorsUpgradeTask, RemoveAPRUpgradeTask, RemoveClassicThemeUpgradeTask, RemoveSocialBookmarkingPluginUpgradeTask, SmtpToJmxMailServerUpgradeTask, TinyMce3UpgradeTask, TrustedApplicationsCleanUpUpgradeTask, UserMacroConfigConversionUpgradeTask, UserMacroConfigFormatUpgradeTask, UserStatusPermissionUpgradeTask

public abstract class AbstractUpgradeTask
extends Object
implements UpgradeTask

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(Collection<UpgradeError> errors)
           
protected  void addError(String errorMessage)
           
protected  void addError(UpgradeError error)
           
 String getBuildNumber()
           
 BuildNumberUpgradeConstraint getConstraint()
           
 Collection<UpgradeError> getErrors()
          Return any errors that occur.
 String getShortDescription()
          A short (<50 chars) description of the upgrade action
 void setBuildNumber(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
 

Constructor Detail

AbstractUpgradeTask

public AbstractUpgradeTask()
Method Detail

getShortDescription

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

Specified by:
getShortDescription in interface UpgradeTask

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 UpgradeTask
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.


Copyright © 2003-2012 Atlassian. All Rights Reserved.