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 intm_Intervalthe interval in milliseconds.protected AbstractFileSystemSearchletm_Searchthe base search.protected intm_Timeoutthe timeout in milliseconds (<=0 never time out).static intMIN_WAITthe 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 voiddefineOptions()Adds options to the internal list of options.protected List<String>doSearch()Performs the actual search.intgetInterval()Returns the interval to wait in milliseconds.StringgetQuickInfo()Returns a quick info about the object, which can be displayed in the GUI.AbstractFileSystemSearchletgetSearch()Returns the base search in use.intgetTimeout()Returns the timeout in milliseconds.StringglobalInfo()Returns a string describing the object.StringintervalTipText()Returns the tip text for this property.StringsearchTipText()Returns the tip text for this property.voidsetInterval(int value)Sets the interval in milliseconds to wait.voidsetSearch(AbstractFileSystemSearchlet value)Sets the base search to use.voidsetTimeout(int value)Sets the timeout in milliseconds.voidstopExecution()Stops the execution.StringtimeoutTipText()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:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin 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:
getQuickInfoin interfaceQuickInfoSupporter- Overrides:
getQuickInfoin classAbstractFileSystemSearchlet- Returns:
- null if no info available, otherwise short string
-
doSearch
protected List<String> doSearch() throws Exception
Performs the actual search.- Specified by:
doSearchin classAbstractFileSystemSearchlet- Returns:
- the search result
- Throws:
Exception- if search failed
-
stopExecution
public void stopExecution()
Stops the execution.- Specified by:
stopExecutionin interfaceStoppable- Specified by:
stopExecutionin classAbstractFileSystemSearchlet
-
-