Package org.elasticsearch.client
Class TasksClient
- java.lang.Object
-
- org.elasticsearch.client.TasksClient
-
public final class TasksClient extends java.lang.Object
A wrapper for theRestHighLevelClient
that provides methods for accessing the Tasks API.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CancelTasksResponse
cancel(CancelTasksRequest cancelTasksRequest, RequestOptions options)
Cancel one or more cluster tasks using the Task Management API.void
cancelAsync(CancelTasksRequest cancelTasksRequest, RequestOptions options, ActionListener<CancelTasksResponse> listener)
Asynchronously cancel one or more cluster tasks using the Task Management API.java.util.Optional<GetTaskResponse>
get(GetTaskRequest request, RequestOptions options)
Get a task using the Task Management API.void
getAsync(GetTaskRequest request, RequestOptions options, ActionListener<java.util.Optional<GetTaskResponse>> listener)
Get a task using the Task Management API.ListTasksResponse
list(ListTasksRequest request, RequestOptions options)
Get current tasks using the Task Management API.void
listAsync(ListTasksRequest request, RequestOptions options, ActionListener<ListTasksResponse> listener)
Asynchronously get current tasks using the Task Management API.
-
-
-
Method Detail
-
list
public ListTasksResponse list(ListTasksRequest request, RequestOptions options) throws java.io.IOException
Get current tasks using the Task Management API. See Task Management API on elastic.co- Parameters:
request
- the requestoptions
- the request options (e.g. headers), useRequestOptions.DEFAULT
if nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException
- in case there is a problem sending the request or parsing back the response
-
listAsync
public void listAsync(ListTasksRequest request, RequestOptions options, ActionListener<ListTasksResponse> listener)
Asynchronously get current tasks using the Task Management API. See Task Management API on elastic.co- Parameters:
request
- the requestoptions
- the request options (e.g. headers), useRequestOptions.DEFAULT
if nothing needs to be customizedlistener
- the listener to be notified upon request completion
-
get
public java.util.Optional<GetTaskResponse> get(GetTaskRequest request, RequestOptions options) throws java.io.IOException
Get a task using the Task Management API. See Task Management API on elastic.co- Parameters:
request
- the requestoptions
- the request options (e.g. headers), useRequestOptions.DEFAULT
if nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException
- in case there is a problem sending the request or parsing back the response
-
getAsync
public void getAsync(GetTaskRequest request, RequestOptions options, ActionListener<java.util.Optional<GetTaskResponse>> listener)
Get a task using the Task Management API. See Task Management API on elastic.co- Parameters:
request
- the requestoptions
- the request options (e.g. headers), useRequestOptions.DEFAULT
if nothing needs to be customizedlistener
- an actionlistener that takes an optional response (404s are returned as an empty Optional)
-
cancel
public CancelTasksResponse cancel(CancelTasksRequest cancelTasksRequest, RequestOptions options) throws java.io.IOException
Cancel one or more cluster tasks using the Task Management API. See Task Management API on elastic.co- Parameters:
cancelTasksRequest
- the requestoptions
- the request options (e.g. headers), useRequestOptions.DEFAULT
if nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException
- in case there is a problem sending the request or parsing back the response
-
cancelAsync
public void cancelAsync(CancelTasksRequest cancelTasksRequest, RequestOptions options, ActionListener<CancelTasksResponse> listener)
Asynchronously cancel one or more cluster tasks using the Task Management API. See Task Management API on elastic.co- Parameters:
cancelTasksRequest
- the requestoptions
- the request options (e.g. headers), useRequestOptions.DEFAULT
if nothing needs to be customizedlistener
- the listener to be notified upon request completion
-
-