com.atlassian.bamboo.upgrade.tasks
Class AbstractPreparedStatementUpgradeTask

java.lang.Object
  extended by com.atlassian.bamboo.upgrade.tasks.AbstractPreparedStatementUpgradeTask
All Implemented Interfaces:
UpgradeTask
Direct Known Subclasses:
UpgradeTask1307SetDefaultElasticImageConfiguration, UpgradeTask1309DefaultEnabledForElasticSchedule

public abstract class AbstractPreparedStatementUpgradeTask
extends java.lang.Object
implements UpgradeTask

A base upgrade task for simple single PreparedStatement upgrades


Constructor Summary
AbstractPreparedStatementUpgradeTask()
           
 
Method Summary
 void doUpgrade()
          Perform the upgrade.
 java.util.Collection<java.lang.String> getErrors()
          Return any errors that occur.
protected abstract  java.lang.String getPreparedStatementSql()
          Returns the SQL that will be used to init a PreparedStatement
protected abstract  boolean isShouldRunUpgrade(java.sql.Statement statement)
          Whether or not the upgrade task should actually run
protected abstract  void prepareStatement(java.sql.PreparedStatement statement)
          Sets the various values in a PreparedStatement
 void setBambooConnectionTemplate(BambooConnectionTemplate bambooConnectionTemplate)
           
 
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, getShortDescription
 

Constructor Detail

AbstractPreparedStatementUpgradeTask

public AbstractPreparedStatementUpgradeTask()
Method Detail

doUpgrade

public void doUpgrade()
               throws java.lang.Exception
Description copied from interface: UpgradeTask
Perform the upgrade.

Specified by:
doUpgrade in interface UpgradeTask
Throws:
java.lang.Exception

getErrors

public java.util.Collection<java.lang.String> getErrors()
Description copied from interface: UpgradeTask
Return any errors that occur. Each entry is a string.

Specified by:
getErrors in interface UpgradeTask

getPreparedStatementSql

protected abstract java.lang.String getPreparedStatementSql()
Returns the SQL that will be used to init a PreparedStatement

Returns:

prepareStatement

protected abstract void prepareStatement(java.sql.PreparedStatement statement)
                                  throws java.sql.SQLException
Sets the various values in a PreparedStatement

Parameters:
statement -
Throws:
java.sql.SQLException

isShouldRunUpgrade

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

Parameters:
statement -
Returns:

setBambooConnectionTemplate

public void setBambooConnectionTemplate(BambooConnectionTemplate bambooConnectionTemplate)


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.