Package adams.flow.condition.bool
Class AbstractBooleanDatabaseCondition
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.condition.bool.AbstractBooleanCondition
-
- adams.flow.condition.bool.AbstractBooleanDatabaseCondition
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,QuickInfoSupporter,ShallowCopySupporter<BooleanCondition>,SizeOfHandler,Stoppable,DatabaseConnectionHandler,DatabaseConnectionProvider,DatabaseConnectionUser,BooleanCondition,Serializable
- Direct Known Subclasses:
TableExists
public abstract class AbstractBooleanDatabaseCondition extends AbstractBooleanCondition implements DatabaseConnectionHandler
Ancestor for conditions that operate on a database.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected AbstractDatabaseConnectionm_DatabaseConnectionthe database connection in use.protected booleanm_DatabaseConnectionUpdatedwhether the DB connection has been updated.-
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 AbstractBooleanDatabaseCondition()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected AbstractDatabaseConnectiongetConnection(Actor actor)Returns the database connection from the flow.AbstractDatabaseConnectiongetDatabaseConnection()Returns the currently used database connection object, can be null.protected AbstractDatabaseConnectiongetDefaultDatabaseConnection()Returns the default database connection to use.protected voidinitialize()Initializes the members.protected StringpreEvaluate(Actor owner, Token token)Uses the token to determine the evaluation.protected voidreset()Resets the scheme.voidsetDatabaseConnection(AbstractDatabaseConnection value)Sets the database connection object to use.-
Methods inherited from class adams.flow.condition.bool.AbstractBooleanCondition
accepts, doEvaluate, evaluate, getQuickInfo, setUp, shallowCopy, shallowCopy, stopExecution
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, defineOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, loggingLevelTipText, newOptionManager, 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_DatabaseConnection
protected AbstractDatabaseConnection m_DatabaseConnection
the database connection in use.
-
m_DatabaseConnectionUpdated
protected boolean m_DatabaseConnectionUpdated
whether the DB connection has been updated.
-
-
Method Detail
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initializein classAbstractOptionHandler
-
reset
protected void reset()
Resets the scheme.- Overrides:
resetin classAbstractOptionHandler
-
getDefaultDatabaseConnection
protected AbstractDatabaseConnection getDefaultDatabaseConnection()
Returns the default database connection to use.- Returns:
- the default connection
-
getDatabaseConnection
public AbstractDatabaseConnection getDatabaseConnection()
Returns the currently used database connection object, can be null.- Specified by:
getDatabaseConnectionin interfaceDatabaseConnectionProvider- Returns:
- the current object
-
setDatabaseConnection
public void setDatabaseConnection(AbstractDatabaseConnection value)
Sets the database connection object to use.- Specified by:
setDatabaseConnectionin interfaceDatabaseConnectionHandler- Parameters:
value- the object to use
-
getConnection
protected AbstractDatabaseConnection getConnection(Actor actor)
Returns the database connection from the flow.- Parameters:
actor- the actor to use for determining the connection- Returns:
- the connection
-
preEvaluate
protected String preEvaluate(Actor owner, Token token)
Uses the token to determine the evaluation.- Overrides:
preEvaluatein classAbstractBooleanCondition- Parameters:
owner- the owning actortoken- the current token passing through- Returns:
- null if OK, otherwise error message
-
-