Package adams.db
Class AbstractTableCleanUp
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.db.AbstractTableCleanUp
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,SizeOfHandler
,DatabaseConnectionHandler
,DatabaseConnectionProvider
,DatabaseConnectionUser
,Serializable
- Direct Known Subclasses:
AbstractTimeWindowTableCleanUp
,SQLTableCleanUp
public abstract class AbstractTableCleanUp extends AbstractOptionHandler implements DatabaseConnectionHandler
Ancestor of classes that clean up tables in some fashion.- 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_Connection
database connection.-
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 AbstractTableCleanUp()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected String
check()
Performs checks before cleaning up the table.String
cleanUpTable()
Cleans up the table.protected abstract String
doCleanUpTable()
Performs the actual clean up.AbstractDatabaseConnection
getDatabaseConnection()
Returns the current database connection.void
setDatabaseConnection(AbstractDatabaseConnection value)
Sets the database connection to use.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, defineOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, initialize, 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, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
m_Connection
protected transient AbstractDatabaseConnection m_Connection
database connection.
-
-
Method Detail
-
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
-
check
protected String check()
Performs checks before cleaning up the table.
Default implementation only checks if connected to database- Returns:
- null if checks successful, otherwise error message
-
doCleanUpTable
protected abstract String doCleanUpTable()
Performs the actual clean up.- Returns:
- null if successfully cleaned up, otherwise error message
-
cleanUpTable
public String cleanUpTable()
Cleans up the table.- Returns:
- null if successfully cleaned up, otherwise error message
-
-