Package tigase.conf
Class ConfigXMLRepository
java.lang.Object
tigase.conf.ConfigurationCache
tigase.conf.ConfigXMLRepository
- All Implemented Interfaces:
Iterable<ConfigItem>,ConfigRepositoryIfc,ComponentRepository<ConfigItem>,Repository
Class
ConfigXMLRepository provides access to configuration settings.
Created: Sat Nov 13 18:53:21 2004
- Author:
- Artur Hefczyc
-
Nested Class Summary
Nested classes/interfaces inherited from interface tigase.db.Repository
Repository.Meta, Repository.SchemaId -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class tigase.conf.ConfigurationCache
CONFIG_DUMP_FILE_PROP_DEF, CONFIG_DUMP_FILE_PROP_KEYFields inherited from interface tigase.db.comp.ComponentRepository
COMP_REPO_BINDFields inherited from interface tigase.conf.ConfigRepositoryIfc
RELOAD_DELAY, RESOURCE_URI -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddItem(String compName, ConfigItem item) allItems()Returns a collection with all items stored in the repository.String[]Returns all component names for which there are some configuration settings available.static ConfigXMLRepositorystatic ConfigXMLRepositorygetConfigRepository(boolean debug, String file_name) static ConfigXMLRepositorygetConfigRepository(String file_name) getItemsForComponent(String compName) Get set of config items stored for componentString[]Returns an array of all configuration keys for a given component and configuration node.voidinitRepository(String repo_uri, Map<String, String> params) Method is deprecated and should not be user any more.nodeForPackage(Class cls) voidremoveItem(String compName, ConfigItem item) intsize()The method returns number of items in the repository.voidstore()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, removeItemNoStore, removeRepoChangeListener, set, setAutoloadTimer, setDefHostname, setProperties, validateItemMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
COMPONENT_NODE
- See Also:
-
ROOT_NODE
- See Also:
-
XMPP_CONFIG_FILE_PROPERTY_KEY
- See Also:
-
XMPP_CONFIG_FILE_PROPERTY_VAL
- See Also:
-
-
Constructor Details
-
ConfigXMLRepository
public ConfigXMLRepository()
-
-
Method Details
-
getConfigRepository
- Throws:
XMLDBException
-
getConfigRepository
- Throws:
XMLDBException
-
getConfigRepository
public static ConfigXMLRepository getConfigRepository(boolean debug, String file_name) throws XMLDBException - Throws:
XMLDBException
-
addItem
- Overrides:
addItemin classConfigurationCache
-
allItems
Description copied from interface:ComponentRepositoryReturns a collection with all items stored in the repository.- Specified by:
allItemsin interfaceComponentRepository<ConfigItem>- Overrides:
allItemsin classConfigurationCache- Throws:
TigaseDBException
-
getCompNames
Description copied from interface:ConfigRepositoryIfcReturns all component names for which there are some configuration settings available.- Specified by:
getCompNamesin interfaceConfigRepositoryIfc- Overrides:
getCompNamesin classConfigurationCache- Returns:
- array of component names
-
getItem
- Overrides:
getItemin classConfigurationCache
-
getItemsForComponent
Description copied from interface:ConfigRepositoryIfcGet set of config items stored for component- Specified by:
getItemsForComponentin interfaceConfigRepositoryIfc- Overrides:
getItemsForComponentin classConfigurationCache- Returns:
- set of component items
-
getKeys
Description copied from interface:ConfigRepositoryIfcReturns an array of all configuration keys for a given component and configuration node.- Specified by:
getKeysin interfaceConfigRepositoryIfc- Overrides:
getKeysin classConfigurationCache- Returns:
- array of keys for component and node
-
initRepository
Description copied from interface:RepositoryMethod is deprecated and should not be user any more.
The method is called to initialize the data repository. Depending on the implementation all the initialization parameters can be passed either viaresource_uriparameter as the database connection string or viaparamsmap if the required repository parameters are more complex or both.- Specified by:
initRepositoryin interfaceRepository- Overrides:
initRepositoryin classConfigurationCache- Parameters:
repo_uri- value in most cases representing the database connection string.params- is aMapwith 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
-
removeItem
- Overrides:
removeItemin classConfigurationCache
-
size
public int size()Description copied from interface:ComponentRepositoryThe method returns number of items in the repository.- Specified by:
sizein interfaceComponentRepository<ConfigItem>- Overrides:
sizein classConfigurationCache- Returns:
- an
intvalue with number of items in the repository.
-
store
Description copied from interface:ComponentRepositoryThe 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:
storein interfaceComponentRepository<ConfigItem>- Overrides:
storein classConfigurationCache- Throws:
TigaseDBException
-