com.massimo.tools.scriptrunner.unused
Class OracleFileCheckTask
java.lang.Object
com.massimo.tools.scriptrunner.AbstractTask
com.massimo.tools.scriptrunner.work.SQLTask
com.massimo.tools.scriptrunner.work.SQLFunctionTask
com.massimo.tools.scriptrunner.unused.OracleFileCheckTask
- All Implemented Interfaces:
- Task
public class OracleFileCheckTask
- extends SQLFunctionTask
Oracle specific task to check for the presence of a file.
Uses Oracle's DIRECTORY objects and a database function, f_file_exists(:directory, :file)
Fields inherited from class com.massimo.tools.scriptrunner.work.SQLTask |
BIND_END_DELIMITERS, bindNames, connection, dbType, run_id, SQL_CHECK_PREFIX_ORACLE, SQL_CHECK_PREFIX_POSTGRES, SQL_CHECK_SUFFIX_ORACLE, SQL_CHECK_SUFFIX_POSTGRES, SQL_NON_COMMENT_PATTERN, SQL_STMT_PATTERN_ORACLE, SQL_STMT_PATTERN_POSTGRES |
Methods inherited from class com.massimo.tools.scriptrunner.AbstractTask |
getBooleanProperty, getCurrentWorkingDirectory, getDefinition, getIntProperty, getName, getParent, getProperties, getStartProcessingRow, getText, getType, interrupt, isIgnoreableError, isIgnoreableError, isInterrupted, isLogProgress, postProcess, preProcess, process, resultCodeToString, substituteParameters, toString, validate, validateConnections, validateParameters |
ATTRIBUTE_DIRECTORY
public static final String ATTRIBUTE_DIRECTORY
- See Also:
- Constant Field Values
ATTRIBUTE_FILE
public static final String ATTRIBUTE_FILE
- See Also:
- Constant Field Values
SQL_FILE_EXISTS
protected static String SQL_FILE_EXISTS
OracleFileCheckTask
public OracleFileCheckTask(Task parent,
String type,
Element definition,
Map<String,String> connectionProperties)
throws Exception
- Parameters:
parent
- type
- definition
- connectionProperties
-
- Throws:
Exception
doValidate
protected int doValidate(ValidationContext context)
- Implement Task
Check whether this task should be able to run.
Implementations should check for the prescence of files,...
- Overrides:
doValidate
in class SQLTask
- Returns:
- O for success. Anything else is a failure.
getBindValues
protected Object[] getBindValues(List<String> ignoreBindNames)
- The bind variables are the database directory and the name of the file to check for.
- Overrides:
getBindValues
in class SQLFunctionTask
- Parameters:
ignoreBindNames
- List
- Returns:
- Array of bind variable values
- Throws:
IllegalArgumentException
- if directory or filename are empty
getLogger
protected org.apache.log4j.Logger getLogger()
- Description copied from class:
SQLFunctionTask
-
- Overrides:
getLogger
in class SQLFunctionTask
- Returns:
- Logger
- See Also:
AbstractTask.getLogger()
getSQLText
protected String getSQLText()
- Hard-coded SQL statement.
- Overrides:
getSQLText
in class SQLFunctionTask
- Returns:
- SQL function call, as a String
- See Also:
SQLTask.getSQLText()
validateBinds
protected final int validateBinds(ValidationContext context)
- Checks that bind variables in bindNames have values.
This validates that SQLTask.setBinds(PreparedStatement, List) will run.
- Overrides:
validateBinds
in class SQLTask
- Parameters:
context
-
- Returns:
- Task SUCCESS or ERROR