org.apache.solr.client.solrj.impl

## Class HttpClusterStateProvider

- java.lang.Object
- - org.apache.solr.client.solrj.impl.HttpClusterStateProvider

All Implemented Interfaces:
  Closeable, AutoCloseable, ClusterStateProvider, SolrCloseable

    public class HttpClusterStateProvider
    extends Object
    implements ClusterStateProvider

### Constructor Summary

Constructors
Constructor and Description
`HttpClusterStateProvider(List<String> solrUrls, org.apache.http.client.HttpClient httpClient)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `close()`
`void` `connect()`
`int` `getCacheTimeout()`
`Map<String,Object>` `getClusterProperties()` Obtain cluster properties.
`Object` `getClusterProperty(String propertyName)` Obtain a cluster property, or null if it doesn't exist.
`ClusterState` `getClusterState()` Obtain the current cluster state.
`Set<String>` `getLiveNodes()` Obtain set of live_nodes for the cluster.
`String` `getPolicyNameByCollection(String coll)` Get the collection-specific policy
`ClusterState.CollectionRef` `getState(String collection)` Obtain the state of the collection (cluster status).
`List<String>` `resolveAlias(String aliasName)` Given a collection alias, returns a list of collections it points to, or returns a singleton list of the input if it's not an alias.
`void` `setCacheTimeout(int cacheTimeout)`

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

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.apache.solr.client.solrj.impl.ClusterStateProvider

`getClusterProperty, getCollection`

### Methods inherited from interface org.apache.solr.common.SolrCloseable

`isClosed`

### Constructor Detail

#### HttpClusterStateProvider

    public HttpClusterStateProvider(List<String> solrUrls,
                                    org.apache.http.client.HttpClient httpClient)
                             throws Exception

Throws:
  `Exception`

### Method Detail

#### close

    public void close()
               throws IOException

Specified by:
  `close` in interface `Closeable`
Specified by:
  `close` in interface `AutoCloseable`
Throws:
  `IOException`

#### getState

    public ClusterState.CollectionRef getState(String collection)

Description copied from interface: `ClusterStateProvider`
Obtain the state of the collection (cluster status).

Specified by:
  `getState` in interface `ClusterStateProvider`
Returns:
  the collection state, or null is collection doesn't exist

#### getLiveNodes

    public Set<String> getLiveNodes()

Description copied from interface: `ClusterStateProvider`
Obtain set of live_nodes for the cluster.

Specified by:
  `getLiveNodes` in interface `ClusterStateProvider`

#### resolveAlias

    public List<String> resolveAlias(String aliasName)

Description copied from interface: `ClusterStateProvider`
Given a collection alias, returns a list of collections it points to, or returns a singleton list of the input if it's not an alias.

Specified by:
  `resolveAlias` in interface `ClusterStateProvider`

#### getClusterState

    public ClusterState getClusterState()
                                 throws IOException

Description copied from interface: `ClusterStateProvider`
Obtain the current cluster state.

Specified by:
  `getClusterState` in interface `ClusterStateProvider`
Throws:
  `IOException`

#### getClusterProperties

    public Map<String,Object> getClusterProperties()

Description copied from interface: `ClusterStateProvider`
Obtain cluster properties.

Specified by:
  `getClusterProperties` in interface `ClusterStateProvider`
Returns:
  configured cluster properties, or an empty map, never null.

#### getPolicyNameByCollection

    public String getPolicyNameByCollection(String coll)

Description copied from interface: `ClusterStateProvider`
Get the collection-specific policy

Specified by:
  `getPolicyNameByCollection` in interface `ClusterStateProvider`

#### getClusterProperty

    public Object getClusterProperty(String propertyName)

Description copied from interface: `ClusterStateProvider`
Obtain a cluster property, or null if it doesn't exist.

Specified by:
  `getClusterProperty` in interface `ClusterStateProvider`

#### connect

    public void connect()

Specified by:
  `connect` in interface `ClusterStateProvider`

#### getCacheTimeout

    public int getCacheTimeout()

#### setCacheTimeout

    public void setCacheTimeout(int cacheTimeout)