Package adams.tools
Class AbstractDatabaseTool
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.tools.AbstractTool
-
- adams.tools.AbstractDatabaseTool
-
- All Implemented Interfaces:
CleanUpHandler
,Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,SizeOfHandler
,Stoppable
,StoppableWithFeedback
,DatabaseConnectionHandler
,DatabaseConnectionProvider
,DatabaseConnectionUser
,Serializable
,Comparable
- Direct Known Subclasses:
AbstractTimeWindowDatabaseTool
,DropTables
,InitializeTables
,TableUpgrade
,TruncateTables
public abstract class AbstractDatabaseTool extends AbstractTool implements DatabaseConnectionHandler
Abstract ancestor for tools that need database access.- Version:
- $Revision$
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected AbstractDatabaseConnection
m_dbc
database connection.-
Fields inherited from class adams.tools.AbstractTool
m_Stopped
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description AbstractDatabaseTool()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
cleanUp()
Cleans up data structures, frees up memory.AbstractDatabaseConnection
getDatabaseConnection()
Returns the current database connection.protected abstract AbstractDatabaseConnection
getDefaultDatabaseConnection()
Returns the default database connection.protected void
initialize()
initializes member variables.void
setDatabaseConnection(AbstractDatabaseConnection value)
Sets the database connection to use.-
Methods inherited from class adams.tools.AbstractTool
compareTo, destroy, doRun, equals, forCommandLine, forName, getTools, isStopped, postRun, preRun, run, runTool, stopExecution
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, defineOptions, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
m_dbc
protected transient AbstractDatabaseConnection m_dbc
database connection.
-
-
Method Detail
-
initialize
protected void initialize()
initializes member variables.- Overrides:
initialize
in classAbstractOptionHandler
-
getDefaultDatabaseConnection
protected abstract AbstractDatabaseConnection getDefaultDatabaseConnection()
Returns the default database connection.- Returns:
- the database connection
-
setDatabaseConnection
public void setDatabaseConnection(AbstractDatabaseConnection value)
Sets the database connection to use.- Specified by:
setDatabaseConnection
in interfaceDatabaseConnectionHandler
- Parameters:
value
- the database connection
-
getDatabaseConnection
public AbstractDatabaseConnection getDatabaseConnection()
Returns the current database connection.- Specified by:
getDatabaseConnection
in interfaceDatabaseConnectionProvider
- Returns:
- the database connection
-
cleanUp
public void cleanUp()
Cleans up data structures, frees up memory.- Specified by:
cleanUp
in interfaceCleanUpHandler
- Overrides:
cleanUp
in classAbstractTool
-
-