19
19
20
20
package org .elasticsearch .client ;
21
21
22
- import org .apache .http .Header ;
23
22
import org .elasticsearch .action .ActionListener ;
24
23
import org .elasticsearch .action .ingest .DeletePipelineRequest ;
25
24
import org .elasticsearch .action .ingest .GetPipelineRequest ;
@@ -45,70 +44,85 @@ public final class IngestClient {
45
44
}
46
45
47
46
/**
48
- * Add a pipeline or update an existing pipeline
49
- * <p>
47
+ * Add a pipeline or update an existing pipeline.
50
48
* See
51
49
* <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/put-pipeline-api.html"> Put Pipeline API on elastic.co</a>
50
+ * @param request the request
51
+ * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
52
+ * @return the response
53
+ * @throws IOException in case there is a problem sending the request or parsing back the response
52
54
*/
53
- public WritePipelineResponse putPipeline (PutPipelineRequest request , Header ... headers ) throws IOException {
54
- return restHighLevelClient .performRequestAndParseEntity ( request , RequestConverters ::putPipeline ,
55
- WritePipelineResponse ::fromXContent , emptySet (), headers );
55
+ public WritePipelineResponse putPipeline (PutPipelineRequest request , RequestOptions options ) throws IOException {
56
+ return restHighLevelClient .performRequestAndParseEntity ( request , RequestConverters ::putPipeline , options ,
57
+ WritePipelineResponse ::fromXContent , emptySet ());
56
58
}
57
59
58
60
/**
59
- * Asynchronously add a pipeline or update an existing pipeline
60
- * <p>
61
+ * Asynchronously add a pipeline or update an existing pipeline.
61
62
* See
62
63
* <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/put-pipeline-api.html"> Put Pipeline API on elastic.co</a>
64
+ * @param request the request
65
+ * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
66
+ * @param listener the listener to be notified upon request completion
63
67
*/
64
- public void putPipelineAsync (PutPipelineRequest request , ActionListener <WritePipelineResponse > listener , Header ... headers ) {
65
- restHighLevelClient .performRequestAsyncAndParseEntity ( request , RequestConverters ::putPipeline ,
66
- WritePipelineResponse ::fromXContent , listener , emptySet (), headers );
68
+ public void putPipelineAsync (PutPipelineRequest request , RequestOptions options , ActionListener <WritePipelineResponse > listener ) {
69
+ restHighLevelClient .performRequestAsyncAndParseEntity ( request , RequestConverters ::putPipeline , options ,
70
+ WritePipelineResponse ::fromXContent , listener , emptySet ());
67
71
}
68
72
69
73
/**
70
- * Get an existing pipeline
71
- * <p>
74
+ * Get an existing pipeline.
72
75
* See
73
76
* <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/get-pipeline-api.html"> Get Pipeline API on elastic.co</a>
77
+ * @param request the request
78
+ * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
79
+ * @return the response
80
+ * @throws IOException in case there is a problem sending the request or parsing back the response
74
81
*/
75
- public GetPipelineResponse getPipeline (GetPipelineRequest request , Header ... headers ) throws IOException {
76
- return restHighLevelClient .performRequestAndParseEntity ( request , RequestConverters ::getPipeline ,
77
- GetPipelineResponse ::fromXContent , emptySet (), headers );
82
+ public GetPipelineResponse getPipeline (GetPipelineRequest request , RequestOptions options ) throws IOException {
83
+ return restHighLevelClient .performRequestAndParseEntity ( request , RequestConverters ::getPipeline , options ,
84
+ GetPipelineResponse ::fromXContent , emptySet ());
78
85
}
79
86
80
87
/**
81
- * Asynchronously get an existing pipeline
82
- * <p>
88
+ * Asynchronously get an existing pipeline.
83
89
* See
84
90
* <a href="https://www.elastic.co/guide/en/elasticsearch/reference/master/get-pipeline-api.html"> Get Pipeline API on elastic.co</a>
91
+ * @param request the request
92
+ * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
93
+ * @param listener the listener to be notified upon request completion
85
94
*/
86
- public void getPipelineAsync (GetPipelineRequest request , ActionListener <GetPipelineResponse > listener , Header ... headers ) {
87
- restHighLevelClient .performRequestAsyncAndParseEntity ( request , RequestConverters ::getPipeline ,
88
- GetPipelineResponse ::fromXContent , listener , emptySet (), headers );
95
+ public void getPipelineAsync (GetPipelineRequest request , RequestOptions options , ActionListener <GetPipelineResponse > listener ) {
96
+ restHighLevelClient .performRequestAsyncAndParseEntity ( request , RequestConverters ::getPipeline , options ,
97
+ GetPipelineResponse ::fromXContent , listener , emptySet ());
89
98
}
90
99
91
100
/**
92
- * Delete an existing pipeline
93
- * <p>
101
+ * Delete an existing pipeline.
94
102
* See
95
103
* <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-pipeline-api.html">
96
104
* Delete Pipeline API on elastic.co</a>
105
+ * @param request the request
106
+ * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
107
+ * @return the response
108
+ * @throws IOException in case there is a problem sending the request or parsing back the response
97
109
*/
98
- public WritePipelineResponse deletePipeline (DeletePipelineRequest request , Header ... headers ) throws IOException {
99
- return restHighLevelClient .performRequestAndParseEntity ( request , RequestConverters ::deletePipeline ,
100
- WritePipelineResponse ::fromXContent , emptySet (), headers );
110
+ public WritePipelineResponse deletePipeline (DeletePipelineRequest request , RequestOptions options ) throws IOException {
111
+ return restHighLevelClient .performRequestAndParseEntity ( request , RequestConverters ::deletePipeline , options ,
112
+ WritePipelineResponse ::fromXContent , emptySet ());
101
113
}
102
114
103
115
/**
104
- * Asynchronously delete an existing pipeline
105
- * <p>
116
+ * Asynchronously delete an existing pipeline.
106
117
* See
107
118
* <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-pipeline-api.html">
108
119
* Delete Pipeline API on elastic.co</a>
120
+ * @param request the request
121
+ * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
122
+ * @param listener the listener to be notified upon request completion
109
123
*/
110
- public void deletePipelineAsync (DeletePipelineRequest request , ActionListener <WritePipelineResponse > listener , Header ... headers ) {
111
- restHighLevelClient .performRequestAsyncAndParseEntity ( request , RequestConverters ::deletePipeline ,
112
- WritePipelineResponse ::fromXContent , listener , emptySet (), headers );
124
+ public void deletePipelineAsync (DeletePipelineRequest request , RequestOptions options , ActionListener <WritePipelineResponse > listener ) {
125
+ restHighLevelClient .performRequestAsyncAndParseEntity ( request , RequestConverters ::deletePipeline , options ,
126
+ WritePipelineResponse ::fromXContent , listener , emptySet ());
113
127
}
114
128
}
0 commit comments