@Override
public SaslClient createSaslClient(String[] mechanisms, String authorizationId, String protocol, String serverName, Map<String, ?> props, CallbackHandler cbh) throws SaslException {
for (String mechanism : mechanisms) {
if ("ANONYMOUS".equals(mechanism)) {
return new AnonymousSaslClient();
}
if ("SCRAM-SHA-1".equals(mechanism)) {
return new ScramClient("SHA-1", authorizationId, cbh);
}
}