Search in sources :

Example 1 with SaslStormClientHandler

use of org.apache.storm.messaging.netty.SaslStormClientHandler in project storm by apache.

the class ThriftNettyClientCodec method pipelineFactory.

public ChannelPipelineFactory pipelineFactory() {
    return new ChannelPipelineFactory() {

        public ChannelPipeline getPipeline() {
            ChannelPipeline pipeline = Channels.pipeline();
            pipeline.addLast("encoder", new ThriftEncoder());
            pipeline.addLast("decoder", new ThriftDecoder());
            if (authMethod == AuthMethod.KERBEROS) {
                try {
                    LOG.debug("Adding KerberosSaslClientHandler to pacemaker client pipeline.");
                    pipeline.addLast(KERBEROS_HANDLER, new KerberosSaslClientHandler(client, storm_conf, AuthUtils.LOGIN_CONTEXT_PACEMAKER_CLIENT, host));
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            } else if (authMethod == AuthMethod.DIGEST) {
                try {
                    LOG.debug("Adding SaslStormClientHandler to pacemaker client pipeline.");
                    pipeline.addLast(SASL_HANDLER, new SaslStormClientHandler(client));
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            } else {
                client.channelReady();
            }
            pipeline.addLast("PacemakerClientHandler", new PacemakerClientHandler(client));
            return pipeline;
        }
    };
}
Also used : PacemakerClientHandler(org.apache.storm.pacemaker.PacemakerClientHandler) SaslStormClientHandler(org.apache.storm.messaging.netty.SaslStormClientHandler) IOException(java.io.IOException) ChannelPipelineFactory(org.jboss.netty.channel.ChannelPipelineFactory) KerberosSaslClientHandler(org.apache.storm.messaging.netty.KerberosSaslClientHandler) ChannelPipeline(org.jboss.netty.channel.ChannelPipeline)

Aggregations

IOException (java.io.IOException)1 KerberosSaslClientHandler (org.apache.storm.messaging.netty.KerberosSaslClientHandler)1 SaslStormClientHandler (org.apache.storm.messaging.netty.SaslStormClientHandler)1 PacemakerClientHandler (org.apache.storm.pacemaker.PacemakerClientHandler)1 ChannelPipeline (org.jboss.netty.channel.ChannelPipeline)1 ChannelPipelineFactory (org.jboss.netty.channel.ChannelPipelineFactory)1