org.elasticsearch.xpack.core.security.authc.ldap.support.LdapLoadBalancingSettings Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of x-pack-core Show documentation
Show all versions of x-pack-core Show documentation
Elasticsearch Expanded Pack Plugin - Core
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
package org.elasticsearch.xpack.core.security.authc.ldap.support;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.xpack.core.security.authc.RealmSettings;
import java.util.HashSet;
import java.util.Set;
import java.util.function.Function;
public final class LdapLoadBalancingSettings {
public static final Function> LOAD_BALANCE_TYPE_SETTING = RealmSettings.affixSetting(
"load_balance.type", key -> Setting.simpleString(key, Setting.Property.NodeScope));
private static final TimeValue CACHE_TTL_DEFAULT = TimeValue.timeValueHours(1L);
public static final Function> CACHE_TTL_SETTING = RealmSettings.affixSetting(
"load_balance.cache_ttl", key -> Setting.timeSetting(key, CACHE_TTL_DEFAULT, Setting.Property.NodeScope));
private LdapLoadBalancingSettings() {
}
public static Set> getSettings(String realmType) {
Set> settings = new HashSet<>();
settings.add(LOAD_BALANCE_TYPE_SETTING.apply(realmType));
settings.add(CACHE_TTL_SETTING.apply(realmType));
return settings;
}
}