org.apache.solr.client.solrj.impl

## Class ZkClientClusterStateProvider

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

    public class ZkClientClusterStateProvider
    extends Object

### Constructor Summary

Constructors
Constructor and Description
`ZkClientClusterStateProvider(Collection<String> zkHosts, String chroot)`
`ZkClientClusterStateProvider(String zkHost)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `close()`
`void` `connect()`
`void` `downloadConfig(String configName, Path downloadPath)` Download a named config from Zookeeper to a location on the filesystem
`String` `getAlias(String collection)`
`Map<String,Object>` `getClusterProperties()`
`String` `getCollectionName(String name)`
`ClusterState.CollectionRef` `getState(String collection)`
`Set<String>` `liveNodes()`
`String` `toString()`
`void` `uploadConfig(Path configPath, String configName)` Upload a set of config files to Zookeeper and give it a name NOTE: You should only allow trusted users to upload configs.

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

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

### Constructor Detail

#### ZkClientClusterStateProvider

    public ZkClientClusterStateProvider(Collection<String> zkHosts,
                                        String chroot)

#### ZkClientClusterStateProvider

    public ZkClientClusterStateProvider(String zkHost)

### Method Detail

#### getState

    public ClusterState.CollectionRef getState(String collection)

#### liveNodes

    public Set<String> liveNodes()

#### getAlias

    public String getAlias(String collection)

#### getClusterProperties

    public Map<String,Object> getClusterProperties()

#### getCollectionName

    public String getCollectionName(String name)

#### downloadConfig

    public void downloadConfig(String configName,
                               Path downloadPath)
                        throws IOException

Download a named config from Zookeeper to a location on the filesystem

Parameters:
  `configName` - the name of the config
  `downloadPath` - the path to write config files to
Throws:
  `IOException` - if an I/O exception occurs

#### uploadConfig

    public void uploadConfig(Path configPath,
                             String configName)
                      throws IOException

Upload a set of config files to Zookeeper and give it a name NOTE: You should only allow trusted users to upload configs. If you are allowing client access to zookeeper, you should protect the /configs node against unauthorised write access.

Parameters:
  `configPath` - `Path` to the config files
  `configName` - the name of the config
Throws:
  `IOException` - if an IO error occurs

#### connect

    public void connect()

#### close

    public void close()
               throws IOException

Throws:
  `IOException`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`