Class ElasticsearchDomainMapProvider


  • public class ElasticsearchDomainMapProvider
    extends Object
    This class provides a method for creating a map between the domain-names and their associated endpoints. The method of creating the map depends on the autoDiscoverEndpoint parameter passed in at construction. When autoDiscoverEndpoint=true, the getDomainMapping() method will send list/describe commands via the AWS ES SDK to create the map. When auto_discover_endpoint=false, the map will be derived from the domainMapping string passed in as an argument.
    • Constructor Detail

      • ElasticsearchDomainMapProvider

        public ElasticsearchDomainMapProvider​(boolean autoDiscoverEndpoint)
      • ElasticsearchDomainMapProvider

        protected ElasticsearchDomainMapProvider​(boolean autoDiscoverEndpoint,
                                                 AwsElasticsearchFactory awsElasticsearchFactory)
    • Method Detail

      • getDomainMap

        public Map<String,​String> getDomainMap​(String domainMapping)
                                              throws RuntimeException
        Gets a map of the domain names and their associated endpoints based on the autoDiscoverEndpoint flag. When autoDiscoverEndpoint=true, this method will send list/describe commands via the AWS ES SDK to create the map. When auto_discover_endpoint=false, the map will be derived from the domainMapping string passed in as argument.
        Parameters:
        domainMapping - The contents of the domain_mapping environment variable with secrets already resolved. This parameter will be ignored when autoDiscoverEndpoint=true.
        Returns:
        Populated domainMap with domain-names and corresponding endpoints.
        Throws:
        RuntimeException - The domain map cannot be created due to an error with the AWS ES SDK or an invalid domainMapping variable (empty, null, or contain invalid information that cannot be parsed successfully).