Class ModifiedPreemptiveBasicAuthClientBuilderFactory

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String SYS_PROP_BASIC_AUTH_CREDENTIALS
      A system property to configure the Basic auth credentials via a java system property.
      static java.lang.String SYS_PROP_HTTP_CLIENT_CONFIG
      A system property used to specify a properties file containing default parameters used for creating a HTTP client.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      org.apache.solr.client.solrj.impl.SolrHttpClientBuilder getHttpClientBuilder​(org.apache.solr.client.solrj.impl.SolrHttpClientBuilder builder)
      This method configures the SolrHttpClientBuilder by overriding the configuration of passed SolrHttpClientBuilder or as a new instance.
      static void setDefaultSolrParams​(org.apache.solr.common.params.SolrParams params)
      This method enables configuring system wide defaults (apart from using a config file based approach).
      void setup​(ModifiedHttp2SolrClient client)  
      void setup​(ModifiedHttp2SolrClient client, java.lang.String basicAuthUser, java.lang.String basicAuthPass)  
      • Methods inherited from class java.lang.Object

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

      • SYS_PROP_HTTP_CLIENT_CONFIG

        public static final java.lang.String SYS_PROP_HTTP_CLIENT_CONFIG
        A system property used to specify a properties file containing default parameters used for creating a HTTP client. This is specifically useful for configuring the HTTP basic auth credentials (i.e. username/password). The name of the property must match the relevant Solr config property name.
        See Also:
        Constant Field Values
      • SYS_PROP_BASIC_AUTH_CREDENTIALS

        public static final java.lang.String SYS_PROP_BASIC_AUTH_CREDENTIALS
        A system property to configure the Basic auth credentials via a java system property. Since this will expose the password on the command-line, it is not very secure. But this mechanism is added for backwards compatibility.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ModifiedPreemptiveBasicAuthClientBuilderFactory

        public ModifiedPreemptiveBasicAuthClientBuilderFactory()
    • Method Detail

      • setDefaultSolrParams

        public static void setDefaultSolrParams​(org.apache.solr.common.params.SolrParams params)
        This method enables configuring system wide defaults (apart from using a config file based approach).
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException
      • setup

        public void setup​(ModifiedHttp2SolrClient client,
                          java.lang.String basicAuthUser,
                          java.lang.String basicAuthPass)
      • getHttpClientBuilder

        public org.apache.solr.client.solrj.impl.SolrHttpClientBuilder getHttpClientBuilder​(org.apache.solr.client.solrj.impl.SolrHttpClientBuilder builder)
        Description copied from interface: ModifiedHttpClientBuilderFactory
        This method configures the SolrHttpClientBuilder by overriding the configuration of passed SolrHttpClientBuilder or as a new instance.
        Specified by:
        getHttpClientBuilder in interface ModifiedHttpClientBuilderFactory
        Parameters:
        builder - The instance of the SolrHttpClientBuilder which should by configured (optional).
        Returns:
        the SolrHttpClientBuilder