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

# Class V2Request

java.lang.Object
org.apache.solr.client.solrj.SolrRequest<V2Response>
org.apache.solr.client.solrj.request.V2Request

All Implemented Interfaces:
  `Serializable`, `MapSerializable`, `MapWriter`, `NavigableObject`, `org.noggit.JSONWriter.Writable`

public class V2Request extends SolrRequest<V2Response> implements MapWriter

See Also:
  - Serialized Form

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static class`
`V2Request.Builder`

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

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

## Nested classes/interfaces inherited from interface org.apache.solr.common.MapWriter

`MapWriter.EntryWriter`

## Field Summary

Fields
Modifier and Type
Field
Description
`final boolean`
`useBinary`
`static final ThreadLocal<AtomicLong>`
`v2Calls`

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

`SUPPORTED_METHODS`

### Fields inherited from interface org.apache.solr.common.MapWriter

`EMPTY`

## Method Summary

Modifier and Type
Method
Description
`protected V2Response`
`createResponse(NamedList<Object> namedList)`
Create a new SolrResponse to hold the response from the server.
`SolrRequest.ApiVersion`
`getApiVersion()`
Indicates which API version this request will make
`String`
`getCollection()`
`RequestWriter.ContentWriter`
`getContentWriter(String s)`
If a request object wants to do a push write, implement this method.
`SolrParams`
`getParams()`
The parameters for this request; never null.
`ResponseParser`
`getResponseParser()`
`boolean`
`isForceV2()`
`boolean`
`isPerCollectionRequest()`
`boolean`
`requiresCollection()`
Determines whether this request should use or ignore any specified collections (esp.
`void`
`writeMap(MapWriter.EntryWriter ew)`
Writes this object's entries out to `ew`.

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

`addHeader, addHeaders, getBasicAuthPassword, getBasicAuthUser, getContentStreams, getHeaders, getMethod, getPath, getPreferredNodes, getQueryParams, getRequestType, getStreamingResponseCallback, getUserPrincipal, process, process, processWithBaseUrl, setBasicAuthCredentials, setMethod, setPath, setPreferredNodes, setQueryParams, setRequestType, setResponseParser, setStreamingResponseCallback, setUserPrincipal`

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

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

### Methods inherited from interface org.apache.solr.common.MapWriter

`jsonStr, toMap, write`

### Methods inherited from interface org.apache.solr.common.NavigableObject

`_forEachEntry, _forEachEntry, _forEachEntry, _get, _get, _getStr, _getStr, _size`

## Field Details

### v2Calls

public static final ThreadLocal<AtomicLong> v2Calls

### useBinary

public final boolean useBinary

## Method Details

### isForceV2

public boolean isForceV2()

### getParams

public SolrParams getParams()
Description copied from class: `SolrRequest`
The parameters for this request; never null. The runtime type may be mutable but modifications may not affect this `SolrRequest` instance, as it may return a new instance here every time. If the subclass specifies the response type as `ModifiableSolrParams`, then one can expect it to change this request. If the subclass has a setter then one can expect this method to return the value set.

Specified by:
  `getParams` in class `SolrRequest<V2Response>`

### getContentWriter

public RequestWriter.ContentWriter getContentWriter(String s)
Description copied from class: `SolrRequest`
If a request object wants to do a push write, implement this method.

Overrides:
  `getContentWriter` in class `SolrRequest<V2Response>`
Parameters:
  `s` - This is the type that the RequestWriter would like to get. But, it is OK to send any format

### isPerCollectionRequest

public boolean isPerCollectionRequest()

### 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<V2Response>`

### getCollection

public String getCollection()

Overrides:
  `getCollection` in class `SolrRequest<V2Response>`

### getApiVersion

public SolrRequest.ApiVersion getApiVersion()
Description copied from class: `SolrRequest`
Indicates which API version this request will make

Defaults implementation returns 'V1'.

Overrides:
  `getApiVersion` in class `SolrRequest<V2Response>`

### createResponse

protected V2Response createResponse(NamedList<Object> namedList)
Description copied from class: `SolrRequest`
Create a new SolrResponse to hold the response from the server. If the response extends `SolrResponse`, then there's no need to use the arguments, as `SolrResponse.setResponse(NamedList)` will be called right after this method.

Specified by:
  `createResponse` in class `SolrRequest<V2Response>`
Parameters:
  `namedList` - from `SolrClient.request(SolrRequest, String)`.

### writeMap

public void writeMap(MapWriter.EntryWriter ew) throws IOException
Description copied from interface: `MapWriter`
Writes this object's entries out to `ew`.

Specified by:
  `writeMap` in interface `MapWriter`
Throws:
  `IOException`

### getResponseParser

public ResponseParser getResponseParser()

Overrides:
  `getResponseParser` in class `SolrRequest<V2Response>`
Returns:
  The `ResponseParser`