public class LineReaderQuIP extends java.lang.Object implements QueueItemProvider<java.lang.String>, java.io.Closeable
QueueItemProvider based on lines of text from an InputStream.| Constructor and Description |
|---|
LineReaderQuIP(java.io.InputStream inputStream,
java.lang.Integer limit) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
boolean |
hasNext() |
java.util.Iterator<java.util.Collection<java.lang.String>> |
iterator()
Generally returns
this. |
java.util.Collection<java.lang.String> |
next() |
void |
remove()
A means to delete the message because it is done or should not be processed again.
|
public LineReaderQuIP(java.io.InputStream inputStream,
@Nullable
java.lang.Integer limit)
inputStream - newline-separated JSON documentslimit - (optional) maximum number of JSON documents (lines) to read. Defaults to unlimited.public java.util.Iterator<java.util.Collection<java.lang.String>> iterator()
QueueItemProviderthis. QueueItemProviders are not generally reusable/resettable since the
underlying message source will often not be reversible. Mashing the two interfaces together simplifies
implementations a bit, and also supports any typical Iterable usage.iterator in interface QueueItemProvider<java.lang.String>iterator in interface java.lang.Iterable<java.util.Collection<java.lang.String>>public boolean hasNext()
hasNext in interface QueueItemProvider<java.lang.String>hasNext in interface java.util.Iterator<java.util.Collection<java.lang.String>>QueueReader should continue processing messages from this provider.public java.util.Collection<java.lang.String> next()
next in interface QueueItemProvider<java.lang.String>next in interface java.util.Iterator<java.util.Collection<java.lang.String>>null. The reading QueueReader may sleep after receiving an empty batch depending on its
configuration.public void remove()
QueueItemProviderremove in interface QueueItemProvider<java.lang.String>remove in interface java.util.Iterator<java.util.Collection<java.lang.String>>public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOException