Package org.apache.solr.client.solrj.impl

# Class LBSolrClient.Endpoint

java.lang.Object
org.apache.solr.client.solrj.impl.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 Summary

Constructors
Constructor
Description
`Endpoint(String baseUrl)`
Creates an `LBSolrClient.Endpoint` representing a "base" URL of a Solr node
`Endpoint(String baseUrl, String core)`
Create an `LBSolrClient.Endpoint` representing a Solr core or collection

## Method Summary

Modifier and Type
Method
Description
`boolean`
`equals(Object obj)`
`static LBSolrClient.Endpoint`
`from(String unknownUrl)`
Create an `LBSolrClient.Endpoint` from a provided Solr URL
`String`
`getBaseUrl()`
Return the base URL of the Solr node this endpoint represents
`String`
`getCore()`
The core or collection this endpoint represents
`String`
`getUrl()`
Get the full URL, possibly including the collection/core if one was provided
`int`
`hashCode()`
`String`
`toString()`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Constructor Details

### 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 Details

### 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

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`

### equals

public boolean equals(Object obj)

Overrides:
  `equals` in class `Object`

### from

public static LBSolrClient.Endpoint from(String unknownUrl)
Create an `LBSolrClient.Endpoint` from a provided Solr URL

This method does its best to determine whether the provided URL is a Solr "base" URL or one which includes a core or collection name.