Module org.elasticsearch.xcore
Class RealmConfig
java.lang.Object
org.elasticsearch.xpack.core.security.authc.RealmConfig
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic org.elasticsearch.xcontent.ConstructingObjectParser<RealmConfig.RealmIdentifier, Void> -
Constructor Summary
ConstructorsConstructorDescriptionRealmConfig(RealmConfig.RealmIdentifier identifier, Settings settings, Environment env, ThreadContext threadContext) -
Method Summary
Modifier and TypeMethodDescriptionbooleanenabled()env()<T> Setting<T> getConcreteSetting(Function<String, Setting.AffixSetting<T>> settingFactory) Return theconcrete settingthat is produced by applying this realm's type as a parameter to the provided function, and the realm's name (as the namespace) to the resultingSetting.AffixSetting.<T> Setting<T> getConcreteSetting(Setting.AffixSetting<T> setting) Return theconcrete settingthat is produced by applying this realm's name as the namespace.<T> TgetSetting(Function<String, Setting.AffixSetting<T>> settingFactory) Obtain the value of the providedsettingfrom the node'sglobal settings.<T> TgetSetting(Function<String, Setting.AffixSetting<T>> settingFactory, Supplier<T> orElse) Obtain the value of the providedsettingfrom the node'sglobal settings.<T> TgetSetting(Setting.AffixSetting<T> setting) Obtain the value of the providedsettingfrom the node'sglobal settings.<T> TgetSetting(Setting.AffixSetting<T> setting, Supplier<T> orElse) Obtain the value of the providedsettingfrom the node'sglobal settings.<T> booleanhasSetting(Function<String, Setting.AffixSetting<T>> settingFactory) Determines whether the providedsettinghas an explicit value in the node'sglobal settings.<T> booleanhasSetting(Setting.AffixSetting<T> setting) Determines whether the providedsettinghas an explicit value in the node'sglobal settings.name()intorder()settings()type()
-
Field Details
-
REALM_IDENTIFIER_PARSER
public static org.elasticsearch.xcontent.ConstructingObjectParser<RealmConfig.RealmIdentifier,Void> REALM_IDENTIFIER_PARSER
-
-
Constructor Details
-
RealmConfig
public RealmConfig(RealmConfig.RealmIdentifier identifier, Settings settings, Environment env, ThreadContext threadContext)
-
-
Method Details
-
identifier
-
name
-
enabled
public boolean enabled() -
order
public int order() -
type
-
settings
- Returns:
- The settings for the current node. This will include the settings for this realm (as well as other realms, and other non-security settings).
- See Also:
-
env
-
threadContext
-
getConcreteSetting
Return theconcrete settingthat is produced by applying this realm's name as the namespace. Realm configuration is defined using affix settings in the formxpack.security.authc.realms.type.(name).key, wheretypeis a fixed string (known at compile time) that identifies the type of the realm being configured.(name)is a variable string (known only at runtime) that uniquely names the realm.keyis a fixed string (known at compile time) that identifies a specific setting within the realm.
Settingsobject, it is necessary to convert anSetting.AffixSettingobject into a concreteSettingobject that has a fixed key, for a specific name. -
getConcreteSetting
Return theconcrete settingthat is produced by applying this realm's type as a parameter to the provided function, and the realm's name (as the namespace) to the resultingSetting.AffixSetting. Because some settings (e.g."order") are defined for multiple "types", but the Settings infrastructure treats the type as a fixed part of the setting key, it is common to define such multi-realm settings using aFunctionof this form.- See Also:
-
getSetting
Obtain the value of the providedsettingfrom the node'sglobal settings. TheSetting.AffixSettingis made concrete throughgetConcreteSetting(Setting.AffixSetting), which is then used toretrievethe setting value. -
getSetting
Obtain the value of the providedsettingfrom the node'sglobal settings.getConcreteSetting(Function)is used to obtain a concrete setting from the providedFunction/Setting.AffixSetting, and this concrete setting is then used toretrievethe setting value. -
getSetting
public <T> T getSetting(Function<String, Setting.AffixSetting<T>> settingFactory, Supplier<T> orElse) Obtain the value of the providedsettingfrom the node'sglobal settings.getConcreteSetting(Function)is used to obtain a concrete setting from the providedFunction/Setting.AffixSetting. If this concrete settingexistsin the global settings, then its value is returned, otherwise theonElseSupplieris executed and returned. -
getSetting
Obtain the value of the providedsettingfrom the node'sglobal settings.getConcreteSetting(Setting.AffixSetting)is used to obtain a concrete setting from the providedSetting.AffixSetting. If this concrete settingexistsin the global settings, then its value is returned, otherwise theonElseSupplieris executed and returned. -
hasSetting
Determines whether the providedsettinghas an explicit value in the node'sglobal settings.getConcreteSetting(Function)is used to obtain a concrete setting from the providedFunction/Setting.AffixSetting, and this concrete setting is then used tocheckfor a value. -
hasSetting
Determines whether the providedsettinghas an explicit value in the node'sglobal settings.getConcreteSetting(Setting.AffixSetting)is used to obtain a concrete setting from the providedSetting.AffixSetting, and this concrete setting is then used tocheckfor a value.
-