AGRawStreamer (agraph-java-client 5.0.4-SNAPSHOT API)
Description: declaration: package: com.franz.agraph.http.handler, class: AGRawStreamer

Package com.franz.agraph.http.handler

# Class AGRawStreamer

java.lang.Object
com.franz.agraph.http.handler.AGResponseHandler
com.franz.agraph.http.handler.AGRawStreamer

public class AGRawStreamer extends AGResponseHandler
A handler that allows access to raw response stream.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AGRawStreamer()`
  Creates a streaming handler that does not specify the MIME type.
  `AGRawStreamer(String mimeType)`
  Creates a streaming handler.
  `AGRawStreamer(org.eclipse.rdf4j.query.resultio.BooleanQueryResultFormat format)`
  Creates a streaming handler that requests results in specified boolean format.
  `AGRawStreamer(org.eclipse.rdf4j.query.resultio.TupleQueryResultFormat format)`
  Creates a streaming handler that requests results in specified tuple format.
  `AGRawStreamer(org.eclipse.rdf4j.rio.RDFFormat format)`
  Creates a streaming handler that requests results in specified RDF format.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `InputStream`
  `getStream()`
  Gets the data stream contaning the server's response.
  `void`
  `handleResponse(org.apache.http.HttpResponse httpResponse, HttpUriRequest httpUriRequest)`
  `boolean`
  `releaseConnection()`
  For most responses, AGHTTPClient releases resources after calling `AGResponseHandler.handleResponse(HttpResponse, HttpUriRequest)`; this can be overridden in subclasses that stream results.

  ### Methods inherited from class com.franz.agraph.http.handler.AGResponseHandler

  `getRequestMIMEType`

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### AGRawStreamer

    public AGRawStreamer(String mimeType)
    Creates a streaming handler.
    Parameters:
      `mimeType` - MIME type to be requested from the server.

  - ### AGRawStreamer

    public AGRawStreamer()
    Creates a streaming handler that does not specify the MIME type.

    The server is free to return any content type.

  - ### AGRawStreamer

    public AGRawStreamer(org.eclipse.rdf4j.rio.RDFFormat format)
    Creates a streaming handler that requests results in specified RDF format.
    Parameters:
      `format` - Format to return the data in.

  - ### AGRawStreamer

    public AGRawStreamer(org.eclipse.rdf4j.query.resultio.TupleQueryResultFormat format)
    Creates a streaming handler that requests results in specified tuple format.
    Parameters:
      `format` - Format to return the data in.

  - ### AGRawStreamer

    public AGRawStreamer(org.eclipse.rdf4j.query.resultio.BooleanQueryResultFormat format)
    Creates a streaming handler that requests results in specified boolean format.
    Parameters:
      `format` - Format to return the data in.

- ## Method Details

  - ### getStream

    public InputStream getStream() throws AGHttpException
    Gets the data stream contaning the server's response.
    Returns:
      An input stream. It must be closed by the caller.
    Throws:
      `AGHttpException` - if an error happens when decoding the response (e.g. if the server sent an invalid GZIP stream).

  - ### handleResponse

    public void handleResponse(org.apache.http.HttpResponse httpResponse, HttpUriRequest httpUriRequest) throws IOException, AGHttpException
    Specified by:
      `handleResponse` in class `AGResponseHandler`
    Throws:
      `IOException`
      `AGHttpException`

  - ### releaseConnection

    public boolean releaseConnection()
    Description copied from class: `AGResponseHandler`
    For most responses, AGHTTPClient releases resources after calling `AGResponseHandler.handleResponse(HttpResponse, HttpUriRequest)`; this can be overridden in subclasses that stream results.
    Overrides:
      `releaseConnection` in class `AGResponseHandler`
    Returns:
      Boolean always returns true