Record Class DataSourceConfigDefinition

java.lang.Object
java.lang.Record
org.elasticsearch.xpack.esql.datasources.spi.DataSourceConfigDefinition
Record Components:
name - the field's API name (e.g. "access_key", "region")
secret - whether this field holds a credential or other sensitive value
caseInsensitive - whether this field's values are case-insensitive (e.g. enum-like fields like "auth"). Case-insensitive fields are normalized to lowercase on input for consistent storage and comparison.
federatedAuth - whether this field contributes to federated authentication (e.g. workload identity federation settings that replace explicit credentials). A field cannot be both secret and federatedAuth: the two represent mutually exclusive authentication kinds, and combining them on a single field would make it self-conflict during validation.

public record DataSourceConfigDefinition(String name, boolean secret, boolean caseInsensitive, boolean federatedAuth) extends Record
Metadata describing a datasource configuration field — its name, sensitivity, and value semantics. Used by DataSourceConfiguration subclasses to declare their settings schema and drive validation. This is internal plugin machinery — it is never exposed through the CRUD API or stored in cluster state. The validated output that enters cluster state is DataSourceSetting.
  • Constructor Details

    • DataSourceConfigDefinition

      public DataSourceConfigDefinition(String name, boolean secret, boolean caseInsensitive, boolean federatedAuth)
      Creates an instance of a DataSourceConfigDefinition record class.
      Parameters:
      name - the value for the name record component
      secret - the value for the secret record component
      caseInsensitive - the value for the caseInsensitive record component
      federatedAuth - the value for the federatedAuth record component
  • Method Details

    • secret

      public static DataSourceConfigDefinition secret(String name)
      A field that holds a credential.
    • plaintext

      public static DataSourceConfigDefinition plaintext(String name)
      A regular (non-secret) field.
    • asCaseInsensitive

      public DataSourceConfigDefinition asCaseInsensitive()
      Returns a copy whose values are treated as case-insensitive (normalized to lowercase on input).
    • asFederatedAuth

      public DataSourceConfigDefinition asFederatedAuth()
      Returns a copy that marks this field as contributing to federated authentication.
    • mapOf

      public static Map<String,DataSourceConfigDefinition> mapOf(DataSourceConfigDefinition... definitions)
      Builds a definition map keyed by field name. Each name is typed once.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • secret

      public boolean secret()
      Returns the value of the secret record component.
      Returns:
      the value of the secret record component
    • caseInsensitive

      public boolean caseInsensitive()
      Returns the value of the caseInsensitive record component.
      Returns:
      the value of the caseInsensitive record component
    • federatedAuth

      public boolean federatedAuth()
      Returns the value of the federatedAuth record component.
      Returns:
      the value of the federatedAuth record component