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.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
Modifier and Type
Class
Description
`static class`
`CoreAdminRequest.Create`
`static class`
`CoreAdminRequest.CreateSnapshot`
`static class`
`CoreAdminRequest.DeleteSnapshot`
`static class`
`CoreAdminRequest.ListSnapshots`
`static class`
`CoreAdminRequest.MergeIndexes`
`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.ApiVersion, SolrRequest.METHOD, SolrRequest.SolrClientContext, SolrRequest.SolrRequestType`

## Field Summary

Fields
Modifier and Type
Field
Description
`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`

## Constructor Summary

Constructors
Constructor
Description
`CoreAdminRequest()`
`CoreAdminRequest(String path)`

## Method Summary

Modifier and Type
Method
Description
`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 ulogDir)`
`protected CoreAdminResponse`
`createResponse(NamedList<Object> namedList)`
Create a new SolrResponse to hold the response from the server.
`static CoreStatusResponse.SingleCoreData`
`getCoreStatus(String coreName, boolean getIndexInfo, SolrClient client)`
`static CoreStatusResponse.SingleCoreData`
`getCoreStatus(String coreName, SolrClient client)`
`SolrParams`
`getParams()`
The parameters for this request; never null.
`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)`
`final void`
`setIndexInfoNeeded(boolean isIndexInfoNeeded)`
`final 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, addHeaders, getApiVersion, getBasicAuthPassword, getBasicAuthUser, getCollection, getContentStreams, getContentWriter, getHeaders, getMethod, getPath, getPreferredNodes, getQueryParams, getRequestType, getResponseParser, getStreamingResponseCallback, getUserPrincipal, process, process, processWithBaseUrl, requiresCollection, 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`

## Field Details

### core

protected String core

### other

protected String other

### isIndexInfoNeeded

protected boolean isIndexInfoNeeded

### action

protected CoreAdminParams.CoreAdminAction action

## Constructor Details

### CoreAdminRequest

public CoreAdminRequest()

### CoreAdminRequest

public CoreAdminRequest(String path)

## Method Details

### 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()
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<CoreAdminResponse>`

### createResponse

protected CoreAdminResponse 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<CoreAdminResponse>`
Parameters:
  `namedList` - from `SolrClient.request(SolrRequest, String)`.

### 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 CoreStatusResponse.SingleCoreData getCoreStatus(String coreName, SolrClient client) throws SolrServerException, IOException

Throws:
  `SolrServerException`
  `IOException`

### getCoreStatus

public static CoreStatusResponse.SingleCoreData 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 ulogDir) 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`