Class PreemptiveBasicAuthClientBuilderFactory
- java.lang.Object
-
- org.apache.solr.client.solrj.impl.PreemptiveBasicAuthClientBuilderFactory
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,HttpClientBuilderFactory
public class PreemptiveBasicAuthClientBuilderFactory extends Object implements HttpClientBuilderFactory
HttpClientConfigurer implementation providing support for preemptive Http Basic authentication scheme.
-
-
Field Summary
Fields Modifier and Type Field Description static String
SYS_PROP_BASIC_AUTH_CREDENTIALS
A system property to configure the Basic auth credentials via a java system property.static String
SYS_PROP_HTTP_CLIENT_CONFIG
A system property used to specify a properties file containing default parameters used for creating a HTTP client.
-
Constructor Summary
Constructors Constructor Description PreemptiveBasicAuthClientBuilderFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
SolrHttpClientBuilder
getHttpClientBuilder(Optional<SolrHttpClientBuilder> optionalBuilder)
This method configures the SolrHttpClientBuilder by overriding the configuration of passed SolrHttpClientBuilder or as a new instance.static void
setDefaultSolrParams(SolrParams params)
This method enables configuring system wide defaults (apart from using a config file based approach).void
setup(Http2SolrClient client)
-
-
-
Field Detail
-
SYS_PROP_HTTP_CLIENT_CONFIG
public static final 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 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
-
-
Method Detail
-
setDefaultSolrParams
public static void setDefaultSolrParams(SolrParams params)
This method enables configuring system wide defaults (apart from using a config file based approach).
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
setup
public void setup(Http2SolrClient client)
- Specified by:
setup
in interfaceHttpClientBuilderFactory
-
getHttpClientBuilder
public SolrHttpClientBuilder getHttpClientBuilder(Optional<SolrHttpClientBuilder> optionalBuilder)
Description copied from interface:HttpClientBuilderFactory
This method configures the SolrHttpClientBuilder by overriding the configuration of passed SolrHttpClientBuilder or as a new instance.- Specified by:
getHttpClientBuilder
in interfaceHttpClientBuilderFactory
- Parameters:
optionalBuilder
- The instance of the SolrHttpClientBuilder which should by configured (optional).- Returns:
- the SolrHttpClientBuilder
-
-