tigase.conf
Class ConfigurationCache

java.lang.Object
  extended by 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 inherited from interface tigase.conf.ConfigRepositoryIfc
RELOAD_DELAY, RESOURCE_URI
 
Fields inherited from interface tigase.db.ComponentRepository
COMP_REPO_BIND
 
Constructor Summary
ConfigurationCache()
           
 
Method Summary
 void addItem(ConfigItem item)
          Method description
 void addItem(String compName, ConfigItem item)
          Method description
 void addItem(String key, Object value)
          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 set(String compName, String node, String key, Object value)
          Method description
 void setDefHostname(String hostname)
          Method description
 void setProperties(Map<String,Object> properties)
          Method description
 int size()
          Method description
 void store()
          Method description
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigurationCache

public ConfigurationCache()
Method Detail

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>
Returns:
Throws:
TigaseDBException

contains

public boolean contains(String key)
Method description

Specified by:
contains in interface ComponentRepository<ConfigItem>
Parameters:
key -
Returns:

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 -
Returns:

getCompNames

public String[] getCompNames()
Method description

Specified by:
getCompNames in interface ConfigRepositoryIfc
Returns:

getDefHostname

public String getDefHostname()
Method description

Returns:

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
Returns:

getItem

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

Parameters:
compName -
node -
key -
Returns:

getItem

public ConfigItem getItem(String key)
Method description

Specified by:
getItem in interface ComponentRepository<ConfigItem>
Parameters:
key -
Returns:

getItemInstance

public ConfigItem getItemInstance()
Method description

Specified by:
getItemInstance in interface ComponentRepository<ConfigItem>
Returns:

getItemsForComponent

public Set<ConfigItem> getItemsForComponent(String compName)
Method description

Parameters:
compName -
Returns:

getKeys

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

Specified by:
getKeys in interface ConfigRepositoryIfc
Parameters:
compName -
node -
Returns:

getProperties

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

Specified by:
getProperties in interface ConfigRepositoryIfc
Parameters:
compName -
Returns:
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>
Returns:

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:

store

public void store()
           throws TigaseDBException
Method description

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


Copyright © 2001-2006 Tigase Developers Team. All rights Reserved.