Class LBSolrClient.Endpoint

  • Enclosing class:
    LBSolrClient

    public static class LBSolrClient.Endpoint
    extends Object
    A Solr endpoint for LBSolrClient to include in its load-balancing

    Used in many places instead of the more common String URL to allow LBSolrClient to more easily determine whether a URL is a "base" or "core-aware" URL.

    • Constructor Detail

      • Endpoint

        public Endpoint​(String baseUrl)
        Creates an LBSolrClient.Endpoint representing a "base" URL of a Solr node
        Parameters:
        baseUrl - a base Solr URL, in the form "http[s]://host:port/solr"
      • Endpoint

        public Endpoint​(String baseUrl,
                        String core)
        Create an LBSolrClient.Endpoint representing a Solr core or collection
        Parameters:
        baseUrl - a base Solr URL, in the form "http[s]://host:port/solr"
        core - the name of a Solr core or collection
    • Method Detail

      • getBaseUrl

        public String getBaseUrl()
        Return the base URL of the Solr node this endpoint represents
        Returns:
        a base Solr URL, in the form "http[s]://host:port/solr"
      • getCore

        public String getCore()
        The core or collection this endpoint represents
        Returns:
        a core/collection name, or null if this endpoint doesn't represent a particular core.
      • getUrl

        public String getUrl()
        Get the full URL, possibly including the collection/core if one was provided
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object