All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.elasticsearch.client.internal.ElasticsearchClient Maven / Gradle / Ivy

There is a newer version: 8.13.4
Show newest version
/*
 * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
 * or more contributor license agreements. Licensed under the Elastic License
 * 2.0 and the Server Side Public License, v 1; you may not use this file except
 * in compliance with, at your election, the Elastic License 2.0 or the Server
 * Side Public License, v 1.
 */

package org.elasticsearch.client.internal;

import org.elasticsearch.action.ActionFuture;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.ActionType;
import org.elasticsearch.threadpool.ThreadPool;

public interface ElasticsearchClient {

    /**
     * Executes a generic action, denoted by an {@link ActionType}.
     *
     * @param action           The action type to execute.
     * @param request          The action request.
     * @param         The request type.
     * @param        the response type.
     * @return A future allowing to get back the response.
     */
     ActionFuture execute(
        ActionType action,
        Request request
    );

    /**
     * Executes a generic action, denoted by an {@link ActionType}.
     *
     * @param action           The action type to execute.
     * @param request          The action request.
     * @param listener         The listener to receive the response back.
     * @param         The request type.
     * @param        The response type.
     */
     void execute(
        ActionType action,
        Request request,
        ActionListener listener
    );

    /**
     * Returns the threadpool used to execute requests on this client
     */
    ThreadPool threadPool();

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy