org.apache.solr.client.solrj.request

## Class CollectionAdminRequest.AsyncCollectionAdminRequest

- java.lang.Object
- - org.apache.solr.client.solrj.SolrRequest<T>
  - - org.apache.solr.client.solrj.request.CollectionAdminRequest<CollectionAdminResponse>
    - - org.apache.solr.client.solrj.request.CollectionAdminRequest.AsyncCollectionAdminRequest

All Implemented Interfaces:
  Serializable, V2RequestSupport, MapSerializable, MapWriter, NavigableObject

Direct Known Subclasses:
  CollectionAdminRequest.AddReplica, CollectionAdminRequest.AsyncCollectionSpecificAdminRequest, CollectionAdminRequest.AsyncShardSpecificAdminRequest, CollectionAdminRequest.BalanceShardUnique, CollectionAdminRequest.CollectionAdminRoleRequest, CollectionAdminRequest.CreateAlias, CollectionAdminRequest.CreateTimeRoutedAlias, CollectionAdminRequest.DeleteAlias, CollectionAdminRequest.DeleteNode, CollectionAdminRequest.Migrate, CollectionAdminRequest.MigrateClusterState, CollectionAdminRequest.MoveReplica, CollectionAdminRequest.OverseerStatus, CollectionAdminRequest.RebalanceLeaders, CollectionAdminRequest.ReplaceNode, CollectionAdminRequest.SetAliasProperty, CollectionAdminRequest.SplitShard, CollectionAdminRequest.UtilizeNode

Enclosing class:
  CollectionAdminRequest<T extends CollectionAdminResponse>

    public abstract static class CollectionAdminRequest.AsyncCollectionAdminRequest
    extends CollectionAdminRequest<CollectionAdminResponse>

Base class for asynchronous collection admin requests

See Also:
  Serialized Form

### Nested Class Summary

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

`CollectionAdminRequest.AddReplica, CollectionAdminRequest.AddReplicaProp, CollectionAdminRequest.AddRole, CollectionAdminRequest.AsyncCollectionAdminRequest, CollectionAdminRequest.AsyncCollectionSpecificAdminRequest, CollectionAdminRequest.AsyncShardSpecificAdminRequest, CollectionAdminRequest.Backup, CollectionAdminRequest.BalanceShardUnique, CollectionAdminRequest.ClusterProp, CollectionAdminRequest.ClusterStatus, CollectionAdminRequest.CollectionAdminRoleRequest, CollectionAdminRequest.CollectionProp, CollectionAdminRequest.Create, CollectionAdminRequest.CreateAlias, CollectionAdminRequest.CreateShard, CollectionAdminRequest.CreateSnapshot, CollectionAdminRequest.CreateTimeRoutedAlias, CollectionAdminRequest.Delete, CollectionAdminRequest.DeleteAlias, CollectionAdminRequest.DeleteNode, CollectionAdminRequest.DeleteReplica, CollectionAdminRequest.DeleteReplicaProp, CollectionAdminRequest.DeleteShard, CollectionAdminRequest.DeleteSnapshot, CollectionAdminRequest.DeleteStatus, CollectionAdminRequest.ForceLeader, CollectionAdminRequest.List, CollectionAdminRequest.ListAliases, CollectionAdminRequest.ListSnapshots, CollectionAdminRequest.Migrate, CollectionAdminRequest.MigrateClusterState, CollectionAdminRequest.Modify, CollectionAdminRequest.MoveReplica, CollectionAdminRequest.OverseerStatus, CollectionAdminRequest.RebalanceLeaders, CollectionAdminRequest.Reload, CollectionAdminRequest.RemoveRole, CollectionAdminRequest.ReplaceNode, CollectionAdminRequest.RequestStatus, CollectionAdminRequest.RequestStatusResponse, CollectionAdminRequest.Restore, CollectionAdminRequest.SetAliasProperty, CollectionAdminRequest.ShardSpecificAdminRequest, CollectionAdminRequest.SplitShard, CollectionAdminRequest.UtilizeNode`

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

`SolrRequest.METHOD`

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

`MapWriter.EntryWriter`

### Field Summary

Fields
`protected String` `asyncId`
`protected boolean` `waitForFinalState`

### Fields inherited from class org.apache.solr.client.solrj.request.CollectionAdminRequest

`action, MODIFIABLE_COLLECTION_PROPERTIES`

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

`SUPPORTED_METHODS, useBinaryV2, usev2`

### Constructor Summary

Constructors
Constructor and Description
`AsyncCollectionAdminRequest(CollectionParams.CollectionAction action)`

### Method Summary

All Methods Instance Methods Concrete Methods
`protected CollectionAdminResponse` `createResponse(SolrClient client)` Create a new SolrResponse to hold the response from the server
`String` `getAsyncId()`
`SolrParams` `getParams()`
`RequestStatusState` `processAndWait(SolrClient client, long timeoutSeconds)` Send this request to a Solr server, and wait (up to a timeout) for the request to complete or fail
`RequestStatusState` `processAndWait(String asyncId, SolrClient client, long timeoutSeconds)` Send this request to a Solr server, and wait (up to a timeout) for the request to complete or fail
`String` `processAsync(SolrClient client)` Process this request asynchronously, generating and returning a request id
`String` `processAsync(String asyncId, SolrClient client)` Process this request asynchronously, using a specified request id
`void` `setAsyncId(String asyncId)`
`void` `setWaitForFinalState(boolean waitForFinalState)`

### Methods inherited from class org.apache.solr.client.solrj.request.CollectionAdminRequest

`addProperties, addReplicaByRouteKey, addReplicaProperty, addReplicaToShard, addReplicaToShard, addRole, backupCollection, balanceReplicaProperty, createAlias, createCollection, createCollection, createCollection, createCollectionWithImplicitRouter, createCollectionWithImplicitRouter, createShard, createTimeRoutedAlias, deleteAlias, deleteAllAsyncIds, deleteAsyncId, deleteCollection, deleteNode, deleteReplica, deleteReplica, deleteReplicaProperty, deleteReplicasFromAllShards, deleteReplicasFromShard, deleteShard, forceLeaderElection, getClusterStatus, getOverseerStatus, getV2Request, listCollections, migrateCollectionFormat, migrateData, modifyCollection, rebalanceLeaders, reloadCollection, removeRole, requestStatus, restoreCollection, setAliasProperty, setClusterProperty, setCollectionProperty, splitShard, toString, waitForAsyncRequest, writeMap`

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

`getBasePath, getBasicAuthPassword, getBasicAuthUser, getCollection, getContentStreams, getContentWriter, getMethod, getPath, getQueryParams, getResponseParser, getStreamingResponseCallback, getUserPrincipal, process, process, setBasePath, setBasicAuthCredentials, setMethod, setPath, setQueryParams, setResponseParser, setStreamingResponseCallback, setUseBinaryV2, setUserPrincipal, setUseV2`

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

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

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

`jsonStr, toMap`

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

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

### Field Detail

#### asyncId

    protected String asyncId

#### waitForFinalState

    protected boolean waitForFinalState

### Constructor Detail

#### AsyncCollectionAdminRequest

    public AsyncCollectionAdminRequest(CollectionParams.CollectionAction action)

### Method Detail

#### createResponse

    protected CollectionAdminResponse createResponse(SolrClient client)

Description copied from class: `SolrRequest`
Create a new SolrResponse to hold the response from the server

Specified by:
  `createResponse` in class `SolrRequest<CollectionAdminResponse>`
Parameters:
  `client` - the `SolrClient` the request will be sent to

#### getAsyncId

    public String getAsyncId()

#### setWaitForFinalState

    public void setWaitForFinalState(boolean waitForFinalState)

#### setAsyncId

    public void setAsyncId(String asyncId)

#### processAsync

    public String processAsync(SolrClient client)
                        throws IOException,
                               SolrServerException

Process this request asynchronously, generating and returning a request id

Parameters:
  `client` - a Solr client
Returns:
  the request id
Throws:
  `IOException`
  `SolrServerException`
See Also:
  `CollectionAdminRequest.RequestStatus`

#### processAsync

    public String processAsync(String asyncId,
                               SolrClient client)
                        throws IOException,
                               SolrServerException

Process this request asynchronously, using a specified request id

Parameters:
  `asyncId` - the request id
  `client` - a Solr client
Returns:
  the request id
Throws:
  `IOException`
  `SolrServerException`

#### processAndWait

    public RequestStatusState processAndWait(SolrClient client,
                                             long timeoutSeconds)
                                      throws SolrServerException,
                                             InterruptedException,
                                             IOException

Send this request to a Solr server, and wait (up to a timeout) for the request to complete or fail

Parameters:
  `client` - a Solr client
  `timeoutSeconds` - the maximum time to wait
Returns:
  the status of the request on completion or timeout
Throws:
  `SolrServerException`
  `InterruptedException`
  `IOException`

#### processAndWait

    public RequestStatusState processAndWait(String asyncId,
                                             SolrClient client,
                                             long timeoutSeconds)
                                      throws IOException,
                                             SolrServerException,
                                             InterruptedException

Send this request to a Solr server, and wait (up to a timeout) for the request to complete or fail

Parameters:
  `asyncId` - an id for the request
  `client` - a Solr client
  `timeoutSeconds` - the maximum time to wait
Returns:
  the status of the request on completion or timeout
Throws:
  `IOException`
  `SolrServerException`
  `InterruptedException`

#### getParams

    public SolrParams getParams()

Overrides:
  `getParams` in class `CollectionAdminRequest<CollectionAdminResponse>`