Package net.simplace.pipe.control
Class FWProcessor
java.lang.Object
net.simplace.pipe.control.FWProcessor
- Direct Known Subclasses:
AsciiToDatabaseTableProcessor
,AsciiToMapProcessor
,BrowseFolderProcessor
,ConsoleOutProcessor
,CopyFilesProcessor
,CopyFolderProcessor
,CopyTableProcessor
,CreateDBConnectionProcessor
,CreateFileListProcessor
,CreateScenarioToLoopProcessor
,DatasetLoaderProcessor
,DateListCreatorProcessor
,DateTableCreatorProcessor
,DB2HSSFWorkbookProcessor
,DeleteFilesProcessor
,DownloadFileProcessor
,EncodingConverterProcessor
,FillParameterProcessor
,FilterParameterProcessor
,FWLoopProcessor
,GetXLSValueProcessor
,HashValueFromFileProcessor
,HSSFWorkbook2DBProcessor
,JDOMParserProcessor
,JDOMUnparseProcessor
,ListReducerProcessor
,ListToDatabaseTableProcessor
,LoadScenarioProcessor
,MathCalculatorProcessor
,MoveFileProcessor
,ReadFileProcessor
,ReadHSSFWorkbookProcessor
,ReadXLSValueProcessor
,RecalcXLSProcessor
,ReleaseDBConnectionProcessor
,RequestSimplaceServerProcessor
,RunAppProcessor
,SaveProjectTemplateProcessor
,SaveScenarioProcessor
,SetXLSValueProcessor
,SolutionToXMLProcessor
,SQLResultToCsvProcessor
,SQLStatementProcessor
,UnzipFolderProcessor
,WriteFileProcessor
,WriteProjectXMLProcessor
,XSLTTransformerProcessor
Abstract superclass for all standard and custom processors.
- Author:
- Andreas Enders
-
Field Summary
Modifier and TypeFieldDescriptionprotected int
Indicates the count of loops this Processor was run through: -1protected FWPipeLinesContainer
Holds an instance of the Kernel.protected FWObservable
Map of parameters worked with in this processor.protected FWObservable
Map of parameters put to output for next processor.protected ArrayList<FWProgressTask>
The progressTasks of this Processor. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
Can be overridden to perform semantic checks on the pipeline Input.protected boolean
Can be overridden to perform semantic checks on the pipeline Input.clone()
Creates a connectlet by dynamically instancing the class given in the JDM element.protected boolean
containsParameter
(String aSourceKey) static FWProcessor
createProcessor
(String aClassName) Creates a processor by dynamically instancing the class given in the JDM element.static FWProcessor
createProcessor
(org.jdom2.Element aProcessorElement, FWPipeLinesContainer aContainer) Creates a processor by dynamically instancing the class given in the JDM element.protected void
fireTaskEvent
(JPanel aSourcePanel) fires TaskEvent to listening Panels.getAllStringInParameters
(String aKeyPrefix, boolean aElimKeyPrefix) Returns all string in parameters, whose keys start with a given prefix.protected org.jdom2.Element
gets the detailed configuration of the Processor.protected Object
getInParameter
(String aKey) Returns the value of specified parameter or null if not set.protected Object
getInParameter
(String aKey, Object aDefault) Returns the value of specified parameter.protected FWObservable
Returns the map of all parameters.protected Object
getOutParameter
(String aKey) gets a parameter from the output map.gets a keySet of parameters in the output map.protected FWPipeLine
getPipeLine
(String aPipeLineID) protected String
getStringInParameter
(String aKey) Returns the value of specified channel as string.protected String
getStringInParameter
(String aKey, String aDefault) Returns the value of specified key as string.protected String
protected boolean
gets the detailed configuration of the Processor.boolean
Sets the end of pipe flag.pipe
(FWObservable aObservabe, Integer aAllreadyLoopedCount) Pipes aIncommingObject through this pipe element.protected abstract boolean
process()
Must be overridden to implement concrete pipe procedure.protected void
removeOutParameter
(String aElement) removes a Parameter form Mapprotected void
setConfiguration
(String aClassname, org.jdom2.Element aConfigurationElement) sets the detailed configuration of a Processor.protected void
Sets the end of pipe flag.protected void
setInitialParameters
(Map<String, Object> aInitialParameterMap) protected void
setInParameterMap
(FWObservable aObservable) protected void
setLoopedCount
(int aNumberOfAllreadyLooped) protected void
setOutParameter
(String aKey, Object aValue) sets a parameter to the output map.protected void
setStateOfTask
(String aStatusOfTask) protected void
setStateProgressing
(int aPercentDone, String aMessage) org.jdom2.Element
toXML()
-
Field Details
-
iContainer
Holds an instance of the Kernel. -
iProgressTasks
The progressTasks of this Processor. -
iInObservable
Map of parameters worked with in this processor. -
iObservable
Map of parameters put to output for next processor. -
iAllreadyLoopedCount
protected int iAllreadyLoopedCountIndicates the count of loops this Processor was run through: -1
-
-
Constructor Details
-
FWProcessor
public FWProcessor()
-
-
Method Details
-
createProcessor
public static FWProcessor createProcessor(org.jdom2.Element aProcessorElement, FWPipeLinesContainer aContainer) throws PipeLineCreationException Creates a processor by dynamically instancing the class given in the JDM element.- Parameters:
aProcessorElement
-aContainer
-- Returns:
- the created Processor
- Throws:
PipeLineCreationException
-
createProcessor
Creates a processor by dynamically instancing the class given in the JDM element.- Parameters:
aClassName
-- Returns:
- the created Processor
- Throws:
PipeLineCreationException
-
clone
Creates a connectlet by dynamically instancing the class given in the JDM element. -
setInitialParameters
- Parameters:
aInitialParameterMap
-
-
getInitialParameters
- Returns:
- the initial parameters of this processor
-
process
Must be overridden to implement concrete pipe procedure.- Returns:
- success
- Throws:
PipeLineException
-
checkInParameterMap
protected boolean checkInParameterMap()Can be overridden to perform semantic checks on the pipeline Input.- Returns:
- true if not overridden by implementations
-
containsParameter
- Parameters:
aSourceKey
-- Returns:
- if the source is contained in In-Parameter set
-
setEndOfPipeFlag
protected void setEndOfPipeFlag()Sets the end of pipe flag. Pipe line is aborted after this processor. -
isEndOfPipe
public boolean isEndOfPipe()Sets the end of pipe flag. Pipeline is aborted after this processor.- Returns:
- if pipe has ended
-
checkOutParameterMap
protected boolean checkOutParameterMap()Can be overridden to perform semantic checks on the pipeline Input.- Returns:
- true if not overridden
-
getInParameter
Returns the value of specified parameter or null if not set.- Parameters:
aKey
-- Returns:
- the object from the in parameter map
-
getInParameters
Returns the map of all parameters.- Returns:
- the in parameter map
-
getInParameter
Returns the value of specified parameter. Returns aDefault if the parameter is null.- Parameters:
aKey
-aDefault
-- Returns:
- the object from the in parameter map
-
getStringInParameter
Returns the value of specified key as string. Returns aDefault if the key is null or not a string.- Parameters:
aKey
-aDefault
-- Returns:
- the object from the in parameter map if it is a string, else the default
-
getAllStringInParameters
Returns all string in parameters, whose keys start with a given prefix.- Parameters:
aKeyPrefix
- prefix the "wanted" parameters must start withaElimKeyPrefix
- iffalse
the keys of the found parameters are used unchanged for the returned map. Iftrue
the prefix is eliminated for the use in the destination map.- Returns:
- an empty map, when
aKeyPrefix
isnull
-
getStringInParameter
Returns the value of specified channel as string. Returns aDefault if the parameter is null or not a string.- Parameters:
aKey
-- Returns:
- the In parameter as string from observable
-
setOutParameter
sets a parameter to the output map.- Parameters:
aKey
-aValue
-
-
setInParameterMap
- Parameters:
aObservable
-
-
getOutParameter
gets a parameter from the output map.- Parameters:
aKey
-- Returns:
- the out parameter
-
getOutParameterKeys
gets a keySet of parameters in the output map.- Returns:
- out parameter keys
-
removeOutParameter
removes a Parameter form Map- Parameters:
aElement
- of OutParameterMap
-
pipe
public FWObservable pipe(FWObservable aObservabe, Integer aAllreadyLoopedCount) throws PipeLineException Pipes aIncommingObject through this pipe element.- Parameters:
aObservabe
-aAllreadyLoopedCount
-- Returns:
- the resulting observable
- Throws:
PipeLineException
-
getConfiguration
protected org.jdom2.Element getConfiguration()gets the detailed configuration of the Processor.- Returns:
- the processors configration element
-
setConfiguration
sets the detailed configuration of a Processor.- Parameters:
aClassname
-aConfigurationElement
-
-
hasConfiguration
protected boolean hasConfiguration()gets the detailed configuration of the Processor.- Returns:
- if has additional configuration
-
fireTaskEvent
fires TaskEvent to listening Panels.- Parameters:
aSourcePanel
-
-
getNewProgressTask
- Returns:
- the progressTask for given LoopCount (1-n)
-
getProgressTask
- Returns:
- the progressTask for integrated LoopCount
-
getPipeLine
- Parameters:
aPipeLineID
-- Returns:
- the the count of loops, invoked by this processor
-
getSystemID
- Returns:
- the SystemID from PipelineContainer
-
setStateProgressing
- Parameters:
aPercentDone
-aMessage
-the
- statusOfTask is set to progressing. percentDone (0-100).
-
setStateOfTask
- Parameters:
aStatusOfTask
- the statusOfTask to set - use Variables in class State
-
setLoopedCount
protected void setLoopedCount(int aNumberOfAllreadyLooped) - Parameters:
aNumberOfAllreadyLooped
-aLoopedCount
- - has to be set from the looping processor because of thread safety
-
toXML
public org.jdom2.Element toXML()- Returns:
- the Element explaining which processor this is
-