Package org.elasticsearch.test.client
Class NoOpNodeClient
java.lang.Object
org.elasticsearch.client.support.AbstractClient
org.elasticsearch.client.node.NodeClient
org.elasticsearch.test.client.NoOpNodeClient
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Client
,ElasticsearchClient
,org.elasticsearch.core.Releasable
- Direct Known Subclasses:
RestActionTestCase.VerifyingClient
Client that always response with
null
to every request. Override doExecute(ActionType, ActionRequest, ActionListener)
,
executeLocally(ActionType, ActionRequest, ActionListener)
, or executeLocally(ActionType, ActionRequest, TaskListener)
for testing.
See also NoOpClient
if you do not specifically need a NodeClient
.-
Field Summary
Fields inherited from class org.elasticsearch.client.support.AbstractClient
logger, settings
Fields inherited from interface org.elasticsearch.client.Client
CLIENT_TYPE_SETTING_S
-
Constructor Summary
ConstructorDescriptionNoOpNodeClient
(String testName) Create a newTestThreadPool
for this client.NoOpNodeClient
(ThreadPool threadPool) Build withThreadPool
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
<Request extends ActionRequest,
Response extends ActionResponse>
voiddoExecute
(ActionType<Response> action, Request request, ActionListener<Response> listener) <Request extends ActionRequest,
Response extends ActionResponse>
TaskexecuteLocally
(ActionType<Response> action, Request request, ActionListener<Response> listener) <Request extends ActionRequest,
Response extends ActionResponse>
TaskexecuteLocally
(ActionType<Response> action, Request request, TaskListener<Response> listener) long
getRemoteClusterClient
(String clusterAlias) void
initialize
(Map<ActionType<? extends ActionResponse>, TransportAction<? extends ActionRequest, ? extends ActionResponse>> actions, Supplier<String> localNodeId, RemoteClusterService remoteClusterService, NamedWriteableRegistry namedWriteableRegistry) Methods inherited from class org.elasticsearch.client.node.NodeClient
getNamedWriteableRegistry
Methods inherited from class org.elasticsearch.client.support.AbstractClient
admin, bulk, bulk, clearScroll, clearScroll, delete, delete, execute, execute, explain, explain, fieldCaps, fieldCaps, filterWithHeader, get, get, index, index, multiGet, multiGet, multiSearch, multiSearch, multiTermVectors, multiTermVectors, prepareBulk, prepareBulk, prepareClearScroll, prepareDelete, prepareDelete, prepareExplain, prepareFieldCaps, prepareGet, prepareGet, prepareIndex, prepareIndex, prepareIndex, prepareMultiGet, prepareMultiSearch, prepareMultiTermVectors, prepareSearch, prepareSearchScroll, prepareTermVectors, prepareTermVectors, prepareUpdate, prepareUpdate, search, search, searchScroll, searchScroll, settings, termVectors, termVectors, threadPool, update, update
-
Constructor Details
-
NoOpNodeClient
-
NoOpNodeClient
-
-
Method Details
-
doExecute
public <Request extends ActionRequest,Response extends ActionResponse> void doExecute(ActionType<Response> action, Request request, ActionListener<Response> listener) - Overrides:
doExecute
in classNodeClient
-
initialize
public void initialize(Map<ActionType<? extends ActionResponse>, TransportAction<? extends ActionRequest, ? extends ActionResponse>> actions, Supplier<String> localNodeId, RemoteClusterService remoteClusterService, NamedWriteableRegistry namedWriteableRegistry) - Overrides:
initialize
in classNodeClient
-
executeLocally
public <Request extends ActionRequest,Response extends ActionResponse> Task executeLocally(ActionType<Response> action, Request request, ActionListener<Response> listener) - Overrides:
executeLocally
in classNodeClient
-
executeLocally
public <Request extends ActionRequest,Response extends ActionResponse> Task executeLocally(ActionType<Response> action, Request request, TaskListener<Response> listener) - Overrides:
executeLocally
in classNodeClient
-
getLocalNodeId
- Overrides:
getLocalNodeId
in classNodeClient
-
getRemoteClusterClient
- Specified by:
getRemoteClusterClient
in interfaceClient
- Overrides:
getRemoteClusterClient
in classNodeClient
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceorg.elasticsearch.core.Releasable
- Overrides:
close
in classNodeClient
-
getExecutionCount
public long getExecutionCount()
-