tigase.conf

## Class ConfigurationCache

- java.lang.Object
- - tigase.conf.ConfigurationCache

- All Implemented Interfaces:
    Iterable<ConfigItem>, ConfigRepositoryIfc, ComponentRepository<ConfigItem>
  Direct Known Subclasses:
    ConfigSQLRepository, ConfigXMLRepository

      public class ConfigurationCache
      extends Object
      implements ConfigRepositoryIfc

  Created: Dec 10, 2009 2:02:41 PM
  Version:
    $Rev$
  Author:
    Artur Hefczyc

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `CONFIG_DUMP_FILE_PROP_DEF` Field description
    `static String` | `CONFIG_DUMP_FILE_PROP_KEY` Field description

    - ### Fields inherited from interface tigase.conf.ConfigRepositoryIfc

      `RELOAD_DELAY, RESOURCE_URI`

    - ### Fields inherited from interface tigase.db.comp.ComponentRepository

      `COMP_REPO_BIND`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ConfigurationCache()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addItem(ConfigItem item)` Method description
    `void` | `addItem(String compName, ConfigItem item)` Method description
    `void` | `addItem(String key, Object value)` Method description
    `void` | `addRepoChangeListener(RepositoryChangeListenerIfc<ConfigItem> repoChangeListener)` Method description
    `Collection<ConfigItem>` | `allItems()` Method description
    `boolean` | `contains(String key)` Method description
    `Object` | `get(String compName, String node, String key, Object def)` Method description
    `String[]` | `getCompNames()` Method description
    `void` | `getDefaults(Map<String,Object> defs, Map<String,Object> params)` Method description
    `String` | `getDefHostname()` Method description
    `Map<String,Object>` | `getInitProperties()` Method description
    `ConfigItem` | `getItem(String key)` Method description
    `ConfigItem` | `getItem(String compName, String node, String key)` Method description
    `ConfigItem` | `getItemInstance()` Method description
    `Set<ConfigItem>` | `getItemsForComponent(String compName)` Method description
    `String[]` | `getKeys(String compName, String node)` Method description
    `Map<String,Object>` | `getProperties(String compName)` Method description
    `void` | `init(Map<String,Object> params)` Method description
    `Iterator<ConfigItem>` | `iterator()` Method description
    `void` | `putProperties(String compName, Map<String,Object> props)` Method description
    `void` | `reload()` Method description
    `void` | `remove(String compName, String node, String key)` Method description
    `void` | `removeItem(String key)` Method description
    `void` | `removeItem(String compName, ConfigItem item)` Method description
    `void` | `removeRepoChangeListener(RepositoryChangeListenerIfc<ConfigItem> repoChangeListener)` Method description
    `void` | `set(String compName, String node, String key, Object value)` Method description
    `void` | `setAutoloadTimer(long delay)` Method description
    `void` | `setDefHostname(String hostname)` Method description
    `void` | `setProperties(Map<String,Object> properties)` Method description
    `int` | `size()` Method description
    `void` | `store()` Method description
    `String` | `validateItem(ConfigItem item)` Method description

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

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

- - ### Field Detail

    - #### CONFIG_DUMP_FILE_PROP_DEF

          public static final String CONFIG_DUMP_FILE_PROP_DEF

      Field description
      See Also:
        Constant Field Values

    - #### CONFIG_DUMP_FILE_PROP_KEY

          public static final String CONFIG_DUMP_FILE_PROP_KEY

      Field description
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ConfigurationCache

          public ConfigurationCache()

  - ### Method Detail

    - #### addRepoChangeListener

          public void addRepoChangeListener(RepositoryChangeListenerIfc<ConfigItem> repoChangeListener)

      Method description
      Specified by:
        `addRepoChangeListener` in interface `ComponentRepository<ConfigItem>`
      Parameters:
        `repoChangeListener` -

    - #### removeRepoChangeListener

          public void removeRepoChangeListener(RepositoryChangeListenerIfc<ConfigItem> repoChangeListener)

      Method description
      Specified by:
        `removeRepoChangeListener` in interface `ComponentRepository<ConfigItem>`
      Parameters:
        `repoChangeListener` -

    - #### addItem

          public void addItem(String compName,
                     ConfigItem item)

      Method description
      Parameters:
        `compName` -
        `item` -

    - #### addItem

          public void addItem(ConfigItem item)
                       throws TigaseDBException

      Method description
      Specified by:
        `addItem` in interface `ComponentRepository<ConfigItem>`
      Parameters:
        `item` -
      Throws:
        `TigaseDBException`

    - #### addItem

          public void addItem(String key,
                     Object value)
                       throws ConfigurationException

      Method description
      Specified by:
        `addItem` in interface `ConfigRepositoryIfc`
      Parameters:
        `key` -
        `value` -
      Throws:
        `ConfigurationException`

    - #### allItems

          public Collection<ConfigItem> allItems()
                                          throws TigaseDBException

      Method description
      Specified by:
        `allItems` in interface `ComponentRepository<ConfigItem>`
      Throws:
        `TigaseDBException`

    - #### contains

          public boolean contains(String key)

      Method description
      Specified by:
        `contains` in interface `ComponentRepository<ConfigItem>`
      Parameters:
        `key` -
      Returns:
        a `boolean` value `true` if the item exists in the repository or `false` of it does not.

    - #### get

          public Object get(String compName,
                   String node,
                   String key,
                   Object def)

      Method description
      Specified by:
        `get` in interface `ConfigRepositoryIfc`
      Parameters:
        `compName` -
        `node` -
        `key` -
        `def` -

    - #### getCompNames

          public String[] getCompNames()

      Method description
      Specified by:
        `getCompNames` in interface `ConfigRepositoryIfc`

    - #### getDefHostname

          public String getDefHostname()

      Method description

    - #### getDefaults

          public void getDefaults(Map<String,Object> defs,
                         Map<String,Object> params)

      Method description
      Specified by:
        `getDefaults` in interface `ComponentRepository<ConfigItem>`
      Parameters:
        `defs` -
        `params` -

    - #### getInitProperties

          public Map<String,Object> getInitProperties()

      Method description
      Specified by:
        `getInitProperties` in interface `ConfigRepositoryIfc`

    - #### getItem

          public ConfigItem getItem(String compName,
                           String node,
                           String key)

      Method description
      Parameters:
        `compName` -
        `node` -
        `key` -

    - #### getItem

          public ConfigItem getItem(String key)

      Method description
      Specified by:
        `getItem` in interface `ComponentRepository<ConfigItem>`
      Parameters:
        `key` -
      Returns:
        a `Item` for a given key or `null` if the item is not in the repository.

    - #### getItemInstance

          public ConfigItem getItemInstance()

      Method description
      Specified by:
        `getItemInstance` in interface `ComponentRepository<ConfigItem>`
      Returns:
        a new, uninitialized instance of the repository Item.

    - #### getItemsForComponent

          public Set<ConfigItem> getItemsForComponent(String compName)

      Method description
      Specified by:
        `getItemsForComponent` in interface `ConfigRepositoryIfc`
      Parameters:
        `compName` -

    - #### getKeys

          public String[] getKeys(String compName,
                         String node)

      Method description
      Specified by:
        `getKeys` in interface `ConfigRepositoryIfc`
      Parameters:
        `compName` -
        `node` -

    - #### getProperties

          public Map<String,Object> getProperties(String compName)
                                           throws ConfigurationException

      Method description
      Specified by:
        `getProperties` in interface `ConfigRepositoryIfc`
      Parameters:
        `compName` -
      Throws:
        `ConfigurationException`

    - #### init

          public void init(Map<String,Object> params)
                    throws ConfigurationException

      Method description
      Specified by:
        `init` in interface `ConfigRepositoryIfc`
      Parameters:
        `params` -
      Throws:
        `ConfigurationException`

    - #### iterator

          public Iterator<ConfigItem> iterator()

      Method description
      Specified by:
        `iterator` in interface `Iterable<ConfigItem>`

    - #### putProperties

          public void putProperties(String compName,
                           Map<String,Object> props)
                             throws ConfigurationException

      Method description
      Specified by:
        `putProperties` in interface `ConfigRepositoryIfc`
      Parameters:
        `compName` -
        `props` -
      Throws:
        `ConfigurationException`

    - #### reload

          public void reload()
                      throws TigaseDBException

      Method description
      Specified by:
        `reload` in interface `ComponentRepository<ConfigItem>`
      Throws:
        `TigaseDBException`

    - #### remove

          public void remove(String compName,
                    String node,
                    String key)

      Method description
      Specified by:
        `remove` in interface `ConfigRepositoryIfc`
      Parameters:
        `compName` -
        `node` -
        `key` -

    - #### removeItem

          public void removeItem(String compName,
                        ConfigItem item)

      Method description
      Parameters:
        `compName` -
        `item` -

    - #### removeItem

          public void removeItem(String key)
                          throws TigaseDBException

      Method description
      Specified by:
        `removeItem` in interface `ComponentRepository<ConfigItem>`
      Parameters:
        `key` -
      Throws:
        `TigaseDBException`

    - #### set

          public void set(String compName,
                 String node,
                 String key,
                 Object value)

      Method description
      Specified by:
        `set` in interface `ConfigRepositoryIfc`
      Parameters:
        `compName` -
        `node` -
        `key` -
        `value` -

    - #### setDefHostname

          public void setDefHostname(String hostname)

      Method description
      Specified by:
        `setDefHostname` in interface `ConfigRepositoryIfc`
      Parameters:
        `hostname` -

    - #### setProperties

          public void setProperties(Map<String,Object> properties)

      Method description
      Specified by:
        `setProperties` in interface `ComponentRepository<ConfigItem>`
      Parameters:
        `properties` -

    - #### size

          public int size()

      Method description
      Specified by:
        `size` in interface `ComponentRepository<ConfigItem>`
      Returns:
        an `int` value with number of items in the repository.

    - #### store

          public void store()
                     throws TigaseDBException

      Method description
      Specified by:
        `store` in interface `ComponentRepository<ConfigItem>`
      Throws:
        `TigaseDBException`

    - #### validateItem

          public String validateItem(ConfigItem item)

      Method description
      Specified by:
        `validateItem` in interface `ComponentRepository<ConfigItem>`
      Parameters:
        `item` -
      Returns:
        `null` on success and an error message otherwise.

    - #### setAutoloadTimer

          public void setAutoloadTimer(long delay)

      Method description
      Specified by:
        `setAutoloadTimer` in interface `ComponentRepository<ConfigItem>`
      Parameters:
        `delay` -

Copyright © 2013 Tigase. All rights reserved.