listener, Header... headers) {
performRequestAsyncAndParseEntity(indexRequest, Request::index, IndexResponse::fromXContent, listener, emptySet(), headers);
}
@@ -324,7 +324,7 @@ public class RestHighLevelClient implements Closeable {
*
* See Update API on elastic.co
*/
- public UpdateResponse update(UpdateRequest updateRequest, Header... headers) throws IOException {
+ public final UpdateResponse update(UpdateRequest updateRequest, Header... headers) throws IOException {
return performRequestAndParseEntity(updateRequest, Request::update, UpdateResponse::fromXContent, emptySet(), headers);
}
@@ -333,7 +333,7 @@ public class RestHighLevelClient implements Closeable {
*
* See Update API on elastic.co
*/
- public void updateAsync(UpdateRequest updateRequest, ActionListener listener, Header... headers) {
+ public final void updateAsync(UpdateRequest updateRequest, ActionListener listener, Header... headers) {
performRequestAsyncAndParseEntity(updateRequest, Request::update, UpdateResponse::fromXContent, listener, emptySet(), headers);
}
@@ -342,7 +342,7 @@ public class RestHighLevelClient implements Closeable {
*
* See Delete API on elastic.co
*/
- public DeleteResponse delete(DeleteRequest deleteRequest, Header... headers) throws IOException {
+ public final DeleteResponse delete(DeleteRequest deleteRequest, Header... headers) throws IOException {
return performRequestAndParseEntity(deleteRequest, Request::delete, DeleteResponse::fromXContent, Collections.singleton(404),
headers);
}
@@ -352,7 +352,7 @@ public class RestHighLevelClient implements Closeable {
*
* See Delete API on elastic.co
*/
- public void deleteAsync(DeleteRequest deleteRequest, ActionListener listener, Header... headers) {
+ public final void deleteAsync(DeleteRequest deleteRequest, ActionListener listener, Header... headers) {
performRequestAsyncAndParseEntity(deleteRequest, Request::delete, DeleteResponse::fromXContent, listener,
Collections.singleton(404), headers);
}
@@ -362,7 +362,7 @@ public class RestHighLevelClient implements Closeable {
*
* See Search API on elastic.co
*/
- public SearchResponse search(SearchRequest searchRequest, Header... headers) throws IOException {
+ public final SearchResponse search(SearchRequest searchRequest, Header... headers) throws IOException {
return performRequestAndParseEntity(searchRequest, Request::search, SearchResponse::fromXContent, emptySet(), headers);
}
@@ -371,7 +371,7 @@ public class RestHighLevelClient implements Closeable {
*
* See Search API on elastic.co
*/
- public void searchAsync(SearchRequest searchRequest, ActionListener listener, Header... headers) {
+ public final void searchAsync(SearchRequest searchRequest, ActionListener listener, Header... headers) {
performRequestAsyncAndParseEntity(searchRequest, Request::search, SearchResponse::fromXContent, listener, emptySet(), headers);
}
@@ -381,7 +381,7 @@ public class RestHighLevelClient implements Closeable {
* See Search Scroll
* API on elastic.co
*/
- public SearchResponse searchScroll(SearchScrollRequest searchScrollRequest, Header... headers) throws IOException {
+ public final SearchResponse searchScroll(SearchScrollRequest searchScrollRequest, Header... headers) throws IOException {
return performRequestAndParseEntity(searchScrollRequest, Request::searchScroll, SearchResponse::fromXContent, emptySet(), headers);
}
@@ -391,7 +391,8 @@ public class RestHighLevelClient implements Closeable {
* See Search Scroll
* API on elastic.co
*/
- public void searchScrollAsync(SearchScrollRequest searchScrollRequest, ActionListener listener, Header... headers) {
+ public final void searchScrollAsync(SearchScrollRequest searchScrollRequest,
+ ActionListener listener, Header... headers) {
performRequestAsyncAndParseEntity(searchScrollRequest, Request::searchScroll, SearchResponse::fromXContent,
listener, emptySet(), headers);
}
@@ -402,7 +403,7 @@ public class RestHighLevelClient implements Closeable {
* See
* Clear Scroll API on elastic.co
*/
- public ClearScrollResponse clearScroll(ClearScrollRequest clearScrollRequest, Header... headers) throws IOException {
+ public final ClearScrollResponse clearScroll(ClearScrollRequest clearScrollRequest, Header... headers) throws IOException {
return performRequestAndParseEntity(clearScrollRequest, Request::clearScroll, ClearScrollResponse::fromXContent,
emptySet(), headers);
}
@@ -413,19 +414,20 @@ public class RestHighLevelClient implements Closeable {
* See
* Clear Scroll API on elastic.co
*/
- public void clearScrollAsync(ClearScrollRequest clearScrollRequest, ActionListener listener, Header... headers) {
+ public final void clearScrollAsync(ClearScrollRequest clearScrollRequest,
+ ActionListener listener, Header... headers) {
performRequestAsyncAndParseEntity(clearScrollRequest, Request::clearScroll, ClearScrollResponse::fromXContent,
listener, emptySet(), headers);
}
- protected Resp performRequestAndParseEntity(Req request,
+ protected final Resp performRequestAndParseEntity(Req request,
CheckedFunction requestConverter,
CheckedFunction entityParser,
Set ignores, Header... headers) throws IOException {
return performRequest(request, requestConverter, (response) -> parseEntity(response.getEntity(), entityParser), ignores, headers);
}
- protected Resp performRequest(Req request,
+ protected final Resp performRequest(Req request,
CheckedFunction requestConverter,
CheckedFunction responseConverter,
Set ignores, Header... headers) throws IOException {
@@ -459,7 +461,7 @@ public class RestHighLevelClient implements Closeable {
}
}
- protected void performRequestAsyncAndParseEntity(Req request,
+ protected final void performRequestAsyncAndParseEntity(Req request,
CheckedFunction requestConverter,
CheckedFunction entityParser,
ActionListener listener, Set ignores, Header... headers) {
@@ -467,7 +469,7 @@ public class RestHighLevelClient implements Closeable {
listener, ignores, headers);
}
- protected void performRequestAsync(Req request,
+ protected final void performRequestAsync(Req request,
CheckedFunction requestConverter,
CheckedFunction responseConverter,
ActionListener listener, Set ignores, Header... headers) {
@@ -488,7 +490,7 @@ public class RestHighLevelClient implements Closeable {
client.performRequestAsync(req.getMethod(), req.getEndpoint(), req.getParameters(), req.getEntity(), responseListener, headers);
}
- ResponseListener wrapResponseListener(CheckedFunction responseConverter,
+ final ResponseListener wrapResponseListener(CheckedFunction responseConverter,
ActionListener actionListener, Set ignores) {
return new ResponseListener() {
@Override
@@ -533,7 +535,7 @@ public class RestHighLevelClient implements Closeable {
* that wraps the original {@link ResponseException}. The potential exception obtained while parsing is added to the returned
* exception as a suppressed exception. This method is guaranteed to not throw any exception eventually thrown while parsing.
*/
- protected ElasticsearchStatusException parseResponseException(ResponseException responseException) {
+ protected final ElasticsearchStatusException parseResponseException(ResponseException responseException) {
Response response = responseException.getResponse();
HttpEntity entity = response.getEntity();
ElasticsearchStatusException elasticsearchException;
@@ -553,7 +555,7 @@ public class RestHighLevelClient implements Closeable {
return elasticsearchException;
}
- protected Resp parseEntity(final HttpEntity entity,
+ protected final Resp parseEntity(final HttpEntity entity,
final CheckedFunction entityParser) throws IOException {
if (entity == null) {
throw new IllegalStateException("Response body expected but not returned");