Package adams.flow.condition.test
Class OptionalFlowExecution
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.condition.test.AbstractTestCondition
-
- adams.flow.condition.test.FileExists
-
- adams.flow.condition.test.OptionalFlowExecution
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,ShallowCopySupporter<TestCondition>
,SizeOfHandler
,TestCondition
,Serializable
,Comparable
public class OptionalFlowExecution extends FileExists
Checks whether a specified file exists. If not, then the specified flow is run. After the flow finishes, the check is performed once again, whether the file exists or not.
Valid options are:
-D <int> (property: debugLevel) The greater the number the more additional info the scheme may output to the console (0 = off). default: 0 minimum: 0
-file <adams.core.io.PlaceholderFile> (property: file) The file to look for. default: ${CWD}
-invert (property: invert) If set to true, then the matching sense is inverted.
-headless (property: headless) If set to true, the actor is run in headless mode without GUI components.
-flow <adams.core.io.FlowFile> (property: flowFile) The flow to run if the file doesn't exist. default: ${CWD}
- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected FlowFile
m_FlowFile
the flow to run.protected boolean
m_Headless
whether the execution is to be headless, i.e., no GUI components.-
Fields inherited from class adams.flow.condition.test.FileExists
m_File, m_Invert
-
Fields inherited from class adams.flow.condition.test.AbstractTestCondition
m_Tested, m_TestResult
-
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 OptionalFlowExecution()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.String
flowFileTipText()
Returns the tip text for this property.FlowFile
getFlowFile()
Returns the flow to run if necessary.String
globalInfo()
Returns a string describing the object.String
headlessTipText()
Returns the tip text for this property.boolean
isHeadless()
Returns whether the actor is run in headless mode.protected String
performTest()
Performs the actual testing of the condition.void
setFlowFile(FlowFile value)
Sets the flow to run if necessary.void
setHeadless(boolean value)
Sets whether the actor is to be run in headless mode, i.e., suppressing GUI components.-
Methods inherited from class adams.flow.condition.test.FileExists
fileTipText, getFile, getInvert, getQuickInfo, invertTipText, setFile, setInvert
-
Methods inherited from class adams.flow.condition.test.AbstractTestCondition
compareTo, equals, forCommandLine, forName, getConditions, getTestResult, initialize, reset, shallowCopy, shallowCopy
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, 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, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
m_FlowFile
protected FlowFile m_FlowFile
the flow to run.
-
m_Headless
protected boolean m_Headless
whether the execution is to be headless, i.e., no GUI components.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceGlobalInfoSupporter
- Overrides:
globalInfo
in classFileExists
- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classFileExists
-
setHeadless
public void setHeadless(boolean value)
Sets whether the actor is to be run in headless mode, i.e., suppressing GUI components.- Parameters:
value
- if true then GUI components will be suppressed
-
isHeadless
public boolean isHeadless()
Returns whether the actor is run in headless mode.- Returns:
- true if GUI components are suppressed
-
headlessTipText
public String headlessTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setFlowFile
public void setFlowFile(FlowFile value)
Sets the flow to run if necessary.- Parameters:
value
- the flow file
-
getFlowFile
public FlowFile getFlowFile()
Returns the flow to run if necessary.- Returns:
- the flow file
-
flowFileTipText
public String flowFileTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
performTest
protected String performTest()
Performs the actual testing of the condition.- Overrides:
performTest
in classFileExists
- Returns:
- the test result, null if everything OK, otherwise the error message
-
-