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

org.hibernate.search.elasticsearch.client.impl.ElasticsearchClient Maven / Gradle / Ivy

The newest version!
/*
 * Hibernate Search, full-text search for your domain model
 *
 * License: GNU Lesser General Public License (LGPL), version 2.1 or later
 * See the lgpl.txt file in the root directory or .
 */
package org.hibernate.search.elasticsearch.client.impl;

import java.io.Closeable;
import java.util.concurrent.CompletableFuture;

/**
 * An Elasticsearch client, allowing to perform requests to a remote cluster.
 *
 * @author Yoann Rodiere
 */
public interface ElasticsearchClient extends Closeable {

	/**
	 * @param request A request to execute asynchronously
	 * @return The future that will ultimately hold the response
	 * (or throw an exception if an error occurred or if the request timed out).
	 */
	CompletableFuture submit(ElasticsearchRequest request);

	/**
	 * Unwrap the client to some implementation-specific type.
	 *
	 * @param clientClass The {@link Class} representing the expected client type
	 * @return The unwrapped client.
	 * @throws org.hibernate.search.exception.SearchException if the client implementation does not support
	 * unwrapping to the given class.
	 */
	 T unwrap(Class clientClass);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy