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 AbstractDatabaseConnection
m_DatabaseConnection
the database connection in use.protected boolean
m_DatabaseConnectionUpdated
whether 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 AbstractDatabaseConnection
getConnection(Actor actor)
Returns the database connection from the flow.AbstractDatabaseConnection
getDatabaseConnection()
Returns the currently used database connection object, can be null.protected AbstractDatabaseConnection
getDefaultDatabaseConnection()
Returns the default database connection to use.protected void
initialize()
Initializes the members.protected String
preEvaluate(Actor owner, Token token)
Uses the token to determine the evaluation.protected void
reset()
Resets the scheme.void
setDatabaseConnection(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:
initialize
in classAbstractOptionHandler
-
reset
protected void reset()
Resets the scheme.- Overrides:
reset
in 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:
getDatabaseConnection
in interfaceDatabaseConnectionProvider
- Returns:
- the current object
-
setDatabaseConnection
public void setDatabaseConnection(AbstractDatabaseConnection value)
Sets the database connection object to use.- Specified by:
setDatabaseConnection
in 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:
preEvaluate
in classAbstractBooleanCondition
- Parameters:
owner
- the owning actortoken
- the current token passing through- Returns:
- null if OK, otherwise error message
-
-