Package org.apache.solr.client.solrj.request

## Class CollectionRequiringSolrRequest<T extends SolrResponse>

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

All Implemented Interfaces:
  `Serializable`

Direct Known Subclasses:
  `AbstractSchemaRequest`, `AbstractUpdateRequest`, `DirectXmlRequest`, `DocumentAnalysisRequest`, `FieldAnalysisRequest`, `LukeRequest`, `QueryRequest`, `SolrPing`

    public abstract class CollectionRequiringSolrRequest<T extends SolrResponse>
    extends SolrRequest<T>

Parent `SolrRequest` class that requires a target collection or core.

See Also:
  Serialized Form

### Nested Class Summary

### Nested classes/interfaces inherited from class org.apache.solr.client.solrj.SolrRequest

`SolrRequest.METHOD, SolrRequest.SolrClientContext, SolrRequest.SolrRequestType`

### Field Summary

### Fields inherited from class org.apache.solr.client.solrj.SolrRequest

`SUPPORTED_METHODS, useBinaryV2, usev2`

### Constructor Summary

Constructors
`CollectionRequiringSolrRequest​(SolrRequest.METHOD m, String path)`

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `requiresCollection()` Determines whether this request should use or ignore any specified collections (esp.

### Methods inherited from class org.apache.solr.client.solrj.SolrRequest

`addHeader, addHeaders, createResponse, getBasePath, getBasicAuthPassword, getBasicAuthUser, getCollection, getContentStreams, getContentWriter, getHeaders, getMethod, getParams, getPath, getPreferredNodes, getQueryParams, getRequestType, getResponseParser, getStreamingResponseCallback, getUserPrincipal, process, process, setBasePath, setBasicAuthCredentials, setMethod, setPath, setPreferredNodes, setQueryParams, setResponseParser, setStreamingResponseCallback, setUseBinaryV2, setUserPrincipal, setUseV2`

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

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

### Constructor Detail

#### CollectionRequiringSolrRequest

    public CollectionRequiringSolrRequest​(SolrRequest.METHOD m,
                                          String path)

### Method Detail

#### requiresCollection

    public boolean requiresCollection()

Description copied from class: `SolrRequest`
Determines whether this request should use or ignore any specified collections (esp. `SolrClient.defaultCollection`)

Many Solr requests target a particular core or collection. But not all of them - many Solr APIs (e.g. security or other admin APIs) are agnostic of collections entirely. This method gives these requests a way to opt out of using `SolrClient.defaultCollection` or other specified collections.

Overrides:
  `requiresCollection` in class `SolrRequest<T extends SolrResponse>`