Interface ConcurrentUpdateBaseSolrClient.StreamingResponse
- All Superinterfaces:
AutoCloseable
- Enclosing class:
ConcurrentUpdateBaseSolrClient
Abstraction for streaming HTTP response handling in
ConcurrentUpdateBaseSolrClient.
This allows the base class to work with different HTTP client implementations without direct
dependencies on specific client libraries (e.g., Jetty, JDK HttpClient).
Implementations should wrap the underlying HTTP client's response mechanism and provide access to response status and body stream.
-
Method Summary
Modifier and TypeMethodDescriptionintawaitResponse(long timeoutMillis) Wait for response headers to arrive and return the HTTP status code.voidclose()Release resources associated with this response.Get the response body as an InputStream for parsing.Get the underlying implementation-specific response object.
-
Method Details
-
awaitResponse
Wait for response headers to arrive and return the HTTP status code.- Parameters:
timeoutMillis- maximum time to wait in milliseconds- Returns:
- HTTP status code (e.g., 200, 404, 500)
- Throws:
Exception- if timeout occurs, connection fails, or other error
-
getInputStream
InputStream getInputStream()Get the response body as an InputStream for parsing.This should be called after
awaitResponse(long)has successfully returned.- Returns:
- response body stream, never null
-
getUnderlyingResponse
Object getUnderlyingResponse()Get the underlying implementation-specific response object.This is used by the
ConcurrentUpdateBaseSolrClient.onSuccess(Object, InputStream)hook method to allow subclasses access to implementation-specific metadata. The returned object type depends on the HTTP client implementation being used.- Returns:
- underlying response object (implementation-specific), may be null
-
close
Release resources associated with this response.- Specified by:
closein interfaceAutoCloseable- Throws:
IOException- if cleanup fails
-