30
30
import org .elasticsearch .common .io .stream .StreamInput ;
31
31
import org .elasticsearch .common .io .stream .StreamOutput ;
32
32
import org .elasticsearch .common .settings .Settings ;
33
- import org .elasticsearch .common .xcontent .StatusToXContentObject ;
33
+ import org .elasticsearch .common .xcontent .ToXContentObject ;
34
34
import org .elasticsearch .common .xcontent .XContentBuilder ;
35
35
import org .elasticsearch .rest .BaseRestHandler ;
36
36
import org .elasticsearch .rest .RestController ;
37
37
import org .elasticsearch .rest .RestRequest ;
38
- import org .elasticsearch .rest .RestStatus ;
39
- import org .elasticsearch .rest .action .RestStatusToXContentListener ;
38
+ import org .elasticsearch .rest .action .RestToXContentListener ;
40
39
import org .elasticsearch .tasks .Task ;
41
40
import org .elasticsearch .transport .TransportService ;
42
41
45
44
46
45
import static org .elasticsearch .ingest .common .IngestCommonPlugin .GROK_PATTERNS ;
47
46
import static org .elasticsearch .rest .RestRequest .Method .GET ;
48
- import static org .elasticsearch .rest .RestStatus .OK ;
49
47
50
48
public class GrokProcessorGetAction extends Action <GrokProcessorGetAction .Response > {
51
49
@@ -68,7 +66,7 @@ public ActionRequestValidationException validate() {
68
66
}
69
67
}
70
68
71
- public static class Response extends ActionResponse implements StatusToXContentObject {
69
+ public static class Response extends ActionResponse implements ToXContentObject {
72
70
private Map <String , String > grokPatterns ;
73
71
74
72
Response (Map <String , String > grokPatterns ) {
@@ -88,11 +86,6 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
88
86
return builder ;
89
87
}
90
88
91
- @ Override
92
- public RestStatus status () {
93
- return OK ;
94
- }
95
-
96
89
@ Override
97
90
public void readFrom (StreamInput in ) throws IOException {
98
91
super .readFrom (in );
@@ -136,7 +129,7 @@ public String getName() {
136
129
137
130
@ Override
138
131
protected RestChannelConsumer prepareRequest (RestRequest request , NodeClient client ) {
139
- return channel -> client .executeLocally (INSTANCE , new Request (), new RestStatusToXContentListener <>(channel ));
132
+ return channel -> client .executeLocally (INSTANCE , new Request (), new RestToXContentListener <>(channel ));
140
133
}
141
134
}
142
135
}
0 commit comments