public class BaseComponentsHandler extends Object implements ComponentsHandler
Modifier and Type | Class and Description |
---|---|
static class |
BaseComponentsHandler.EmbeddedComponentManager |
static class |
BaseComponentsHandler.Outputs |
protected static class |
BaseComponentsHandler.State |
Modifier and Type | Field and Description |
---|---|
protected Collection<String> |
isolatedPackages |
protected String |
packageName |
protected static org.talend.sdk.component.junit.BaseComponentsHandler.Local<BaseComponentsHandler.State> |
STATE |
Constructor and Description |
---|
BaseComponentsHandler() |
Modifier and Type | Method and Description |
---|---|
ComponentManager |
asManager() |
<T> Stream<T> |
collect(Class<T> recordType,
org.talend.sdk.component.runtime.input.Mapper mapper,
int maxRecords) |
<T> Stream<T> |
collect(Class<T> recordType,
org.talend.sdk.component.runtime.input.Mapper mapper,
int maxRecords,
int concurrency)
Collects data emitted from this mapper.
|
<T> List<T> |
collect(Class<T> recordType,
String family,
String component,
int version,
Map<String,String> configuration) |
BaseComponentsHandler.Outputs |
collect(org.talend.sdk.component.runtime.output.Processor processor,
ControllableInputFactory inputs) |
BaseComponentsHandler.Outputs |
collect(org.talend.sdk.component.runtime.output.Processor processor,
ControllableInputFactory inputs,
int bundleSize)
Collects all outputs of a processor.
|
<T> List<T> |
collectAsList(Class<T> recordType,
org.talend.sdk.component.runtime.input.Mapper mapper) |
<T> List<T> |
collectAsList(Class<T> recordType,
org.talend.sdk.component.runtime.input.Mapper mapper,
int maxRecords) |
org.talend.sdk.component.runtime.input.Mapper |
createMapper(Class<?> componentType,
Object configuration) |
org.talend.sdk.component.runtime.output.Processor |
createProcessor(Class<?> componentType,
Object configuration) |
<T> T |
findService(Class<T> serviceClass) |
<T> T |
findService(String plugin,
Class<T> serviceClass) |
<T> List<T> |
getCollectedData(Class<T> recordType) |
Set<String> |
getTestPlugins() |
<T> T |
injectServices(T instance) |
<T> void |
process(Iterable<T> inputs,
String family,
String component,
int version,
Map<String,String> configuration) |
void |
resetState() |
<T> void |
setInputData(Iterable<T> data) |
BaseComponentsHandler.EmbeddedComponentManager |
start() |
BaseComponentsHandler |
withIsolatedPackage(String packageName,
String... packages) |
protected static final org.talend.sdk.component.junit.BaseComponentsHandler.Local<BaseComponentsHandler.State> STATE
protected String packageName
protected Collection<String> isolatedPackages
public BaseComponentsHandler()
public <T> T injectServices(T instance)
injectServices
in interface ComponentsHandler
public BaseComponentsHandler withIsolatedPackage(String packageName, String... packages)
public BaseComponentsHandler.EmbeddedComponentManager start()
public BaseComponentsHandler.Outputs collect(org.talend.sdk.component.runtime.output.Processor processor, ControllableInputFactory inputs)
collect
in interface ComponentsHandler
public BaseComponentsHandler.Outputs collect(org.talend.sdk.component.runtime.output.Processor processor, ControllableInputFactory inputs, int bundleSize)
collect
in interface ComponentsHandler
processor
- the processor to run while there are inputs.inputs
- the input factory, when an input will return null it will stop the
processing.bundleSize
- the bundle size to use.public <T> Stream<T> collect(Class<T> recordType, org.talend.sdk.component.runtime.input.Mapper mapper, int maxRecords)
collect
in interface ComponentsHandler
public <T> Stream<T> collect(Class<T> recordType, org.talend.sdk.component.runtime.input.Mapper mapper, int maxRecords, int concurrency)
collect
in interface ComponentsHandler
T
- the returned type of the records of the mapper.recordType
- the record type to use to type the returned type.mapper
- the mapper to go through.maxRecords
- maximum number of records, allows to stop the source when
infinite.concurrency
- requested (1 can be used instead if <= 0) concurrency for the reader execution.public <T> List<T> collectAsList(Class<T> recordType, org.talend.sdk.component.runtime.input.Mapper mapper)
collectAsList
in interface ComponentsHandler
public <T> List<T> collectAsList(Class<T> recordType, org.talend.sdk.component.runtime.input.Mapper mapper, int maxRecords)
collectAsList
in interface ComponentsHandler
public org.talend.sdk.component.runtime.input.Mapper createMapper(Class<?> componentType, Object configuration)
createMapper
in interface ComponentsHandler
public org.talend.sdk.component.runtime.output.Processor createProcessor(Class<?> componentType, Object configuration)
createProcessor
in interface ComponentsHandler
public <T> List<T> collect(Class<T> recordType, String family, String component, int version, Map<String,String> configuration)
collect
in interface ComponentsHandler
public <T> void process(Iterable<T> inputs, String family, String component, int version, Map<String,String> configuration)
process
in interface ComponentsHandler
public ComponentManager asManager()
asManager
in interface ComponentsHandler
public <T> T findService(String plugin, Class<T> serviceClass)
findService
in interface ComponentsHandler
public <T> T findService(Class<T> serviceClass)
findService
in interface ComponentsHandler
public Set<String> getTestPlugins()
public <T> void setInputData(Iterable<T> data)
setInputData
in interface ComponentsHandler
public <T> List<T> getCollectedData(Class<T> recordType)
getCollectedData
in interface ComponentsHandler
public void resetState()
1.1.6-SNAPSHOT - Copyright © 2018 Talend Component Kit Documentation