Class EsqlLicenseChecker

java.lang.Object
org.elasticsearch.xpack.esql.session.EsqlLicenseChecker

public class EsqlLicenseChecker extends Object
  • Field Details

  • Constructor Details

    • EsqlLicenseChecker

      public EsqlLicenseChecker()
  • Method Details

    • isCcsAllowed

      public static boolean isCcsAllowed(XPackLicenseState licenseState)
      Only call this method once you know the user is doing a cross-cluster query, as it will update the license_usage timestamp for the esql-ccs feature if the license is Enterprise (or Trial).
      Parameters:
      licenseState -
      Returns:
      true if the user has a license that allows ESQL CCS.
    • invalidLicenseForCcsException

      public static ElasticsearchStatusException invalidLicenseForCcsException(XPackLicenseState licenseState)
      Parameters:
      licenseState - existing license state. Need to extract info on the current installed license.
      Returns:
      ElasticsearchStatusException with an error message informing the caller what license is needed to run ES|QL cross-cluster searches and what license (if any) was found.