com.splunk
Class ResultsReader

java.lang.Object
  extended by com.splunk.ResultsReader
All Implemented Interfaces:
SearchResults, java.lang.Iterable<Event>
Direct Known Subclasses:
ResultsReaderCsv, ResultsReaderJson, ResultsReaderXml

public abstract class ResultsReader
extends java.lang.Object
implements SearchResults

The ResultsReader class is a base class for the streaming readers for Splunk search results. This class should not be used to retrieve preview results for an export search.


Field Summary
protected  java.io.InputStream inputStream
           
 
Method Summary
 void close()
          Closes the reader and returns resources.
 Event getNextEvent()
          Returns the next event in the event stream.
 java.util.Iterator<Event> iterator()
          Returns an iterator over the events from this reader.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.splunk.SearchResults
getFields, isPreview
 

Field Detail

inputStream

protected final java.io.InputStream inputStream
Method Detail

close

public void close()
           throws java.io.IOException
Closes the reader and returns resources.

Throws:
java.io.IOException - On IO exception.

getNextEvent

public final Event getNextEvent()
                         throws java.io.IOException
Returns the next event in the event stream.

Returns:
The map of key-value pairs for an event. The format of multi-item values is implementation-specific. We recommend using the methods from the Event class to interpret multi-item values.
Throws:
java.io.IOException - On IO exception.

iterator

public final java.util.Iterator<Event> iterator()
Returns an iterator over the events from this reader.

Specified by:
iterator in interface java.lang.Iterable<Event>
Returns:
an Iterator.