Package com.franz.agraph.http.handler
Class AGRawStreamer
java.lang.Object
com.franz.agraph.http.handler.AGResponseHandler
com.franz.agraph.http.handler.AGRawStreamer
A handler that allows access to raw response stream.
-
Constructor Summary
ConstructorDescriptionCreates a streaming handler that does not specify the MIME type.AGRawStreamer
(String mimeType) Creates a streaming handler.Creates a streaming handler that requests results in specified boolean format.AGRawStreamer
(TupleQueryResultFormat format) Creates a streaming handler that requests results in specified tuple format.AGRawStreamer
(RDFFormat format) Creates a streaming handler that requests results in specified RDF format. -
Method Summary
Modifier and TypeMethodDescriptionGets the data stream contaning the server's response.void
handleResponse
(org.apache.http.HttpResponse httpResponse, HttpUriRequest httpUriRequest) boolean
For most responses, AGHTTPClient releases resources after callingAGResponseHandler.handleResponse(HttpResponse, HttpUriRequest)
; this can be overridden in subclasses that stream results.Methods inherited from class com.franz.agraph.http.handler.AGResponseHandler
getRequestMIMEType
-
Constructor Details
-
AGRawStreamer
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
Creates a streaming handler that requests results in specified RDF format.- Parameters:
format
- Format to return the data in.
-
AGRawStreamer
Creates a streaming handler that requests results in specified tuple format.- Parameters:
format
- Format to return the data in.
-
AGRawStreamer
Creates a streaming handler that requests results in specified boolean format.- Parameters:
format
- Format to return the data in.
-
-
Method Details
-
getStream
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 classAGResponseHandler
- Throws:
IOException
AGHttpException
-
releaseConnection
public boolean releaseConnection()Description copied from class:AGResponseHandler
For most responses, AGHTTPClient releases resources after callingAGResponseHandler.handleResponse(HttpResponse, HttpUriRequest)
; this can be overridden in subclasses that stream results.- Overrides:
releaseConnection
in classAGResponseHandler
- Returns:
- Boolean always returns true
-