use of org.apache.flink.shaded.curator5.org.apache.curator.framework.imps.DefaultACLProvider in project knox by apache.
the class CuratorClientService method createClient.
private RemoteConfigurationRegistryClient createClient(RemoteConfigurationRegistryConfig config) {
ACLProvider aclProvider;
if (config.isSecureRegistry()) {
configureSasl(config);
if (AUTH_TYPE_KERBEROS.equalsIgnoreCase(config.getAuthType()) && !config.isBackwardsCompatible()) {
aclProvider = new SASLOwnerACLProvider(true);
} else {
aclProvider = new SASLOwnerACLProvider(false);
}
} else {
// Clear SASL system property
System.clearProperty(LOGIN_CONTEXT_NAME_PROPERTY);
aclProvider = new DefaultACLProvider();
}
CuratorFramework client = CuratorFrameworkFactory.builder().connectString(config.getConnectionString()).retryPolicy(new ExponentialBackoffRetry(1000, 3)).aclProvider(aclProvider).build();
client.start();
return (new ClientAdapter(client, config));
}
Aggregations