org.apache.solr.client.solrj.impl

## Class HttpClusterStateProvider

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

All Implemented Interfaces:
  Closeable, AutoCloseable, ClusterStateProvider

    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()`
`String` `getAlias(String alias)` Given an alias, returns the collection name that this alias points to
`int` `getCacheTimeout()`
`Object` `getClusterProperty(String propertyName)` Obtain a cluster property, or null if it doesn't exist.
`Object` `getClusterProperty(String propertyName, String def)` Obtain a cluster property, or the default value if it doesn't exist.
`String` `getCollectionName(String name)` Given a name, returns the collection name if an alias by that name exists, or returns the name itself, if no alias exists.
`ClusterState.CollectionRef` `getState(String collection)` Obtain the state of the collection (cluster status).
`Set<String>` `liveNodes()` Obtain set of live_nodes for the cluster.
`void` `setCacheTimeout(int cacheTimeout)`

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

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

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

#### liveNodes

    public Set<String> liveNodes()

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

Specified by:
  `liveNodes` in interface `ClusterStateProvider`

#### getAlias

    public String getAlias(String alias)

Description copied from interface: `ClusterStateProvider`
Given an alias, returns the collection name that this alias points to

Specified by:
  `getAlias` in interface `ClusterStateProvider`

#### getCollectionName

    public String getCollectionName(String name)

Description copied from interface: `ClusterStateProvider`
Given a name, returns the collection name if an alias by that name exists, or returns the name itself, if no alias exists.

Specified by:
  `getCollectionName` 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`

#### getClusterProperty

    public Object getClusterProperty(String propertyName,
                                     String def)

Description copied from interface: `ClusterStateProvider`
Obtain a cluster property, or the default value 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)