com.atlassian.bamboo.upgrade.tasks
Class AbstractStatementUpgradeTask

java.lang.Object
  extended by com.atlassian.bamboo.upgrade.AbstractUpgradeTask
      extended by com.atlassian.bamboo.upgrade.tasks.AbstractInHibernateTransactionUpgradeTask
          extended by com.atlassian.bamboo.upgrade.tasks.AbstractStatementUpgradeTask
All Implemented Interfaces:
HibernateUpgradeTask, UpgradeTask
Direct Known Subclasses:
UpgradeTask2210AddSystemLinkTypeToArtifactLinks, UpgradeTask2505InitAuditLogEntityType, UpgradeTask2507ConvertTrustedAppsPublicKeyToClob, UpgradeTask2508DropRevisionKeyColumnInBuild, UpgradeTask2513InitializeProcessingDuration, UpgradeTask2902SetDefaultQuarantinedTestsCount, UpgradeTask3007ChangeJiraIssueLinksFromFixed2Related, UpgradeTask3609LinkDeploymentVersionsToArtifacts, UpgradeTask3610DetachCommentsFromResultSummaries

public abstract class AbstractStatementUpgradeTask
extends AbstractInHibernateTransactionUpgradeTask

A base upgrade task for SQL to be run on a series of Statement


Field Summary
 
Fields inherited from class com.atlassian.bamboo.upgrade.AbstractUpgradeTask
errors
 
Constructor Summary
protected AbstractStatementUpgradeTask(java.lang.String buildNumber, java.lang.String shortDescription)
           
 
Method Summary
 void doUpgrade(java.sql.Connection connection)
           
protected abstract  java.util.List<java.lang.String> getSqlStatements()
          A list of SQL statements to be run in order.
protected abstract  boolean isShouldRunUpgrade(java.sql.Statement statement)
          Whether or not the upgrade task should actually run
 
Methods inherited from class com.atlassian.bamboo.upgrade.tasks.AbstractInHibernateTransactionUpgradeTask
doUpgrade, setBambooConnectionTemplate
 
Methods inherited from class com.atlassian.bamboo.upgrade.AbstractUpgradeTask
getBuildNumber, getErrors, getShortDescription
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.bamboo.upgrade.UpgradeTask
getBuildNumber, getErrors, getShortDescription
 

Constructor Detail

AbstractStatementUpgradeTask

protected AbstractStatementUpgradeTask(@NotNull
                                       java.lang.String buildNumber,
                                       @NotNull
                                       java.lang.String shortDescription)
Method Detail

doUpgrade

public void doUpgrade(@NotNull
                      java.sql.Connection connection)
               throws java.sql.SQLException
Specified by:
doUpgrade in class AbstractInHibernateTransactionUpgradeTask
Throws:
java.sql.SQLException

isShouldRunUpgrade

protected abstract boolean isShouldRunUpgrade(@NotNull
                                              java.sql.Statement statement)
                                       throws java.sql.SQLException
Whether or not the upgrade task should actually run

Parameters:
statement -
Returns:
Throws:
java.sql.SQLException

getSqlStatements

@NotNull
protected abstract java.util.List<java.lang.String> getSqlStatements()
A list of SQL statements to be run in order. Execution will stop after first failed statement

Returns:


Copyright © 2013 Atlassian Software Systems Pty Ltd. All Rights Reserved.