Class DefaultElasticsearchConfigurationProperties

  • All Implemented Interfaces:
    DefaultElasticsearchConfiguration

    @Requires(classes=org.elasticsearch.client.RestClientBuilder.class)
    @ConfigurationProperties("elasticsearch")
    public class DefaultElasticsearchConfigurationProperties
    extends java.lang.Object
    implements DefaultElasticsearchConfiguration
    Default configurations for Elasticsearch.
    Since:
    1.0.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.apache.http.impl.nio.client.HttpAsyncClientBuilder httpAsyncClientBuilder  
      protected org.apache.http.client.config.RequestConfig.Builder requestConfigBuilder
      The default request configurations.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.apache.http.Header[] getDefaultHeaders()
      The default headers that need to be sent with each request, to prevent having to specify them with each single request.
      org.apache.http.impl.nio.client.HttpAsyncClientBuilder getHttpAsyncClientBuilder()
      The http client configuration (e.g.
      org.apache.http.HttpHost[] getHttpHosts()
      The one or more hosts that the client will communicate with, provided as instances of HttpHost.
      int getMaxRetryTimeoutMillis()
      The timeout that should be honoured in case multiple attempts are made for the same request.
      org.elasticsearch.client.NodeSelector getNodeSelector()
      The node selector to be used to filter the nodes the client will send requests to among the ones that are set to the client itself.
      org.apache.http.client.config.RequestConfig.Builder getRequestConfigBuilder()  
      void setDefaultHeaders​(org.apache.http.Header[] defaultHeaders)  
      void setHttpAsyncClientBuilder​(org.apache.http.impl.nio.client.HttpAsyncClientBuilder httpAsyncClientBuilder)  
      void setHttpHosts​(org.apache.http.HttpHost[] httpHosts)  
      void setMaxRetryTimeoutMillis​(int maxRetryTimeoutMillis)  
      void setNodeSelector​(org.elasticsearch.client.NodeSelector nodeSelector)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • httpAsyncClientBuilder

        protected org.apache.http.impl.nio.client.HttpAsyncClientBuilder httpAsyncClientBuilder
      • requestConfigBuilder

        @ConfigurationBuilder(configurationPrefix="request.default")
        protected org.apache.http.client.config.RequestConfig.Builder requestConfigBuilder
        The default request configurations.
    • Constructor Detail

      • DefaultElasticsearchConfigurationProperties

        public DefaultElasticsearchConfigurationProperties()
    • Method Detail

      • getNodeSelector

        public org.elasticsearch.client.NodeSelector getNodeSelector()
        Description copied from interface: DefaultElasticsearchConfiguration
        The node selector to be used to filter the nodes the client will send requests to among the ones that are set to the client itself. By default the client sends requests to every configured node.
        Specified by:
        getNodeSelector in interface DefaultElasticsearchConfiguration
        Returns:
        The NodeSelector to be used.
      • setHttpHosts

        public void setHttpHosts​(org.apache.http.HttpHost[] httpHosts)
        Parameters:
        httpHosts - One or more hosts that client will connect to.
      • setDefaultHeaders

        public void setDefaultHeaders​(org.apache.http.Header[] defaultHeaders)
        Parameters:
        defaultHeaders - The defaults Header to sent with each request.
      • setMaxRetryTimeoutMillis

        public void setMaxRetryTimeoutMillis​(int maxRetryTimeoutMillis)
        Parameters:
        maxRetryTimeoutMillis - The maximum retry timeout in millis.
      • setNodeSelector

        public void setNodeSelector​(org.elasticsearch.client.NodeSelector nodeSelector)
        Parameters:
        nodeSelector - The NodeSelector to be used, in case of multiple nodes.
      • setHttpAsyncClientBuilder

        @Inject
        public void setHttpAsyncClientBuilder​(org.apache.http.impl.nio.client.HttpAsyncClientBuilder httpAsyncClientBuilder)
        Parameters:
        httpAsyncClientBuilder - The HttpAsyncClientBuilder bean