Package org.apache.solr.common.cloud

## Class CollectionProperties

- java.lang.Object
- - org.apache.solr.common.cloud.CollectionProperties

    public class CollectionProperties
    extends Object

Interact with solr collection properties

Note that all methods on this class make calls to ZK on every invocation. For read-only eventually-consistent uses, clients should instead call `ZkStateReader.getCollectionProperties(String)`

### Constructor Summary

Constructors
`CollectionProperties​(SolrZkClient client)` Creates a CollectionProperties object using a provided SolrZkClient

### Method Summary

All Methods Instance Methods Concrete Methods
`Map<String,​String>` `getCollectionProperties​(String collection)` Return the collection properties
`String` `getCollectionProperty​(String collection, String key, String defaultValue)` Read the value of a collection property, returning a default if it is not set
`void` `setCollectionProperty​(String collection, String propertyName, String propertyValue)` This method sets a collection property.

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

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

### Constructor Detail

#### CollectionProperties

    public CollectionProperties​(SolrZkClient client)

Creates a CollectionProperties object using a provided SolrZkClient

### Method Detail

#### getCollectionProperty

    public String getCollectionProperty​(String collection,
                                        String key,
                                        String defaultValue)
                                 throws IOException

Read the value of a collection property, returning a default if it is not set

Parameters:
  `key` - the property name
  `defaultValue` - the default value
Returns:
  the property value
Throws:
  `IOException` - if there is an error reading the value from zookeeper

#### getCollectionProperties

    public Map<String,​String> getCollectionProperties​(String collection)
                                                     throws IOException

Return the collection properties

Throws:
  `IOException` - if there is an error reading properties from zookeeper

#### setCollectionProperty

    public void setCollectionProperty​(String collection,
                                      String propertyName,
                                      String propertyValue)
                               throws IOException

This method sets a collection property.

Parameters:
  `collection` - The property name to be set.
  `propertyName` - The property name to be set.
  `propertyValue` - The value of the property.
Throws:
  `IOException` - if there is an error writing data to zookeeper