[FEATURE] Refactor all sendFooRequest(TransportService transportService) calls into SDKTransportService #585
Labels
CCI
Part of the College Contributor Initiative
enhancement
New feature or request
good first issue
Good for newcomers
more-challenging
Good issues for new contributors that present a small challenge
Is your feature request related to a problem?
While
SDKClient
handles REST calls to OpenSearch, the Proxy action implementation (see #525) requires transport action calls to OpenSearch, and thus requireTransportService
andOpenSearchNode
objects.The TransportService is initialized as part of the
run()
method after instantiation.The
OpenSearchNode
isn't initialized until the ExtensionsRunner connects to OpenSearch.Chicken, meet egg.
What solution would you like?
We need some sort of holder class that can be sent to the actions during ExtensionsRunner initialization and dependency injection. As part of work on #525 I've currently written an
SDKTransportService
class that works nicely for this purpose. With a setter, it can hold the (initialized) TransportService and OpenSearchNode (and UniqueId, too!) and greatly simplify these calls, particularly:transportService
is included as a parameter is for unit tests. That can be removed and tests can access the setter on the wrapper class to serve the same purpose.getExtensionTransportService()
getter, as well as getters for the OpenSearchNode and UniqueId, which could be moved to this class (they are rarely used outside these transport calls).What alternatives have you considered?
I tried some other existing classes as the wrapper
Do you have any additional context?
Posting this request now, but it will touch a lot of classes (including tests) and would create big conflicts if overlapping in-progress work. It should wait for completion of:
The text was updated successfully, but these errors were encountered: