Package org.nuiton.eugene.writer
Interface ChainedWriterEngine
-
- All Known Implementing Classes:
DefaultChainedWriterEngine
public interface ChainedWriterEngine
Contract of the chained writer engine. You can register inputs via the methodregisterInclude(String)
. And later obtain of the selected writers for your inputs via the methodgetSelectedWriters()
. Created: 17 déc. 2009- Since:
- 2.0.0
- Author:
- Tony Chemit - chemit@codelutin.com
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
clear()
clean all internal statesboolean
containsWriter(String inputProtocol)
Tests if there is a selected writer using the given input protocol.Set<ChainedFileWriter>
filterWriterForModelType(Map<String,ChainedFileWriter> universe, String modelType)
Filter the givenuniverse
of writers which accept the givenmodelType
.Set<ChainedFileWriter>
getAvailableWriters()
ChainedFileWriterData
getData(ChainedFileWriter writer)
Obtain the universe of files to react by the givenwriter
associated with each (distinct).List<ChainedFileWriter>
getSelectedWriters()
ChainedFileWriter
getWriterForInclude(Set<ChainedFileWriter> universe, String include, String modelType)
Filter the givenuniverse
of writers which accept the givenmodelType
andinclude
.ChainedFileWriter
getWriterForInputProtocol(Set<ChainedFileWriter> universe, String inputProtocol, String modelType)
Filter the givenuniverse
of writers which accept the givenmodelType
andinputProtocol
.void
init(ChainedFileWriterConfiguration configuration)
void
registerInclude(String include)
Register in engine a new input source.
-
-
-
Method Detail
-
init
void init(ChainedFileWriterConfiguration configuration)
-
registerInclude
void registerInclude(String include)
Register in engine a new input source. this method will detects writers to register and chain them if necessary.- Parameters:
include
- the new include to digest
-
getAvailableWriters
Set<ChainedFileWriter> getAvailableWriters()
- Returns:
- the set of all available writers discovered at runtime
-
getSelectedWriters
List<ChainedFileWriter> getSelectedWriters()
- Returns:
- the list of selected writers after having registred some inputs.
-
containsWriter
boolean containsWriter(String inputProtocol)
Tests if there is a selected writer using the given input protocol.- Parameters:
inputProtocol
- the inputProtocol to test- Returns:
true
if there is a selected writer using this input protocol- See Also:
ChainedFileWriter.getInputProtocol()
,getSelectedWriters()
-
filterWriterForModelType
Set<ChainedFileWriter> filterWriterForModelType(Map<String,ChainedFileWriter> universe, String modelType)
Filter the givenuniverse
of writers which accept the givenmodelType
.- Parameters:
universe
- the list of writers to filtermodelType
- the accepted model type- Returns:
- the set of filtered writers
- See Also:
ChainedFileWriter.acceptModel(String)
-
getWriterForInputProtocol
ChainedFileWriter getWriterForInputProtocol(Set<ChainedFileWriter> universe, String inputProtocol, String modelType)
Filter the givenuniverse
of writers which accept the givenmodelType
andinputProtocol
.- Parameters:
universe
- the list of writers to filterinputProtocol
- the accepted input protocolmodelType
- the accepted model type- Returns:
- the set of filtered writers
- See Also:
ChainedFileWriter.acceptModel(String)
,ChainedFileWriter.getInputProtocol()
,ChainedFileWriter.getInputProtocol(String)
-
getWriterForInclude
ChainedFileWriter getWriterForInclude(Set<ChainedFileWriter> universe, String include, String modelType)
Filter the givenuniverse
of writers which accept the givenmodelType
andinclude
. The include can have several forms :- Parameters:
universe
- the list of writers to filterinclude
- the include configurationmodelType
- the accepted model type- Returns:
- the set of filtered writers
- See Also:
ChainedFileWriter.acceptModel(String)
,ChainedFileWriter.getInputProtocol()
,ChainedFileWriter.getInputProtocol(String)
-
getData
ChainedFileWriterData getData(ChainedFileWriter writer) throws IOException
Obtain the universe of files to react by the givenwriter
associated with each (distinct). Note: If some files are in class-path (using the classpath: prefix) then they will be extracted to theChainedFileWriterConfiguration.getExtractDirectory()
.- Parameters:
writer
- the writer to inspect- Returns:
- the universe of files to react for the given writer
- Throws:
IOException
- for any IO pb- Since:
- 2.1.3
-
clear
void clear()
clean all internal states
-
-