Package org.elasticsearch.client
Class TasksClient
- java.lang.Object
-
- org.elasticsearch.client.TasksClient
-
public final class TasksClient extends Object
A wrapper for theRestHighLevelClientthat provides methods for accessing the Tasks API.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CancelTasksResponsecancel(CancelTasksRequest cancelTasksRequest, RequestOptions options)Cancel one or more cluster tasks using the Task Management API.CancellablecancelAsync(CancelTasksRequest cancelTasksRequest, RequestOptions options, ActionListener<CancelTasksResponse> listener)Asynchronously cancel one or more cluster tasks using the Task Management API.Optional<GetTaskResponse>get(GetTaskRequest request, RequestOptions options)Get a task using the Task Management API.CancellablegetAsync(GetTaskRequest request, RequestOptions options, ActionListener<Optional<GetTaskResponse>> listener)Get a task using the Task Management API.ListTasksResponselist(ListTasksRequest request, RequestOptions options)Get current tasks using the Task Management API.CancellablelistAsync(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 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.DEFAULTif nothing needs to be customized- Returns:
- the response
- Throws:
IOException- in case there is a problem sending the request or parsing back the response
-
listAsync
public Cancellable 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.DEFAULTif nothing needs to be customizedlistener- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
get
public Optional<GetTaskResponse> get(GetTaskRequest request, RequestOptions options) throws 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.DEFAULTif nothing needs to be customized- Returns:
- the response
- Throws:
IOException- in case there is a problem sending the request or parsing back the response
-
getAsync
public Cancellable getAsync(GetTaskRequest request, RequestOptions options, ActionListener<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.DEFAULTif nothing needs to be customizedlistener- an actionlistener that takes an optional response (404s are returned as an empty Optional)- Returns:
- cancellable that may be used to cancel the request
-
cancel
public CancelTasksResponse cancel(CancelTasksRequest cancelTasksRequest, RequestOptions options) throws 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.DEFAULTif nothing needs to be customized- Returns:
- the response
- Throws:
IOException- in case there is a problem sending the request or parsing back the response
-
cancelAsync
public Cancellable 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.DEFAULTif nothing needs to be customizedlistener- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
-