Class CoreAdminAPIBase

    • 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.

        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.
        the supplied T solrJerseyResponse