Interface ConcurrentUpdateBaseSolrClient.StreamingResponse

All Superinterfaces:
AutoCloseable
Enclosing class:
ConcurrentUpdateBaseSolrClient

public static interface ConcurrentUpdateBaseSolrClient.StreamingResponse extends AutoCloseable
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 Type
    Method
    Description
    int
    awaitResponse(long timeoutMillis)
    Wait for response headers to arrive and return the HTTP status code.
    void
    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

      int awaitResponse(long timeoutMillis) throws Exception
      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

      void close() throws IOException
      Release resources associated with this response.
      Specified by:
      close in interface AutoCloseable
      Throws:
      IOException - if cleanup fails