public class ClConConfigRepository extends ConfigRepository<ClusterRepoItem> implements ShutdownHook
Repository.Meta
Modifier and Type | Field and Description |
---|---|
protected boolean |
auto_remove_obsolete_items |
static String |
AUTO_REMOVE_OBSOLETE_ITEMS_PROP_KEY |
protected long |
autoreload_interval |
static String |
AUTORELOAD_INTERVAL_PROP_KEY |
static long |
AUTORELOAD_INTERVAL_PROP_VAL |
protected boolean |
firstLoadDone |
protected long |
lastReloadTime |
protected long |
lastReloadTimeFactor |
items, itemsHash
COMP_REPO_BIND
Constructor and Description |
---|
ClConConfigRepository() |
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Method destroys this instance of ComponentRepository releasing resources
allocated for this instance of ComponentRepository if possible
|
String |
getConfigKey()
Method description
|
String[] |
getDefaultPropetyItems()
Method description
|
void |
getDefaults(Map<String,Object> defs,
Map<String,Object> params)
The method is called to obtain default configuration settings if there are
any for this repository implementation The configuration settings are
implementation dependent and there are no defaults set by the server.
|
ClusterRepoItem |
getItemInstance()
Creates a new, uninitialized instance of the repository Item.
|
String |
getName() |
String |
getPropertyKey()
Method description
|
void |
initRepository(String resource_uri,
Map<String,String> params)
The method is called to initialize the data repository.
|
boolean |
itemChanged(ClusterRepoItem oldItem,
ClusterRepoItem newItem)
Method description
|
void |
itemLoaded(ClusterRepoItem item) |
void |
reload()
This method is called to reload items from the database or other permanent
storage.
|
void |
setProperties(Map<String,Object> props)
The method is called to set configuration for this repository
implementation.
|
String |
shutdown() |
void |
storeItem(ClusterRepoItem item) |
addItem, addItemNoStore, addRepoChangeListener, allItems, contains, getItem, initItemsMap, iterator, removeItem, removeRepoChangeListener, setAutoloadTimer, size, store, toString, validateItem
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public static final String AUTORELOAD_INTERVAL_PROP_KEY
public static final String AUTO_REMOVE_OBSOLETE_ITEMS_PROP_KEY
public static final long AUTORELOAD_INTERVAL_PROP_VAL
protected long autoreload_interval
protected boolean auto_remove_obsolete_items
protected long lastReloadTime
protected long lastReloadTimeFactor
protected boolean firstLoadDone
public void destroy()
ComponentRepository
destroy
in interface ComponentRepository<ClusterRepoItem>
public String[] getDefaultPropetyItems()
ConfigRepository
getDefaultPropetyItems
in class ConfigRepository<ClusterRepoItem>
public String getName()
getName
in interface ShutdownHook
public String getPropertyKey()
ConfigRepository
getPropertyKey
in class ConfigRepository<ClusterRepoItem>
public String getConfigKey()
ConfigRepository
getConfigKey
in class ConfigRepository<ClusterRepoItem>
public ClusterRepoItem getItemInstance()
ComponentRepository
getItemInstance
in interface ComponentRepository<ClusterRepoItem>
public void initRepository(String resource_uri, Map<String,String> params) throws DBInitException
Repository
resource_uri
parameter as the database connection string or via params
map if
the required repository parameters are more complex or both.initRepository
in interface Repository
resource_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.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.public void reload()
ComponentRepository
reload
in interface ComponentRepository<ClusterRepoItem>
reload
in class ConfigRepository<ClusterRepoItem>
public void itemLoaded(ClusterRepoItem item)
public boolean itemChanged(ClusterRepoItem oldItem, ClusterRepoItem newItem)
ConfigRepository
itemChanged
in class ConfigRepository<ClusterRepoItem>
public void getDefaults(Map<String,Object> defs, Map<String,Object> params)
ComponentRepository
getDefaults
in interface ComponentRepository<ClusterRepoItem>
getDefaults
in class ConfigRepository<ClusterRepoItem>
defs
- is a Map
collection where all repository
configuration defaults must be put.params
- is a Map
collection with some preset properties for
the server. These settings can be used to adjust repository
defaults, for example they can contain database connection URL or
initial list of virtual domains.public void setProperties(Map<String,Object> props)
ComponentRepository
setProperties
in interface ComponentRepository<ClusterRepoItem>
setProperties
in class ConfigRepository<ClusterRepoItem>
props
- a Map
with configuration settings. Content of this
Map
must not be modified. This read-only collection.public String shutdown()
shutdown
in interface ShutdownHook
public void storeItem(ClusterRepoItem item)
Copyright © 2019 "Tigase, Inc.". All rights reserved.