tigase.conf

## Class ConfigXMLRepository

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

- All Implemented Interfaces:
    Iterable<ConfigItem>, ConfigRepositoryIfc, ComponentRepository<ConfigItem>, Repository

      public class ConfigXMLRepository
      extends ConfigurationCache

  Class `ConfigXMLRepository` provides access to configuration settings.

  Created: Sat Nov 13 18:53:21 2004

  Version:
    $Rev$
  Author:
    Artur Hefczyc

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface tigase.db.Repository

      `Repository.Meta`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `COMPONENT_NODE` Field description
    `static String` | `ROOT_NODE` Field description
    `static String` | `XMPP_CONFIG_FILE_PROPERTY_KEY` Field description
    `static String` | `XMPP_CONFIG_FILE_PROPERTY_VAL` Field description

    - ### Fields inherited from class tigase.conf.ConfigurationCache

      `CONFIG_DUMP_FILE_PROP_DEF, CONFIG_DUMP_FILE_PROP_KEY`

    - ### 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
    `ConfigXMLRepository()` Constructs ...

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addItem(String compName, ConfigItem item)` Method description
    `Collection<ConfigItem>` | `allItems()` Returns a collection with all items stored in the repository.
    `String[]` | `getCompNames()` Returns all component names for which there are some configuration settings available.
    `static ConfigXMLRepository` | `getConfigRepository()` Method description
    `static ConfigXMLRepository` | `getConfigRepository(boolean debug, String file_name)` Method description
    `static ConfigXMLRepository` | `getConfigRepository(String file_name)` Method description
    `ConfigItem` | `getItem(String compName, String node, String key)` Method description
    `Set<ConfigItem>` | `getItemsForComponent(String compName)` Method description
    `String[]` | `getKeys(String root, String node)` Returns an array of all configuration keys for a given component and configuration node.
    `void` | `initRepository(String repo_uri, Map<String,String> params)` The method is called to initialize the data repository.
    `String` | `nodeForPackage(Class cls)` Method description
    `void` | `removeItem(String compName, ConfigItem item)` Method description
    `int` | `size()` The method returns number of items in the repository.
    `void` | `store()` The method is called to store all data in the database.

    - ### Methods inherited from class tigase.conf.ConfigurationCache

      `addItem, addItem, addItemNoStore, addRepoChangeListener, contains, destroy, get, getDefaults, getDefHostname, getInitProperties, getItem, getItemInstance, getProperties, iterator, putProperties, reload, remove, removeItem, removeRepoChangeListener, set, setAutoloadTimer, setDefHostname, setProperties, validateItem`

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

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

    - ### Methods inherited from interface java.lang.Iterable

      `forEach, spliterator`

- - ### Field Detail

    - #### COMPONENT_NODE

          public static final String COMPONENT_NODE

      Field description
      See Also:
        Constant Field Values

    - #### ROOT_NODE

          public static final String ROOT_NODE

      Field description
      See Also:
        Constant Field Values

    - #### XMPP_CONFIG_FILE_PROPERTY_KEY

          public static final String XMPP_CONFIG_FILE_PROPERTY_KEY

      Field description
      See Also:
        Constant Field Values

    - #### XMPP_CONFIG_FILE_PROPERTY_VAL

          public static final String XMPP_CONFIG_FILE_PROPERTY_VAL

      Field description
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ConfigXMLRepository

          public ConfigXMLRepository()

      Constructs ...

  - ### Method Detail

    - #### getConfigRepository

          public static ConfigXMLRepository getConfigRepository()
                                                         throws XMLDBException

      Method description
      Throws:
        `XMLDBException`

    - #### getConfigRepository

          public static ConfigXMLRepository getConfigRepository(String file_name)
                                                         throws XMLDBException

      Method description
      Parameters:
        `file_name` -
      Throws:
        `XMLDBException`

    - #### getConfigRepository

          public static ConfigXMLRepository getConfigRepository(boolean debug,
                                                                String file_name)
                                                         throws XMLDBException

      Method description
      Parameters:
        `debug` -
        `file_name` -
      Throws:
        `XMLDBException`

    - #### addItem

          public void addItem(String compName,
                              ConfigItem item)

      Description copied from class: `ConfigurationCache`
      Method description
      Overrides:
        `addItem` in class `ConfigurationCache`

    - #### allItems

          public Collection<ConfigItem> allItems()
                                          throws TigaseDBException

      Description copied from interface: `ComponentRepository`
      Returns a collection with all items stored in the repository.
      Specified by:
        `allItems` in interface `ComponentRepository<ConfigItem>`
      Overrides:
        `allItems` in class `ConfigurationCache`
      Throws:
        `TigaseDBException`

    - #### getCompNames

          public String[] getCompNames()

      Description copied from interface: `ConfigRepositoryIfc`
      Returns all component names for which there are some configuration settings available.
      Specified by:
        `getCompNames` in interface `ConfigRepositoryIfc`
      Overrides:
        `getCompNames` in class `ConfigurationCache`

    - #### getItem

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

      Description copied from class: `ConfigurationCache`
      Method description
      Overrides:
        `getItem` in class `ConfigurationCache`

    - #### getItemsForComponent

          public Set<ConfigItem> getItemsForComponent(String compName)

      Description copied from interface: `ConfigRepositoryIfc`
      Method description
      Specified by:
        `getItemsForComponent` in interface `ConfigRepositoryIfc`
      Overrides:
        `getItemsForComponent` in class `ConfigurationCache`

    - #### getKeys

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

      Description copied from interface: `ConfigRepositoryIfc`
      Returns an array of all configuration keys for a given component and configuration node.
      Specified by:
        `getKeys` in interface `ConfigRepositoryIfc`
      Overrides:
        `getKeys` in class `ConfigurationCache`

    - #### initRepository

          public void initRepository(String repo_uri,
                                     Map<String,String> params)
                              throws DBInitException

      Description copied from interface: `Repository`
      The method is called to initialize the data repository. Depending on the implementation all the initialization parameters can be passed either via `resource_uri` parameter as the database connection string or via `params` map if the required repository parameters are more complex or both.
      Specified by:
        `initRepository` in interface `Repository`
      Overrides:
        `initRepository` in class `ConfigurationCache`
      Parameters:
        `repo_uri` - value in most cases representing the database connection string.
        `params` - is a `Map` with repository properties necessary to initialize and perform all the functions. The initialization parameters are implementation dependent.
      Throws:
        `DBInitException` - if there was an error during repository initialization. Some implementations, though, perform so called lazy initialization so even though there is a problem with the underlying repository it may not be signaled through this method call.

    - #### nodeForPackage

          public String nodeForPackage(Class cls)

      Method description
      Parameters:
        `cls` -

    - #### removeItem

          public void removeItem(String compName,
                                 ConfigItem item)

      Description copied from class: `ConfigurationCache`
      Method description
      Overrides:
        `removeItem` in class `ConfigurationCache`

    - #### size

          public int size()

      Description copied from interface: `ComponentRepository`
      The method returns number of items in the repository.
      Specified by:
        `size` in interface `ComponentRepository<ConfigItem>`
      Overrides:
        `size` in class `ConfigurationCache`
      Returns:
        an `int` value with number of items in the repository.

    - #### store

          public void store()
                     throws TigaseDBException

      Description copied from interface: `ComponentRepository`
      The method is called to store all data in the database. It is used when the repository has been changed in some way and the changes have to be put to a permanent storage for later retrieval.
      Specified by:
        `store` in interface `ComponentRepository<ConfigItem>`
      Overrides:
        `store` in class `ConfigurationCache`
      Throws:
        `TigaseDBException`

Copyright © 2022 "Tigase, Inc.". All rights reserved.