com.philemonworks.selfdiagnose.check
Class CheckDatabaseTableExists
java.lang.Object
com.philemonworks.selfdiagnose.DiagnosticTask
com.philemonworks.selfdiagnose.check.CheckDatabaseTableExists
- All Implemented Interfaces:
- Serializable
public class CheckDatabaseTableExists
- extends DiagnosticTask
CheckDatabaseTableExists is a DiagnosticTask that verifies whether a database
schema has a definition for a table. This task requires a datasource.
On default, yt uses the basic COUNT(*) query to detect table presence.
If found then the number of records is reported.
<checkdatabasetableexists name="BUZ.CUSTOMERS" datasource="BusinessDs" />
If the count(*) implies a heavy load then alternatively you can specifiy a different query name.
Possible values are: IN_ALL_TABLES (Oracle), FETCH_FIRST (ANSI), COUNT (default)
<checkdatabasetableexists name="BUZ.CUSTOMERS" datasource="BusinessDs" queryname="IN_ALL_TABLES" />
- Author:
- ernest.mickei@philemonworks.com
- See Also:
- Serialized Form
Methods inherited from class com.philemonworks.selfdiagnose.DiagnosticTask |
createResult, getComment, getDefaultReportTemplate, getRequestor, getTaskName, getVariableName, hasComment, isReportResults, run, run, setComment, setReportResults, setRequestor, setVariableName |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CheckDatabaseTableExists
public CheckDatabaseTableExists()
getDescription
public String getDescription()
- Return the description of this task.
- Specified by:
getDescription
in class DiagnosticTask
- Returns:
- String the description
setUp
public void setUp(ExecutionContext ctx)
throws DiagnoseException
- Description copied from class:
DiagnosticTask
- Override this method to verify that task parameters are initialized/set correctly.
- Overrides:
setUp
in class DiagnosticTask
- Parameters:
ctx
- ExecutionContext
- Throws:
DiagnoseException
run
public void run(ExecutionContext ctx,
DiagnosticTaskResult result)
throws DiagnoseException
- Description copied from class:
DiagnosticTask
- Run the task. If an error is detected then raise a DiagnoseException.
Otherwise use the result object to the report any messages when a run is completed.
- Specified by:
run
in class DiagnosticTask
- Parameters:
ctx
- ExecutionContextresult
- DiagnosticTaskResult
- Throws:
DiagnoseException
initializeFromAttributes
public void initializeFromAttributes(Attributes attributes)
- Description copied from class:
DiagnosticTask
- This method is sent from the SelfDiagnoseHandler when a configuration is being processed. Use the passed
attributes to initialize the receiver.
If a variable parameter is passed then store it.
- Overrides:
initializeFromAttributes
in class DiagnosticTask
- Parameters:
attributes
- org.xml.sax.Attributes
getQuery
public String getQuery()
getDatasource
public String getDatasource()
setDatasource
public void setDatasource(String datasource)
getTableName
public String getTableName()
setTableName
public void setTableName(String tableName)
getQueryTemplate
public String getQueryTemplate()
setQueryTemplate
public void setQueryTemplate(String queryTemplate)
Copyright © 2012. All Rights Reserved.