|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectit.openutils.migration.task.setup.BaseDbTask
it.openutils.migration.task.setup.BaseConditionalTask
public abstract class BaseConditionalTask
A base conditional task that executes a task only if an expected condition is met.
| Field Summary | |
|---|---|
protected java.lang.String |
ddl
DDL to run when the condition is met. |
protected org.slf4j.Logger |
log
Logger. |
protected boolean |
not
If true executes only if check returned false |
protected java.util.List<org.springframework.core.io.Resource> |
scripts
Script list to execute |
protected java.util.Map<java.lang.String,java.lang.String> |
variables
Map of key-value that will be replaced in ddl. |
| Fields inherited from class it.openutils.migration.task.setup.BaseDbTask |
|---|
description |
| Constructor Summary | |
|---|---|
BaseConditionalTask()
|
|
| Method Summary | |
|---|---|
abstract boolean |
check(org.springframework.jdbc.core.simple.SimpleJdbcTemplate jdbcTemplate)
Subclasses need to override this method and provide specific checks. |
void |
execute(javax.sql.DataSource dataSource)
Execute this db task. |
java.lang.String |
getDescription()
Returns a description for this task |
protected java.lang.String |
objectNameFromFileName(org.springframework.core.io.Resource script)
|
protected java.lang.String |
performSubstitution(java.lang.String string)
Perform sobstitution in the given string. |
void |
setDdl(java.lang.String ddls)
|
void |
setDdlScript(org.springframework.core.io.Resource ddlScript)
Deprecated. use the "scripts" property |
void |
setNot(boolean not)
Sets the not. |
void |
setScripts(java.util.List<org.springframework.core.io.Resource> scripts)
Sets the scripts. |
| Methods inherited from class it.openutils.migration.task.setup.BaseDbTask |
|---|
setDescription |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected org.slf4j.Logger log
protected java.lang.String ddl
protected boolean not
true executes only if check returned false
protected java.util.Map<java.lang.String,java.lang.String> variables
protected java.util.List<org.springframework.core.io.Resource> scripts
| Constructor Detail |
|---|
public BaseConditionalTask()
| Method Detail |
|---|
public void setScripts(java.util.List<org.springframework.core.io.Resource> scripts)
scripts - the scripts to setpublic final void setDdl(java.lang.String ddls)
public final void setNot(boolean not)
not - the not to set@Deprecated public final void setDdlScript(org.springframework.core.io.Resource ddlScript)
ddlScript - the ddlScript to setpublic abstract boolean check(org.springframework.jdbc.core.simple.SimpleJdbcTemplate jdbcTemplate)
jdbcTemplate - SimpleJdbcTemplate
public java.lang.String getDescription()
getDescription in interface DbTaskgetDescription in class BaseDbTaskprotected java.lang.String objectNameFromFileName(org.springframework.core.io.Resource script)
script - The script resource
protected java.lang.String performSubstitution(java.lang.String string)
string - Original String
public void execute(javax.sql.DataSource dataSource)
dataSource - javax.sql.datasource
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||