com.splunk
Class ResultsReader

java.lang.Object
  extended by com.splunk.ResultsReader
Direct Known Subclasses:
ResultsReaderCsv, ResultsReaderJson, ResultsReaderXml

public abstract class ResultsReader
extends java.lang.Object

The ResultsReader class is a base class for the streaming readers for Splunk search results.


Constructor Summary
ResultsReader(java.io.InputStream inputStream)
          Class constructor.
 
Method Summary
 void close()
          Closes the reader and returns resources.
abstract  Event getNextEvent()
          Returns the next event in the event stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResultsReader

public ResultsReader(java.io.InputStream inputStream)
              throws java.io.IOException
Class constructor.

Parameters:
inputStream - The unread return input stream from a Splunk query or export.
Throws:
java.io.IOException - On IO exception.
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 abstract 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.