Class BlockingSearch
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.source.filesystemsearch.AbstractFileSystemSearchlet
-
- adams.flow.source.filesystemsearch.BlockingSearch
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,ShallowCopySupporter<AbstractFileSystemSearchlet>
,SizeOfHandler
,Stoppable
,StoppableWithFeedback
,FlowContextHandler
,Serializable
public class BlockingSearch extends AbstractFileSystemSearchlet
Executes the base search till there is a non-empty list returned or, if specified, the timeout reached.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected int
m_Interval
the interval in milliseconds.protected AbstractFileSystemSearchlet
m_Search
the base search.protected int
m_Timeout
the timeout in milliseconds (<=0 never time out).static int
MIN_WAIT
the shortest wait time.-
Fields inherited from class adams.flow.source.filesystemsearch.AbstractFileSystemSearchlet
m_FlowContext, 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 BlockingSearch()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.protected List<String>
doSearch()
Performs the actual search.int
getInterval()
Returns the interval to wait in milliseconds.String
getQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.AbstractFileSystemSearchlet
getSearch()
Returns the base search in use.int
getTimeout()
Returns the timeout in milliseconds.String
globalInfo()
Returns a string describing the object.String
intervalTipText()
Returns the tip text for this property.String
searchTipText()
Returns the tip text for this property.void
setInterval(int value)
Sets the interval in milliseconds to wait.void
setSearch(AbstractFileSystemSearchlet value)
Sets the base search to use.void
setTimeout(int value)
Sets the timeout in milliseconds.void
stopExecution()
Stops the execution.String
timeoutTipText()
Returns the tip text for this property.-
Methods inherited from class adams.flow.source.filesystemsearch.AbstractFileSystemSearchlet
check, getFlowContext, isStopped, search, setFlowContext, shallowCopy, shallowCopy
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, 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
-
MIN_WAIT
public static final int MIN_WAIT
the shortest wait time.- See Also:
- Constant Field Values
-
m_Search
protected AbstractFileSystemSearchlet m_Search
the base search.
-
m_Interval
protected int m_Interval
the interval in milliseconds.
-
m_Timeout
protected int m_Timeout
the timeout in milliseconds (<=0 never time out).
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceGlobalInfoSupporter
- Specified by:
globalInfo
in classAbstractOptionHandler
- 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 classAbstractOptionHandler
-
setSearch
public void setSearch(AbstractFileSystemSearchlet value)
Sets the base search to use.- Parameters:
value
- the search plugin
-
getSearch
public AbstractFileSystemSearchlet getSearch()
Returns the base search in use.- Returns:
- the search plugin
-
searchTipText
public String searchTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setInterval
public void setInterval(int value)
Sets the interval in milliseconds to wait.- Parameters:
value
- the interval
-
getInterval
public int getInterval()
Returns the interval to wait in milliseconds.- Returns:
- the interval
-
intervalTipText
public String intervalTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setTimeout
public void setTimeout(int value)
Sets the timeout in milliseconds.- Parameters:
value
- the timeout (<= 0 no timeout)
-
getTimeout
public int getTimeout()
Returns the timeout in milliseconds.- Returns:
- the timeout (<= 0 no timeout)
-
timeoutTipText
public String timeoutTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.- Specified by:
getQuickInfo
in interfaceQuickInfoSupporter
- Overrides:
getQuickInfo
in classAbstractFileSystemSearchlet
- Returns:
- null if no info available, otherwise short string
-
doSearch
protected List<String> doSearch() throws Exception
Performs the actual search.- Specified by:
doSearch
in classAbstractFileSystemSearchlet
- Returns:
- the search result
- Throws:
Exception
- if search failed
-
stopExecution
public void stopExecution()
Stops the execution.- Specified by:
stopExecution
in interfaceStoppable
- Specified by:
stopExecution
in classAbstractFileSystemSearchlet
-
-