public class CompSQLRepository extends Object implements ComponentRepository<CompRepoItem>
| Modifier and Type | Field and Description |
|---|---|
static String |
REPO_URI_PROP_KEY
Field description
|
static String |
TABLE_NAME
Field description
|
COMP_REPO_BIND| Constructor and Description |
|---|
CompSQLRepository() |
| Modifier and Type | Method and Description |
|---|---|
void |
addItem(CompRepoItem item)
Method description
|
void |
addRepoChangeListener(RepositoryChangeListenerIfc<CompRepoItem> repoChangeListener)
Method description
|
Collection<CompRepoItem> |
allItems()
Method description
|
boolean |
contains(String key)
Method description
|
void |
getDefaults(Map<String,Object> defs,
Map<String,Object> params)
Method description
|
CompRepoItem |
getItem(String key)
Method description
|
CompRepoItem |
getItemInstance()
Method description
|
void |
initRepository(String conn_str,
Map<String,String> params)
Method description
|
Iterator<CompRepoItem> |
iterator()
Method description
|
void |
reload()
Method description
|
void |
removeItem(String key)
Method description
|
void |
removeRepoChangeListener(RepositoryChangeListenerIfc<CompRepoItem> 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 |
validateItem(CompRepoItem item)
Method description
|
public static final String REPO_URI_PROP_KEY
public static final String TABLE_NAME
public void addRepoChangeListener(RepositoryChangeListenerIfc<CompRepoItem> repoChangeListener)
addRepoChangeListener in interface ComponentRepository<CompRepoItem>repoChangeListener - public void removeRepoChangeListener(RepositoryChangeListenerIfc<CompRepoItem> repoChangeListener)
removeRepoChangeListener in interface ComponentRepository<CompRepoItem>repoChangeListener - public void addItem(CompRepoItem item)
addItem in interface ComponentRepository<CompRepoItem>item - public Collection<CompRepoItem> allItems()
allItems in interface ComponentRepository<CompRepoItem>public boolean contains(String key)
contains in interface ComponentRepository<CompRepoItem>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<CompRepoItem>defs - params - public CompRepoItem getItem(String key)
getItem in interface ComponentRepository<CompRepoItem>key - Item for a given key or null if the
item is not in the repository.public CompRepoItem getItemInstance()
getItemInstance in interface ComponentRepository<CompRepoItem>public void initRepository(String conn_str, Map<String,String> params) throws SQLException
conn_str - params - SQLExceptionpublic Iterator<CompRepoItem> iterator()
iterator in interface Iterable<CompRepoItem>public void reload()
reload in interface ComponentRepository<CompRepoItem>public void removeItem(String key)
removeItem in interface ComponentRepository<CompRepoItem>key - public void setProperties(Map<String,Object> properties)
setProperties in interface ComponentRepository<CompRepoItem>properties - public int size()
size in interface ComponentRepository<CompRepoItem>int value with number of items in the repository.public void store()
store in interface ComponentRepository<CompRepoItem>public String validateItem(CompRepoItem item)
validateItem in interface ComponentRepository<CompRepoItem>item - null on success and an error message otherwise.public void setAutoloadTimer(long delay)
setAutoloadTimer in interface ComponentRepository<CompRepoItem>delay - Copyright © 2013 Tigase. All rights reserved.