Class HttpSolrClientBuilderBase<B extends HttpSolrClientBuilderBase<?,​?>,​C extends HttpSolrClientBase>

    • Field Detail

      • idleTimeoutMillis

        protected Long idleTimeoutMillis
      • connectionTimeoutMillis

        protected Long connectionTimeoutMillis
      • requestTimeoutMillis

        protected Long requestTimeoutMillis
      • basicAuthAuthorizationStr

        protected String basicAuthAuthorizationStr
      • followRedirects

        protected Boolean followRedirects
      • baseSolrUrl

        protected String baseSolrUrl
      • defaultCollection

        protected String defaultCollection
      • urlParamNames

        protected Set<String> urlParamNames
      • maxConnectionsPerHost

        protected Integer maxConnectionsPerHost
      • useHttp1_1

        protected boolean useHttp1_1
      • proxyHost

        protected String proxyHost
      • proxyPort

        protected int proxyPort
      • proxyIsSocks4

        protected boolean proxyIsSocks4
      • proxyIsSecure

        protected boolean proxyIsSecure
    • Constructor Detail

      • HttpSolrClientBuilderBase

        public HttpSolrClientBuilderBase()
    • Method Detail

      • build

        public abstract C build()
      • withRequestWriter

        public B withRequestWriter​(RequestWriter requestWriter)
        Provides a RequestWriter for created clients to use when handing requests.
      • withResponseParser

        public B withResponseParser​(ResponseParser responseParser)
        Provides a ResponseParser for created clients to use when handling requests.
      • withDefaultCollection

        public B withDefaultCollection​(String defaultCoreOrCollection)
        Sets a default for core or collection based requests.
      • withFollowRedirects

        public B withFollowRedirects​(boolean followRedirects)
      • withBasicAuthCredentials

        public B withBasicAuthCredentials​(String user,
                                          String pass)
      • withTheseParamNamesInTheUrl

        public B withTheseParamNamesInTheUrl​(Set<String> urlParamNames)
        Expert Method
        Parameters:
        urlParamNames - set of param keys that are only sent via the query string. Note that the param will be sent as a query string if the key is part of this Set or the SolrRequest's query params.
        See Also:
        SolrRequest.getQueryParams()
      • withMaxConnectionsPerHost

        public B withMaxConnectionsPerHost​(int max)
        Set maxConnectionsPerHost for http1 connections, maximum number http2 connections is limited to 4
      • withIdleTimeout

        public B withIdleTimeout​(long idleConnectionTimeout,
                                 TimeUnit unit)
      • getIdleTimeoutMillis

        public Long getIdleTimeoutMillis()
      • withConnectionTimeout

        public B withConnectionTimeout​(long connectionTimeout,
                                       TimeUnit unit)
      • getConnectionTimeout

        public Long getConnectionTimeout()
      • withRequestTimeout

        public B withRequestTimeout​(long requestTimeout,
                                    TimeUnit unit)
        Set a timeout in milliseconds for requests issued by this client.
        Parameters:
        requestTimeout - The timeout in milliseconds
        Returns:
        this Builder.
      • useHttp1_1

        public B useHttp1_1​(boolean useHttp1_1)
        If true, prefer http1.1 over http2. If not set, the default is determined by system property 'solr.http1'. Otherwise, false.
        Parameters:
        useHttp1_1 - prefer http1.1?
        Returns:
        this Builder
      • withProxyConfiguration

        public B withProxyConfiguration​(String host,
                                        int port,
                                        boolean isSocks4,
                                        boolean isSecure)
        Setup a proxy
        Parameters:
        host - The proxy host
        port - The proxy port
        isSocks4 - If true creates an SOCKS 4 proxy, otherwise creates an HTTP proxy
        isSecure - If true enables the secure flag on the proxy
        Returns:
        this Builder
      • withOptionalBasicAuthCredentials

        public B withOptionalBasicAuthCredentials​(String credentials)
        Setup basic authentication from a string formatted as username:password. If the string is Null then it doesn't do anything.
        Parameters:
        credentials - The username and password formatted as username:password
        Returns:
        this Builder