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

## Class CoreAdminRequest

- java.lang.Object
- - org.apache.solr.client.solrj.SolrRequest<CoreAdminResponse>
  - - org.apache.solr.client.solrj.request.CoreAdminRequest

All Implemented Interfaces:
  `Serializable`

Direct Known Subclasses:
  `CoreAdminRequest.Create`, `CoreAdminRequest.CreateSnapshot`, `CoreAdminRequest.DeleteSnapshot`, `CoreAdminRequest.ListSnapshots`, `CoreAdminRequest.MergeIndexes`, `CoreAdminRequest.OverrideLastPublished`, `CoreAdminRequest.RequestRecovery`, `CoreAdminRequest.RequestSyncShard`, `CoreAdminRequest.Unload`, `CoreAdminRequest.WaitForState`

    public class CoreAdminRequest
    extends SolrRequest<CoreAdminResponse>

This class is experimental and subject to change.

Since:
  solr 1.3
See Also:
  Serialized Form

### Nested Class Summary

Nested Classes
`static class` `CoreAdminRequest.Create`
`static class` `CoreAdminRequest.CreateSnapshot`
`static class` `CoreAdminRequest.DeleteSnapshot`
`static class` `CoreAdminRequest.ListSnapshots`
`static class` `CoreAdminRequest.MergeIndexes`
`static class` `CoreAdminRequest.OverrideLastPublished`
`static class` `CoreAdminRequest.RequestRecovery`
`static class` `CoreAdminRequest.RequestSyncShard`
`static class` `CoreAdminRequest.Unload`
`static class` `CoreAdminRequest.WaitForState`

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

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

### Field Summary

Fields
`protected CoreAdminParams.CoreAdminAction` `action`
`protected String` `core`
`protected boolean` `isIndexInfoNeeded`
`protected String` `other`

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

`SUPPORTED_METHODS, useBinaryV2, usev2`

### Constructor Summary

Constructors
`CoreAdminRequest()`
`CoreAdminRequest​(String path)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static CoreAdminResponse` `createCore​(String name, String instanceDir, SolrClient client)`
`static CoreAdminResponse` `createCore​(String name, String instanceDir, SolrClient client, String configFile, String schemaFile)`
`static CoreAdminResponse` `createCore​(String name, String instanceDir, SolrClient client, String configFile, String schemaFile, String dataDir, String tlogDir)`
`protected CoreAdminResponse` `createResponse​(SolrClient client)` Create a new SolrResponse to hold the response from the server
`static CoreStatus` `getCoreStatus​(String coreName, boolean getIndexInfo, SolrClient client)`
`static CoreStatus` `getCoreStatus​(String coreName, SolrClient client)`
`SolrParams` `getParams()`
`String` `getRequestType()` This method defines the type of this Solr request.
`static CoreAdminResponse` `getStatus​(String name, SolrClient client)`
`static CoreAdminResponse` `mergeIndexes​(String name, String[] indexDirs, String[] srcCores, SolrClient client)`
`static CoreAdminResponse` `reloadCore​(String name, SolrClient client)`
`static CoreAdminResponse` `renameCore​(String coreName, String newName, SolrClient client)` Rename an existing core.
`void` `setAction​(CoreAdminParams.CoreAdminAction action)`
`void` `setCoreName​(String coreName)`
`void` `setIndexInfoNeeded​(boolean isIndexInfoNeeded)`
`void` `setOtherCoreName​(String otherCoreName)`
`static CoreAdminResponse` `swapCore​(String core1, String core2, SolrClient client)` Swap two existing cores.
`static CoreAdminResponse` `unloadCore​(String name, boolean deleteIndex, boolean deleteInstanceDir, SolrClient client)`
`static CoreAdminResponse` `unloadCore​(String name, boolean deleteIndex, SolrClient client)`
`static CoreAdminResponse` `unloadCore​(String name, SolrClient client)`

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

`addHeader, getBasePath, getBasicAuthPassword, getBasicAuthUser, getCollection, getContentStreams, getContentWriter, getHeaders, 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, toString, wait, wait, wait`

### Field Detail

#### core

    protected String core

#### other

    protected String other

#### isIndexInfoNeeded

    protected boolean isIndexInfoNeeded

#### action

    protected CoreAdminParams.CoreAdminAction action

### Constructor Detail

#### CoreAdminRequest

    public CoreAdminRequest()

#### CoreAdminRequest

    public CoreAdminRequest​(String path)

### Method Detail

#### getRequestType

    public String getRequestType()

Description copied from class: `SolrRequest`
This method defines the type of this Solr request.

Specified by:
  `getRequestType` in class `SolrRequest<CoreAdminResponse>`

#### setCoreName

    public void setCoreName​(String coreName)

#### setOtherCoreName

    public final void setOtherCoreName​(String otherCoreName)

#### setIndexInfoNeeded

    public final void setIndexInfoNeeded​(boolean isIndexInfoNeeded)

#### setAction

    public void setAction​(CoreAdminParams.CoreAdminAction action)

#### getParams

    public SolrParams getParams()

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

#### createResponse

    protected CoreAdminResponse 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<CoreAdminResponse>`
Parameters:
  `client` - the `SolrClient` the request will be sent to

#### reloadCore

    public static CoreAdminResponse reloadCore​(String name,
                                               SolrClient client)
                                        throws SolrServerException,
                                               IOException

Throws:
  `SolrServerException`
  `IOException`

#### unloadCore

    public static CoreAdminResponse unloadCore​(String name,
                                               SolrClient client)
                                        throws SolrServerException,
                                               IOException

Throws:
  `SolrServerException`
  `IOException`

#### unloadCore

    public static CoreAdminResponse unloadCore​(String name,
                                               boolean deleteIndex,
                                               SolrClient client)
                                        throws SolrServerException,
                                               IOException

Throws:
  `SolrServerException`
  `IOException`

#### unloadCore

    public static CoreAdminResponse unloadCore​(String name,
                                               boolean deleteIndex,
                                               boolean deleteInstanceDir,
                                               SolrClient client)
                                        throws SolrServerException,
                                               IOException

Throws:
  `SolrServerException`
  `IOException`

#### renameCore

    public static CoreAdminResponse renameCore​(String coreName,
                                               String newName,
                                               SolrClient client)
                                        throws SolrServerException,
                                               IOException

Rename an existing core.

Throws:
  `IllegalArgumentException` - if the new core name contains invalid characters.
  `SolrServerException`
  `IOException`

#### swapCore

    public static CoreAdminResponse swapCore​(String core1,
                                             String core2,
                                             SolrClient client)
                                      throws SolrServerException,
                                             IOException

Swap two existing cores.

Parameters:
  `core1` - name of the first core
  `core2` - name of the other core
  `client` - SolrClient to use
Returns:
  response
Throws:
  `SolrServerException` - if one or both cores don't exist
  `IOException` - on IO errors

#### getCoreStatus

    public static CoreStatus getCoreStatus​(String coreName,
                                           SolrClient client)
                                    throws SolrServerException,
                                           IOException

Throws:
  `SolrServerException`
  `IOException`

#### getCoreStatus

    public static CoreStatus getCoreStatus​(String coreName,
                                           boolean getIndexInfo,
                                           SolrClient client)
                                    throws SolrServerException,
                                           IOException

Throws:
  `SolrServerException`
  `IOException`

#### getStatus

    public static CoreAdminResponse getStatus​(String name,
                                              SolrClient client)
                                       throws SolrServerException,
                                              IOException

Throws:
  `SolrServerException`
  `IOException`

#### createCore

    public static CoreAdminResponse createCore​(String name,
                                               String instanceDir,
                                               SolrClient client)
                                        throws SolrServerException,
                                               IOException

Throws:
  `SolrServerException`
  `IOException`

#### createCore

    public static CoreAdminResponse createCore​(String name,
                                               String instanceDir,
                                               SolrClient client,
                                               String configFile,
                                               String schemaFile)
                                        throws SolrServerException,
                                               IOException

Throws:
  `SolrServerException`
  `IOException`

#### createCore

    public static CoreAdminResponse createCore​(String name,
                                               String instanceDir,
                                               SolrClient client,
                                               String configFile,
                                               String schemaFile,
                                               String dataDir,
                                               String tlogDir)
                                        throws SolrServerException,
                                               IOException

Throws:
  `SolrServerException`
  `IOException`

#### mergeIndexes

    public static CoreAdminResponse mergeIndexes​(String name,
                                                 String[] indexDirs,
                                                 String[] srcCores,
                                                 SolrClient client)
                                          throws SolrServerException,
                                                 IOException

Throws:
  `SolrServerException`
  `IOException`