Class AliasValidator

java.lang.Object
org.elasticsearch.cluster.metadata.AliasValidator

public class AliasValidator extends Object
Validator for an alias, to be used before adding an alias to the index metadata and make sure the alias is valid
  • Constructor Details

    • AliasValidator

      public AliasValidator()
  • Method Details

    • validateAlias

      public void validateAlias(Alias alias, String index, Metadata metadata)
      Allows to validate an Alias and make sure it's valid before it gets added to the index metadata. Doesn't validate the alias filter.
      Throws:
      IllegalArgumentException - if the alias is not valid
    • validateAliasMetadata

      public void validateAliasMetadata(AliasMetadata aliasMetadata, String index, Metadata metadata)
      Allows to validate an AliasMetadata and make sure it's valid before it gets added to the index metadata. Doesn't validate the alias filter.
      Throws:
      IllegalArgumentException - if the alias is not valid
    • validateAliasStandalone

      public void validateAliasStandalone(Alias alias)
      Allows to partially validate an alias, without knowing which index it'll get applied to. Useful with index templates containing aliases. Checks also that it is possible to parse the alias filter via XContentParser, without validating it as a filter though.
      Throws:
      IllegalArgumentException - if the alias is not valid
    • validateAlias

      public void validateAlias(String alias, String index, @Nullable String indexRouting, Function<String,String> lookup)
      Validate a proposed alias.
    • validateAliasFilter

      public void validateAliasFilter(String alias, String filter, SearchExecutionContext searchExecutionContext, org.elasticsearch.common.xcontent.NamedXContentRegistry xContentRegistry)
      Validates an alias filter by parsing it using the provided SearchExecutionContext
      Throws:
      IllegalArgumentException - if the filter is not valid
    • validateAliasFilter

      public void validateAliasFilter(String alias, BytesReference filter, SearchExecutionContext searchExecutionContext, org.elasticsearch.common.xcontent.NamedXContentRegistry xContentRegistry)
      Validates an alias filter by parsing it using the provided SearchExecutionContext
      Throws:
      IllegalArgumentException - if the filter is not valid