Fixes Transport Client that start up with shield in the classpath

Now a NOOP transport filter is bound by to the secured transport service in a transport client

Fixes elastic/elasticsearch#165

Original commit: elastic/x-pack-elasticsearch@7268bd445c
This commit is contained in:
uboness 2014-10-14 10:35:36 -07:00
parent ce6646df2b
commit 3d71356596
2 changed files with 3 additions and 0 deletions

View File

@ -53,6 +53,7 @@ public class SecuredTransportModule extends AbstractShieldModule.Spawn implement
if (clientMode) { if (clientMode) {
// no ip filtering on the client // no ip filtering on the client
bind(N2NNettyUpstreamHandler.class).toProvider(Providers.<N2NNettyUpstreamHandler>of(null)); bind(N2NNettyUpstreamHandler.class).toProvider(Providers.<N2NNettyUpstreamHandler>of(null));
bind(TransportFilter.class).toInstance(TransportFilter.NOOP);
return; return;
} }

View File

@ -13,6 +13,8 @@ import org.elasticsearch.transport.TransportResponse;
*/ */
public interface TransportFilter { public interface TransportFilter {
static final TransportFilter NOOP = new Base();
/** /**
* Called just before the given request is about to be sent. Any exception thrown * Called just before the given request is about to be sent. Any exception thrown
* by this method will stop the request from being sent. * by this method will stop the request from being sent.