Package org.apache.solr.client.solrj.cloud

## Class DelegatingClusterStateProvider

- java.lang.Object
- - org.apache.solr.client.solrj.cloud.DelegatingClusterStateProvider

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`, `ClusterStateProvider`, `SolrCloseable`

    public class DelegatingClusterStateProvider
    extends Object
    implements ClusterStateProvider

Base class for overriding some behavior of `ClusterStateProvider`

### Field Summary

Fields
`protected ClusterStateProvider` `delegate`

### Constructor Summary

Constructors
`DelegatingClusterStateProvider​(ClusterStateProvider delegate)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `close()`
`void` `connect()`
`Map<String,​String>` `getAliasProperties​(String alias)` Return alias properties, or an empty map if the alias has no properties.
`Map<String,​Object>` `getClusterProperties()` Obtain cluster properties.
`ClusterState` `getClusterState()` Obtain the current cluster state.
`DocCollection` `getCollection​(String name)`
`Set<String>` `getLiveNodes()` Obtain set of live_nodes for the cluster.
`String` `getPolicyNameByCollection​(String coll)` Get the collection-specific policy
`String` `getQuorumHosts()`
`ClusterState.CollectionRef` `getState​(String collection)` Obtain the state of the collection (cluster status).
`List<String>` `resolveAlias​(String alias)` 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.
`String` `resolveSimpleAlias​(String alias)` Given a collection alias, return a single collection it points to, or the original name if it's not an alias.

### 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, getClusterProperty, isRoutedAlias`

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

`isClosed`

### Field Detail

#### delegate

    protected ClusterStateProvider delegate

### Constructor Detail

#### DelegatingClusterStateProvider

    public DelegatingClusterStateProvider​(ClusterStateProvider delegate)

### Method Detail

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

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`

#### getAliasProperties

    public Map<String,​String> getAliasProperties​(String alias)

Description copied from interface: `ClusterStateProvider`
Return alias properties, or an empty map if the alias has no properties.

Specified by:
  `getAliasProperties` in interface `ClusterStateProvider`

#### resolveSimpleAlias

    public String resolveSimpleAlias​(String alias)
                              throws IllegalArgumentException

Description copied from interface: `ClusterStateProvider`
Given a collection alias, return a single collection it points to, or the original name if it's not an alias.

Specified by:
  `resolveSimpleAlias` in interface `ClusterStateProvider`
Throws:
  `IllegalArgumentException` - if an alias points to more than 1 collection, either directly or indirectly.

#### getClusterState

    public ClusterState getClusterState()

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

Specified by:
  `getClusterState` in interface `ClusterStateProvider`

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

#### getCollection

    public DocCollection getCollection​(String name)
                                throws IOException

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

#### connect

    public void connect()

Specified by:
  `connect` in interface `ClusterStateProvider`

#### close

    public void close()
               throws IOException

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

#### getQuorumHosts

    public String getQuorumHosts()

Specified by:
  `getQuorumHosts` in interface `ClusterStateProvider`