org.apache.solr.client.solrj

## Class SolrRequest<T extends SolrResponse>

- java.lang.Object
- - org.apache.solr.client.solrj.SolrRequest<T>

- All Implemented Interfaces:
    Serializable
  Direct Known Subclasses:
    AbstractSchemaRequest, AbstractUpdateRequest, CollectionAdminRequest, ConfigSetAdminRequest, CoreAdminRequest, DelegationTokenRequest, DirectXmlRequest, DocumentAnalysisRequest, FieldAnalysisRequest, GenericSolrRequest, LukeRequest, QueryRequest, SolrPing

      public abstract class SolrRequest<T extends SolrResponse>
      extends Object
      implements Serializable

  Since:
    solr 1.3
  See Also:
    Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `SolrRequest.METHOD`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SolrRequest(SolrRequest.METHOD m, String path)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected abstract T` | `createResponse(SolrClient client)` Create a new SolrResponse to hold the response from the server
    `String` | `getBasicAuthPassword()`
    `String` | `getBasicAuthUser()`
    `abstract Collection<ContentStream>` | `getContentStreams()`
    `SolrRequest.METHOD` | `getMethod()`
    `abstract SolrParams` | `getParams()`
    `String` | `getPath()`
    `Set<String>` | `getQueryParams()` Parameter keys that are sent via the query string
    `ResponseParser` | `getResponseParser()`
    `StreamingResponseCallback` | `getStreamingResponseCallback()`
    `T` | `process(SolrClient client)` Send this request to a `SolrClient` and return the response
    `T` | `process(SolrClient client, String collection)` Send this request to a `SolrClient` and return the response
    `SolrRequest` | `setBasicAuthCredentials(String user, String password)`
    `void` | `setMethod(SolrRequest.METHOD method)`
    `void` | `setPath(String path)`
    `void` | `setQueryParams(Set<String> queryParams)`
    `void` | `setResponseParser(ResponseParser responseParser)` Optionally specify how the Response should be parsed.
    `void` | `setStreamingResponseCallback(StreamingResponseCallback callback)`

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

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

- - ### Constructor Detail

    - #### SolrRequest

          public SolrRequest(SolrRequest.METHOD m,
                             String path)

  - ### Method Detail

    - #### setBasicAuthCredentials

          public SolrRequest setBasicAuthCredentials(String user,
                                                     String password)

    - #### getBasicAuthUser

          public String getBasicAuthUser()

    - #### getBasicAuthPassword

          public String getBasicAuthPassword()

    - #### getMethod

          public SolrRequest.METHOD getMethod()

    - #### setMethod

          public void setMethod(SolrRequest.METHOD method)

    - #### getPath

          public String getPath()

    - #### setPath

          public void setPath(String path)

    - #### getResponseParser

          public ResponseParser getResponseParser()

      Returns:
        The `ResponseParser`

    - #### setResponseParser

          public void setResponseParser(ResponseParser responseParser)

      Optionally specify how the Response should be parsed. Not all server implementations require a ResponseParser to be specified.
      Parameters:
        `responseParser` - The `ResponseParser`

    - #### getStreamingResponseCallback

          public StreamingResponseCallback getStreamingResponseCallback()

    - #### setStreamingResponseCallback

          public void setStreamingResponseCallback(StreamingResponseCallback callback)

    - #### getQueryParams

          public Set<String> getQueryParams()

      Parameter keys that are sent via the query string

    - #### setQueryParams

          public void setQueryParams(Set<String> queryParams)

    - #### getParams

          public abstract SolrParams getParams()

    - #### getContentStreams

          public abstract Collection<ContentStream> getContentStreams()
                                                               throws IOException

      Throws:
        `IOException`

    - #### createResponse

          protected abstract T createResponse(SolrClient client)

      Create a new SolrResponse to hold the response from the server
      Parameters:
        `client` - the `SolrClient` the request will be sent to

    - #### process

          public final T process(SolrClient client,
                                 String collection)
                          throws SolrServerException,
                                 IOException

      Send this request to a `SolrClient` and return the response
      Parameters:
        `client` - the SolrClient to communicate with
        `collection` - the collection to execute the request against
      Returns:
        the response
      Throws:
        `SolrServerException` - if there is an error on the Solr server
        `IOException` - if there is a communication error

    - #### process

          public final T process(SolrClient client)
                          throws SolrServerException,
                                 IOException

      Send this request to a `SolrClient` and return the response
      Parameters:
        `client` - the SolrClient to communicate with
      Returns:
        the response
      Throws:
        `SolrServerException` - if there is an error on the Solr server
        `IOException` - if there is a communication error

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.