diff --git a/client/src/main/java/org/elasticsearch/client/RestClient.java b/client/src/main/java/org/elasticsearch/client/RestClient.java index a9150119667..35af2723267 100644 --- a/client/src/main/java/org/elasticsearch/client/RestClient.java +++ b/client/src/main/java/org/elasticsearch/client/RestClient.java @@ -33,9 +33,9 @@ public final class RestClient implements Closeable { this.transport = new Transport<>(client, connectionPool, maxRetryTimeout); } - public ElasticsearchResponse performRequest(Verb verb, String endpoint, Map params, HttpEntity entity) + public ElasticsearchResponse performRequest(String method, String endpoint, Map params, HttpEntity entity) throws IOException { - return transport.performRequest(verb, endpoint, params, entity); + return transport.performRequest(method, endpoint, params, entity); } @Override diff --git a/client/src/main/java/org/elasticsearch/client/RetryTimeoutException.java b/client/src/main/java/org/elasticsearch/client/RetryTimeoutException.java deleted file mode 100644 index 632597bfa37..00000000000 --- a/client/src/main/java/org/elasticsearch/client/RetryTimeoutException.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.elasticsearch.client; - -import java.io.IOException; - -public class RetryTimeoutException extends IOException { - - RetryTimeoutException(String message) { - super(message); - } -} diff --git a/client/src/main/java/org/elasticsearch/client/Transport.java b/client/src/main/java/org/elasticsearch/client/Transport.java index 8898cf6714f..88bf1bf6c7a 100644 --- a/client/src/main/java/org/elasticsearch/client/Transport.java +++ b/client/src/main/java/org/elasticsearch/client/Transport.java @@ -88,7 +88,7 @@ final class Transport implements Closeable { long timeElapsed = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startTime); long timeout = retryTimeout - timeElapsed; if (timeout <= 0) { - RetryTimeoutException retryTimeoutException = new RetryTimeoutException( + IOException retryTimeoutException = new IOException( "request retries exceeded max retry timeout [" + retryTimeout + "]"); retryTimeoutException.addSuppressed(lastSeenException); throw retryTimeoutException; diff --git a/client/src/main/java/org/elasticsearch/client/Verb.java b/client/src/main/java/org/elasticsearch/client/Verb.java deleted file mode 100644 index 74a88353977..00000000000 --- a/client/src/main/java/org/elasticsearch/client/Verb.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.elasticsearch.client; - -/** - * Holds the http verbs/methods supported by elasticsearch, which can be used when sending a request - */ -public enum Verb { - DELETE, GET, HEAD, POST, PUT -}