tigase.db.comp

## Class ConfigRepository<Item extends RepositoryItem>

- java.lang.Object
- - tigase.db.comp.ConfigRepository<Item>

- Type Parameters:
    `Item` -
  All Implemented Interfaces:
    Iterable<Item>, ComponentRepository<Item>
  Direct Known Subclasses:
    ClConConfigRepository, CompConfigRepository, UserRepoRepository, VhostConfigRepository

      public abstract class ConfigRepository<Item extends RepositoryItem>
      extends Object
      implements ComponentRepository<Item>

  Created: Oct 3, 2009 2:58:41 PM
  Version:
    $Rev$
  Author:
    Artur Hefczyc

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected ConcurrentSkipListMap<String,Item>` | `items` Field description

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

      `COMP_REPO_BIND`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ConfigRepository()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addItem(Item item)` Method description
    `void` | `addRepoChangeListener(RepositoryChangeListenerIfc<Item> repoChangeListener)` Method description
    `Collection<Item>` | `allItems()` Method description
    `boolean` | `contains(String key)` Method description
    `abstract String` | `getConfigKey()` Method description
    `abstract String[]` | `getDefaultPropetyItems()` Method description
    `void` | `getDefaults(Map<String,Object> defs, Map<String,Object> params)` Method description
    `Item` | `getItem(String key)` Method description
    `abstract String` | `getPropertyKey()` Method description
    `boolean` | `itemChanged(Item oldItem, Item newItem)` Method description
    `Iterator<Item>` | `iterator()` Method description
    `void` | `reload()` Method description
    `void` | `removeItem(String key)` Method description
    `void` | `removeRepoChangeListener(RepositoryChangeListenerIfc<Item> repoChangeListener)` Method description
    `void` | `setAutoloadTimer(long delay)` Method description
    `void` | `setProperties(Map<String,Object> properties)` Method description
    `int` | `size()` Method description
    `void` | `store()` Method description
    `String` | `toString()` Method description
    `String` | `validateItem(Item item)` Method description

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

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

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

      `getItemInstance`

- - ### Field Detail

    - #### items

          protected ConcurrentSkipListMap<String,Item extends RepositoryItem> items

      Field description

  - ### Constructor Detail

    - #### ConfigRepository

          public ConfigRepository()

  - ### Method Detail

    - #### setAutoloadTimer

          public void setAutoloadTimer(long delay)

      Method description
      Specified by:
        `setAutoloadTimer` in interface `ComponentRepository<Item extends RepositoryItem>`
      Parameters:
        `delay` -

    - #### addRepoChangeListener

          public void addRepoChangeListener(RepositoryChangeListenerIfc<Item> repoChangeListener)

      Method description
      Specified by:
        `addRepoChangeListener` in interface `ComponentRepository<Item extends RepositoryItem>`
      Parameters:
        `repoChangeListener` -

    - #### removeRepoChangeListener

          public void removeRepoChangeListener(RepositoryChangeListenerIfc<Item> repoChangeListener)

      Method description
      Specified by:
        `removeRepoChangeListener` in interface `ComponentRepository<Item extends RepositoryItem>`
      Parameters:
        `repoChangeListener` -

    - #### toString

          public String toString()

      Method description
      Overrides:
        `toString` in class `Object`

    - #### getConfigKey

          public abstract String getConfigKey()

      Method description

    - #### getDefaultPropetyItems

          public abstract String[] getDefaultPropetyItems()

      Method description

    - #### getPropertyKey

          public abstract String getPropertyKey()

      Method description

    - #### addItem

          public void addItem(Item item)

      Method description
      Specified by:
        `addItem` in interface `ComponentRepository<Item extends RepositoryItem>`
      Parameters:
        `item` -

    - #### itemChanged

          public boolean itemChanged(Item oldItem,
                            Item newItem)

      Method description
      Parameters:
        `oldItem` -
        `newItem` -

    - #### allItems

          public Collection<Item> allItems()

      Method description
      Specified by:
        `allItems` in interface `ComponentRepository<Item extends RepositoryItem>`

    - #### contains

          public boolean contains(String key)

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

    - #### getDefaults

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

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

    - #### getItem

          public Item getItem(String key)

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

    - #### iterator

          public Iterator<Item> iterator()

      Method description
      Specified by:
        `iterator` in interface `Iterable<Item extends RepositoryItem>`

    - #### reload

          public void reload()

      Method description
      Specified by:
        `reload` in interface `ComponentRepository<Item extends RepositoryItem>`

    - #### removeItem

          public void removeItem(String key)

      Method description
      Specified by:
        `removeItem` in interface `ComponentRepository<Item extends RepositoryItem>`
      Parameters:
        `key` -

    - #### setProperties

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

      Method description
      Specified by:
        `setProperties` in interface `ComponentRepository<Item extends RepositoryItem>`
      Parameters:
        `properties` -

    - #### size

          public int size()

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

    - #### store

          public void store()

      Method description
      Specified by:
        `store` in interface `ComponentRepository<Item extends RepositoryItem>`

    - #### validateItem

          public String validateItem(Item item)

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

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