Class AbstractFileSystemSearchlet
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.source.filesystemsearch.AbstractFileSystemSearchlet
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,ShallowCopySupporter<AbstractFileSystemSearchlet>
,SizeOfHandler
,Stoppable
,StoppableWithFeedback
,FlowContextHandler
,Serializable
- Direct Known Subclasses:
AbstractFtpDirectoryListerBasedSearchlet
,AbstractLocalDirectoryListerBasedSearchlet
,AbstractSftpDirectoryListerBasedSearchlet
,AbstractSmbDirectoryListerBasedSearchlet
,BlockingSearch
,MultiSearch
public abstract class AbstractFileSystemSearchlet extends AbstractOptionHandler implements ShallowCopySupporter<AbstractFileSystemSearchlet>, QuickInfoSupporter, StoppableWithFeedback, FlowContextHandler
Ancestor for file-system search algorithms.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Actor
m_FlowContext
the flow context.protected boolean
m_Stopped
whether search was 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 AbstractFileSystemSearchlet()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
check()
Performs a setup check before search.protected abstract List<String>
doSearch()
Performs the actual search.Actor
getFlowContext()
Returns the flow context, if any.String
getQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.boolean
isStopped()
Whether the execution has been stopped.List<String>
search()
Searches the file system.void
setFlowContext(Actor value)
Sets the flow context.AbstractFileSystemSearchlet
shallowCopy()
Returns a shallow copy of itself, i.e., based on the commandline options.AbstractFileSystemSearchlet
shallowCopy(boolean expand)
Returns a shallow copy of itself, i.e., based on the commandline options.abstract void
stopExecution()
Stops the execution.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, defineOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, 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
-
m_Stopped
protected boolean m_Stopped
whether search was stopped.
-
m_FlowContext
protected Actor m_FlowContext
the flow context.
-
-
Method Detail
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.
Default implementation just returns null.- Specified by:
getQuickInfo
in interfaceQuickInfoSupporter
- Returns:
- null if no info available, otherwise short string
-
setFlowContext
public void setFlowContext(Actor value)
Sets the flow context.- Specified by:
setFlowContext
in interfaceFlowContextHandler
- Parameters:
value
- the actor
-
getFlowContext
public Actor getFlowContext()
Returns the flow context, if any.- Specified by:
getFlowContext
in interfaceFlowContextHandler
- Returns:
- the actor, null if none available
-
check
protected void check() throws Exception
Performs a setup check before search.
Default implementation does nothing.- Throws:
Exception
- if checks failed
-
doSearch
protected abstract List<String> doSearch() throws Exception
Performs the actual search.- Returns:
- the search result
- Throws:
Exception
- if search failed
-
search
public List<String> search() throws Exception
Searches the file system.- Returns:
- the search result
- Throws:
Exception
- if checks or search failed
-
stopExecution
public abstract void stopExecution()
Stops the execution.- Specified by:
stopExecution
in interfaceStoppable
-
isStopped
public boolean isStopped()
Whether the execution has been stopped.- Specified by:
isStopped
in interfaceStoppableWithFeedback
- Returns:
- true if stopped
-
shallowCopy
public AbstractFileSystemSearchlet shallowCopy()
Returns a shallow copy of itself, i.e., based on the commandline options.- Specified by:
shallowCopy
in interfaceShallowCopySupporter<AbstractFileSystemSearchlet>
- Returns:
- the shallow copy
-
shallowCopy
public AbstractFileSystemSearchlet shallowCopy(boolean expand)
Returns a shallow copy of itself, i.e., based on the commandline options.- Specified by:
shallowCopy
in interfaceShallowCopySupporter<AbstractFileSystemSearchlet>
- Parameters:
expand
- whether to expand variables to their current values- Returns:
- the shallow copy
-
-