public void setupSaslHandler(ChannelPipeline p, String addAfter) throws IOException {
    String qop = (String) saslClient.getNegotiatedProperty(Sasl.QOP);
    LOG.trace("SASL client context established. Negotiated QoP {}", qop);
    verifyNegotiatedQop();
    if (qop == null || "auth".equalsIgnoreCase(qop)) {
      return;
    }
    // add wrap and unwrap handlers to pipeline.
    p.addAfter(addAfter, null, new SaslUnwrapHandler(saslClient::unwrap))
      .addAfter(addAfter, null, new LengthFieldBasedFrameDecoder(Integer.MAX_VALUE, 0, 4, 0, 4))
      .addAfter(addAfter, null, new SaslWrapHandler(saslClient::wrap));
  }
Implement SASL logic for netty rpc client.
@since 2.0.0
hbase-client/src/main/java/org/apache/hadoop/hbase/security/NettyHBaseSaslRpcClient.java