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:
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 Actorm_FlowContextthe flow context.protected booleanm_Stoppedwhether 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 voidcheck()Performs a setup check before search.protected abstract List<String>doSearch()Performs the actual search.ActorgetFlowContext()Returns the flow context, if any.StringgetQuickInfo()Returns a quick info about the object, which can be displayed in the GUI.booleanisStopped()Whether the execution has been stopped.List<String>search()Searches the file system.voidsetFlowContext(Actor value)Sets the flow context.AbstractFileSystemSearchletshallowCopy()Returns a shallow copy of itself, i.e., based on the commandline options.AbstractFileSystemSearchletshallowCopy(boolean expand)Returns a shallow copy of itself, i.e., based on the commandline options.abstract voidstopExecution()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:
getQuickInfoin interfaceQuickInfoSupporter- Returns:
- null if no info available, otherwise short string
-
setFlowContext
public void setFlowContext(Actor value)
Sets the flow context.- Specified by:
setFlowContextin interfaceFlowContextHandler- Parameters:
value- the actor
-
getFlowContext
public Actor getFlowContext()
Returns the flow context, if any.- Specified by:
getFlowContextin interfaceFlowContextHandler- Returns:
- the actor, null if none available
-
check
protected void check() throws ExceptionPerforms 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:
stopExecutionin interfaceStoppable
-
isStopped
public boolean isStopped()
Whether the execution has been stopped.- Specified by:
isStoppedin interfaceStoppableWithFeedback- Returns:
- true if stopped
-
shallowCopy
public AbstractFileSystemSearchlet shallowCopy()
Returns a shallow copy of itself, i.e., based on the commandline options.- Specified by:
shallowCopyin 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:
shallowCopyin interfaceShallowCopySupporter<AbstractFileSystemSearchlet>- Parameters:
expand- whether to expand variables to their current values- Returns:
- the shallow copy
-
-