Search in sources :

Example 1 with SaslCodec

use of org.apache.drill.exec.rpc.SaslCodec in project drill by apache.

the class ControlConnection method setSaslClient.

@Override
public void setSaslClient(final SaslClient saslClient) {
    checkState(this.saslClient == null);
    this.saslClient = saslClient;
    // object. This is later used to do wrap/unwrap in handlers.
    if (isEncryptionEnabled()) {
        saslCodec = new SaslCodec() {

            @Override
            public byte[] wrap(byte[] data, int offset, int len) throws SaslException {
                assert saslClient != null;
                return saslClient.wrap(data, offset, len);
            }

            @Override
            public byte[] unwrap(byte[] data, int offset, int len) throws SaslException {
                assert saslClient != null;
                return saslClient.unwrap(data, offset, len);
            }
        };
    }
}
Also used : SaslCodec(org.apache.drill.exec.rpc.SaslCodec) SaslException(javax.security.sasl.SaslException) DrillbitEndpoint(org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint)

Aggregations

SaslException (javax.security.sasl.SaslException)1 DrillbitEndpoint (org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint)1 SaslCodec (org.apache.drill.exec.rpc.SaslCodec)1