Item
- public abstract class ConfigRepository<Item extends RepositoryItem> extends Object implements ComponentRepository<Item>
Repository.Meta
Modifier and Type | Field and Description |
---|---|
protected Map<String,Item> |
items
Field description
|
protected int |
itemsHash |
COMP_REPO_BIND
Constructor and Description |
---|
ConfigRepository() |
Modifier and Type | Method and Description |
---|---|
void |
addItem(Item item)
Method description
|
void |
addItemNoStore(Item item)
The method adds a new or updates existing Item.
|
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
|
protected void |
initItemsMap()
Method create instance of items Map.
|
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
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
destroy, getItemInstance
initRepository
protected Map<String,Item extends RepositoryItem> items
protected int itemsHash
public void setAutoloadTimer(long delay)
setAutoloadTimer
in interface ComponentRepository<Item extends RepositoryItem>
delay
- public void addRepoChangeListener(RepositoryChangeListenerIfc<Item> repoChangeListener)
addRepoChangeListener
in interface ComponentRepository<Item extends RepositoryItem>
repoChangeListener
- public void removeRepoChangeListener(RepositoryChangeListenerIfc<Item> repoChangeListener)
removeRepoChangeListener
in interface ComponentRepository<Item extends RepositoryItem>
repoChangeListener
- public abstract String getConfigKey()
public abstract String[] getDefaultPropetyItems()
public abstract String getPropertyKey()
public void addItem(Item item)
addItem
in interface ComponentRepository<Item extends RepositoryItem>
item
- public void addItemNoStore(Item item)
ComponentRepository
addItemNoStore
in interface ComponentRepository<Item extends RepositoryItem>
item
- a Item
with all it's configuration parameters.protected void initItemsMap()
public boolean itemChanged(Item oldItem, Item newItem)
oldItem
- newItem
- public Collection<Item> allItems()
allItems
in interface ComponentRepository<Item extends RepositoryItem>
public boolean contains(String key)
contains
in interface ComponentRepository<Item extends RepositoryItem>
key
- boolean
value true
if the item exists
in the repository or false
of it does not.public void getDefaults(Map<String,Object> defs, Map<String,Object> params)
getDefaults
in interface ComponentRepository<Item extends RepositoryItem>
defs
- params
- public Item getItem(String key)
getItem
in interface ComponentRepository<Item extends RepositoryItem>
key
- Item
for a given key or null
if the
item is not in the repository.public Iterator<Item> iterator()
iterator
in interface Iterable<Item extends RepositoryItem>
public void reload()
reload
in interface ComponentRepository<Item extends RepositoryItem>
public void removeItem(String key)
removeItem
in interface ComponentRepository<Item extends RepositoryItem>
key
- public void setProperties(Map<String,Object> properties)
setProperties
in interface ComponentRepository<Item extends RepositoryItem>
properties
- public int size()
size
in interface ComponentRepository<Item extends RepositoryItem>
int
value with number of items in the repository.public void store()
store
in interface ComponentRepository<Item extends RepositoryItem>
public String validateItem(Item item)
validateItem
in interface ComponentRepository<Item extends RepositoryItem>
item
- null
on success and an error message otherwise.Copyright © 2014 "Tigase, Inc.". All rights reserved.