Search in sources :

Example 6 with SetSASLResponse

use of org.apache.zookeeper.proto.SetSASLResponse in project fabric8 by jboss-fuse.

the class ZooKeeperSaslClient method sendSaslPacket.

private void sendSaslPacket(byte[] saslToken, ClientCnxn cnxn) throws SaslException {
    if (LOG.isDebugEnabled()) {
        LOG.debug("ClientCnxn:sendSaslPacket:length=" + saslToken.length);
    }
    GetSASLRequest request = new GetSASLRequest();
    request.setToken(saslToken);
    SetSASLResponse response = new SetSASLResponse();
    ServerSaslResponseCallback cb = new ServerSaslResponseCallback();
    try {
        cnxn.sendPacket(request, response, cb, ZooDefs.OpCode.sasl);
    } catch (IOException e) {
        throw new SaslException("Failed to send SASL packet to server.", e);
    }
}
Also used : SetSASLResponse(org.apache.zookeeper.proto.SetSASLResponse) IOException(java.io.IOException) SaslException(javax.security.sasl.SaslException) GetSASLRequest(org.apache.zookeeper.proto.GetSASLRequest)

Aggregations

SaslException (javax.security.sasl.SaslException)6 GetSASLRequest (org.apache.zookeeper.proto.GetSASLRequest)6 SetSASLResponse (org.apache.zookeeper.proto.SetSASLResponse)6 IOException (java.io.IOException)4 Id (org.apache.zookeeper.data.Id)2 Record (org.apache.jute.Record)1 ReplyHeader (org.apache.zookeeper.proto.ReplyHeader)1