Class CoreAdminAPIBase
java.lang.Object
org.apache.solr.api.JerseyResource
org.apache.solr.handler.admin.api.CoreAdminAPIBase
- Direct Known Subclasses:
CoreSnapshot,CoreStatus,CreateCore,CreateCoreBackup,GetNodeCommandStatus,InstallCoreData,MergeIndexes,ReloadCore,RenameCore,RestoreCore,SwapCores,UnloadCore
A common parent for admin Core Jersey-based APIs.
This base class is used when creating Core APIs to allow extra bookkeeping tasks such as async requests handling.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classHelper RuntimeException to allow passing checked exceptions to the caller of the handle method. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final CoreAdminHandler.CoreAdminAsyncTrackerprotected final CoreContainerprotected final SolrQueryRequestprotected final SolrQueryResponseFields inherited from class org.apache.solr.api.JerseyResource
containerRequestContext -
Constructor Summary
ConstructorsConstructorDescriptionCoreAdminAPIBase(CoreContainer coreContainer, CoreAdminHandler.CoreAdminAsyncTracker coreAdminAsyncTracker, SolrQueryRequest req, SolrQueryResponse rsp) -
Method Summary
Modifier and TypeMethodDescription<T extends SolrJerseyResponse>
ThandlePotentiallyAsynchronousTask(T solrJerseyResponse, String coreName, String taskId, String actionName, Supplier<T> supplier) Wraps the subclasses logic with extra bookkeeping logic.Methods inherited from class org.apache.solr.api.JerseyResource
ensureRequiredParameterProvided, ensureRequiredRequestBodyProvided, instantiateJerseyResponse, instantiateJerseyResponse
-
Field Details
-
coreContainer
-
coreAdminAsyncTracker
-
req
-
rsp
-
-
Constructor Details
-
CoreAdminAPIBase
public CoreAdminAPIBase(CoreContainer coreContainer, CoreAdminHandler.CoreAdminAsyncTracker coreAdminAsyncTracker, SolrQueryRequest req, SolrQueryResponse rsp)
-
-
Method Details
-
handlePotentiallyAsynchronousTask
public <T extends SolrJerseyResponse> T handlePotentiallyAsynchronousTask(T solrJerseyResponse, String coreName, String taskId, String actionName, Supplier<T> supplier) throws Exception Wraps the subclasses logic with extra bookkeeping logic.This method currently exists to enable async handling behavior for V2 Core APIs.
Since the logic for a given API lives inside the Supplier functional interface, checked exceptions can't be thrown directly to the calling method. To throw a checked exception out of the Supplier, wrap the exception using
CoreAdminAPIBase.CoreAdminAPIBaseExceptionand throw it instead. This handle method will retrieve the checked exception fromCoreAdminAPIBase.CoreAdminAPIBaseExceptionand throw it to the original calling method.- Parameters:
solrJerseyResponse- the response that the calling methods expects to return.coreName- the name of the core that work is being done against.taskId- an id provided for registering async work (if null, the task is executed synchronously)actionName- a name for the action being done.supplier- the work that the calling method wants done.- Returns:
- the supplied T solrJerseyResponse
- Throws:
Exception
-