From be2f18446bfe54f763517a3fc57b878b10dd9182 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=CC=88rg=20Prante?= Date: Sun, 24 May 2020 08:37:47 +0200 Subject: [PATCH] rename native client to basic client --- elx-api/src/main/java/org/xbib/elx/api/AdminClient.java | 2 +- .../xbib/elx/api/{NativeClient.java => BasicClient.java} | 3 +-- elx-api/src/main/java/org/xbib/elx/api/BulkClient.java | 2 +- elx-api/src/main/java/org/xbib/elx/api/SearchClient.java | 2 +- .../java/org/xbib/elx/common/AbstractAdminClient.java | 2 +- ...AbstractNativeClient.java => AbstractBasicClient.java} | 8 ++++---- .../main/java/org/xbib/elx/common/AbstractBulkClient.java | 2 +- .../java/org/xbib/elx/common/AbstractSearchClient.java | 2 +- .../src/main/java/org/xbib/elx/common/ClientBuilder.java | 4 ++-- 9 files changed, 13 insertions(+), 14 deletions(-) rename elx-api/src/main/java/org/xbib/elx/api/{NativeClient.java => BasicClient.java} (95%) rename elx-common/src/main/java/org/xbib/elx/common/{AbstractNativeClient.java => AbstractBasicClient.java} (98%) diff --git a/elx-api/src/main/java/org/xbib/elx/api/AdminClient.java b/elx-api/src/main/java/org/xbib/elx/api/AdminClient.java index fdfcb89..d43a89a 100644 --- a/elx-api/src/main/java/org/xbib/elx/api/AdminClient.java +++ b/elx-api/src/main/java/org/xbib/elx/api/AdminClient.java @@ -10,7 +10,7 @@ import java.util.concurrent.TimeUnit; /** * Interface for extended managing and indexing methods of an Elasticsearch client. */ -public interface AdminClient extends NativeClient { +public interface AdminClient extends BasicClient { /** * Build index definition from settings. diff --git a/elx-api/src/main/java/org/xbib/elx/api/NativeClient.java b/elx-api/src/main/java/org/xbib/elx/api/BasicClient.java similarity index 95% rename from elx-api/src/main/java/org/xbib/elx/api/NativeClient.java rename to elx-api/src/main/java/org/xbib/elx/api/BasicClient.java index 243be58..9b9b4b5 100644 --- a/elx-api/src/main/java/org/xbib/elx/api/NativeClient.java +++ b/elx-api/src/main/java/org/xbib/elx/api/BasicClient.java @@ -4,10 +4,9 @@ import org.elasticsearch.client.ElasticsearchClient; import org.elasticsearch.common.settings.Settings; import java.io.Closeable; import java.io.IOException; -import java.util.Map; import java.util.concurrent.TimeUnit; -public interface NativeClient extends Closeable { +public interface BasicClient extends Closeable { /** * Set an Elasticsearch client to extend from it. May be null for TransportClient. diff --git a/elx-api/src/main/java/org/xbib/elx/api/BulkClient.java b/elx-api/src/main/java/org/xbib/elx/api/BulkClient.java index 5f21d14..e7ffc59 100644 --- a/elx-api/src/main/java/org/xbib/elx/api/BulkClient.java +++ b/elx-api/src/main/java/org/xbib/elx/api/BulkClient.java @@ -11,7 +11,7 @@ import java.io.IOException; import java.util.Map; import java.util.concurrent.TimeUnit; -public interface BulkClient extends NativeClient, Flushable { +public interface BulkClient extends BasicClient, Flushable { /** * Get bulk metric. diff --git a/elx-api/src/main/java/org/xbib/elx/api/SearchClient.java b/elx-api/src/main/java/org/xbib/elx/api/SearchClient.java index 6c07bb2..3a04949 100644 --- a/elx-api/src/main/java/org/xbib/elx/api/SearchClient.java +++ b/elx-api/src/main/java/org/xbib/elx/api/SearchClient.java @@ -12,7 +12,7 @@ import java.util.Optional; import java.util.function.Consumer; import java.util.stream.Stream; -public interface SearchClient { +public interface SearchClient extends BasicClient { Optional get(Consumer getRequestBuilder); diff --git a/elx-common/src/main/java/org/xbib/elx/common/AbstractAdminClient.java b/elx-common/src/main/java/org/xbib/elx/common/AbstractAdminClient.java index a1c9f18..b2ea2ac 100644 --- a/elx-common/src/main/java/org/xbib/elx/common/AbstractAdminClient.java +++ b/elx-common/src/main/java/org/xbib/elx/common/AbstractAdminClient.java @@ -87,7 +87,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; -public abstract class AbstractAdminClient extends AbstractNativeClient implements AdminClient { +public abstract class AbstractAdminClient extends AbstractBasicClient implements AdminClient { private static final Logger logger = LogManager.getLogger(AbstractAdminClient.class.getName()); diff --git a/elx-common/src/main/java/org/xbib/elx/common/AbstractNativeClient.java b/elx-common/src/main/java/org/xbib/elx/common/AbstractBasicClient.java similarity index 98% rename from elx-common/src/main/java/org/xbib/elx/common/AbstractNativeClient.java rename to elx-common/src/main/java/org/xbib/elx/common/AbstractBasicClient.java index 71de04c..0187b95 100644 --- a/elx-common/src/main/java/org/xbib/elx/common/AbstractNativeClient.java +++ b/elx-common/src/main/java/org/xbib/elx/common/AbstractBasicClient.java @@ -23,14 +23,14 @@ import org.elasticsearch.cluster.health.ClusterHealthStatus; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.index.query.QueryBuilders; -import org.xbib.elx.api.NativeClient; +import org.xbib.elx.api.BasicClient; import java.io.IOException; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; -public abstract class AbstractNativeClient implements NativeClient { +public abstract class AbstractBasicClient implements BasicClient { - private static final Logger logger = LogManager.getLogger(AbstractNativeClient.class.getName()); + private static final Logger logger = LogManager.getLogger(AbstractBasicClient.class.getName()); /** * The one and only index type name used in the extended client. @@ -44,7 +44,7 @@ public abstract class AbstractNativeClient implements NativeClient { private final AtomicBoolean closed; - public AbstractNativeClient() { + public AbstractBasicClient() { closed = new AtomicBoolean(false); } diff --git a/elx-common/src/main/java/org/xbib/elx/common/AbstractBulkClient.java b/elx-common/src/main/java/org/xbib/elx/common/AbstractBulkClient.java index a384554..d2adf36 100644 --- a/elx-common/src/main/java/org/xbib/elx/common/AbstractBulkClient.java +++ b/elx-common/src/main/java/org/xbib/elx/common/AbstractBulkClient.java @@ -30,7 +30,7 @@ import java.util.Map; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; -public abstract class AbstractBulkClient extends AbstractNativeClient implements BulkClient { +public abstract class AbstractBulkClient extends AbstractBasicClient implements BulkClient { private static final Logger logger = LogManager.getLogger(AbstractBulkClient.class.getName()); diff --git a/elx-common/src/main/java/org/xbib/elx/common/AbstractSearchClient.java b/elx-common/src/main/java/org/xbib/elx/common/AbstractSearchClient.java index fc37ec9..4dfd3b7 100644 --- a/elx-common/src/main/java/org/xbib/elx/common/AbstractSearchClient.java +++ b/elx-common/src/main/java/org/xbib/elx/common/AbstractSearchClient.java @@ -28,7 +28,7 @@ import java.util.function.Predicate; import java.util.stream.Stream; import java.util.stream.StreamSupport; -public abstract class AbstractSearchClient extends AbstractNativeClient implements SearchClient { +public abstract class AbstractSearchClient extends AbstractBasicClient implements SearchClient { @Override public Optional get(Consumer getRequestBuilderConsumer) { diff --git a/elx-common/src/main/java/org/xbib/elx/common/ClientBuilder.java b/elx-common/src/main/java/org/xbib/elx/common/ClientBuilder.java index 5502e9e..6e4fca4 100644 --- a/elx-common/src/main/java/org/xbib/elx/common/ClientBuilder.java +++ b/elx-common/src/main/java/org/xbib/elx/common/ClientBuilder.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.common.unit.TimeValue; import org.xbib.elx.api.AdminClientProvider; import org.xbib.elx.api.BulkClientProvider; -import org.xbib.elx.api.NativeClient; +import org.xbib.elx.api.BasicClient; import org.xbib.elx.api.SearchClientProvider; import java.io.IOException; @@ -107,7 +107,7 @@ public class ClientBuilder { } @SuppressWarnings("unchecked") - public C build() throws IOException { + public C build() throws IOException { Settings settings = settingsBuilder.build(); logger.log(Level.INFO, "settings = " + settings.toDelimitedString(',')); if (adminClientProvider != null) {