Call validate in TransportClients before request is send

This commit is contained in:
Simon Willnauer 2013-09-21 21:44:35 +02:00
parent c8192dd1f2
commit cadbcfeb24
1 changed files with 5 additions and 0 deletions

View File

@ -60,6 +60,11 @@ public class TransportActionNodeProxy<Request extends ActionRequest, Response ex
}
public void execute(DiscoveryNode node, final Request request, final ActionListener<Response> listener) {
ActionRequestValidationException validationException = request.validate();
if (validationException != null) {
listener.onFailure(validationException);
return;
}
transportService.sendRequest(node, action.name(), request, transportOptions, new BaseTransportResponseHandler<Response>() {
@Override
public Response newInstance() {