Package org.chenile.utils.stream
Class Looper
java.lang.Object
org.chenile.utils.stream.Looper
Loops through the input stream that has been passed and makes a record for each line in the input stream
using the encoding type that has been passed. Each line will be converted to a record of type recordClass.
For each record, the Chenile Event "eventId" is invoked.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfileReader
(InputStream inputStream, String encodingType, Class<?> recordClass, Properties properties) private void
invokeServicesPerRecord
(String eventId, Object record, Properties headers) private void
invokeServicesPerRecord
(Consumer<Object> consumer, Object record, Properties headers) void
loop
(InputStream inputStream, String encodingType, Properties properties, Class<?> recordClass, Consumer<Object> consumer) void
loop
(String eventId, InputStream inputStream, String encodingType, Properties properties, Class<?> recordClass)
-
Field Details
-
eventProcessor
-
-
Constructor Details
-
Looper
public Looper()
-
-
Method Details
-
loop
public void loop(String eventId, InputStream inputStream, String encodingType, Properties properties, Class<?> recordClass) throws Exception - Throws:
Exception
-
loop
public void loop(InputStream inputStream, String encodingType, Properties properties, Class<?> recordClass, Consumer<Object> consumer) throws Exception - Throws:
Exception
-
fileReader
private Iterable<Object> fileReader(InputStream inputStream, String encodingType, Class<?> recordClass, Properties properties) throws Exception - Throws:
Exception
-
invokeServicesPerRecord
-
invokeServicesPerRecord
-