Class CoreAdminAPIBase

  • Direct Known Subclasses:
    CoreSnapshotAPI

    public abstract class CoreAdminAPIBase
    extends JerseyResource
    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.

    • Method Detail

      • 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.CoreAdminAPIBaseException and throw it instead. This handle method will retrieve the checked exception from CoreAdminAPIBase.CoreAdminAPIBaseException and 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