Skip to content

RestHighLevelClient cannot be sub classed outside of the org.elasticsearch.client package. #26455

@tsachev

Description

@tsachev

Elasticsearch High Level REST Client version 5.6.0-SNAPSHOT

Description of the problem including expected versus actual behavior:

RestHighLevelClient javadoc states that

Can be sub-classed to expose additional client methods that make use of endpoints added to Elasticsearch through plugins, or to add support for custom response sections, again added to Elasticsearch through plugins.

I would expect to be able to call all the protected methods if I am sub-classing from another package, but actually I currently need access to the Request class in order to do so.

I am not willing to write my extension code in org.elasticsearch.client package in order to be able to extend it. The public/protected API should be sufficient to do so in my own package.

Steps to reproduce:
There are two test cases that shows that RestHighLevelClient can be extended (RestHighLevelClientExtTests and CustomRestHighLevelClientTests), but the subclasses (RestHighLevelClientExt and CustomRestClient) are defined in the same package as RestHighLevelClient, if you move them in another package they no longer compile.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions