public Properties getClientProperties() {
Properties props = new Properties();
if (getClientPropertiesFile() != null) {
props = ClientInfoImpl.toProperties(getClientPropertiesFile());
}
for (Map.Entry<String,String> entry : commandLineProperties.entrySet()) {
props.setProperty(entry.getKey(), entry.getValue());
}
if (useSsl) {
props.setProperty(ClientProperty.SSL_ENABLED.getKey(), "true");
}
if (useSasl) {
props.setProperty(ClientProperty.SASL_ENABLED.getKey(), "true");
}
if (!zooKeeperInstance.isEmpty()) {
String instanceName = zooKeeperInstance.get(0);
String hosts = zooKeeperInstance.get(1);
props.setProperty(ClientProperty.INSTANCE_ZOOKEEPERS.getKey(), hosts);
props.setProperty(ClientProperty.INSTANCE_NAME.getKey(), instanceName);
}
if (zooKeeperHosts != null && !zooKeeperHosts.isEmpty()) {
props.setProperty(ClientProperty.INSTANCE_ZOOKEEPERS.getKey(), zooKeeperHosts);
}
if (zooKeeperInstanceName != null && !zooKeeperInstanceName.isEmpty()) {
props.setProperty(ClientProperty.INSTANCE_NAME.getKey(), zooKeeperInstanceName);
}
return props;
}