public class TopicMapSourceManager extends Object implements TopicMapRepositoryIF
The reference keys used are the reference ids retrieved from
reference.getId(). An exception will be thrown if
there are duplicate reference keys.
The sources that are added to the repository must have unique ids. If the source id is not specified, the source cannot be looked up by id.
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,TopicMapReferenceIF> |
keyrefs |
protected Map<TopicMapReferenceIF,String> |
refkeys |
protected boolean |
refreshed |
protected Map<String,TopicMapSourceIF> |
smap |
protected Set<TopicMapSourceIF> |
sources |
| Constructor and Description |
|---|
TopicMapSourceManager() |
TopicMapSourceManager(Collection<TopicMapSourceIF> sources) |
TopicMapSourceManager(TopicMapSourceIF source) |
| Modifier and Type | Method and Description |
|---|---|
void |
addSource(TopicMapSourceIF source)
PUBLIC: Adds the source to the repository.
|
void |
close()
PUBLIC: Closes the repository and releases all resources bound by
the repository.
|
protected String |
createReferenceKey(TopicMapReferenceIF ref)
INTERNAL: Creates a unique id.
|
TopicMapStoreIF |
createStore(String refkey,
boolean readonly)
PUBLIC: Creates a new topic map store for the given topic map
id.
|
TopicMapReferenceIF |
getReferenceByKey(String key)
PUBLIC: Gets a topic map reference by its reference key.
|
String |
getReferenceKey(TopicMapReferenceIF ref)
PUBLIC: Gets the key used to identify the reference in the
repository.
|
Collection<String> |
getReferenceKeys()
PUBLIC: Returns a collection containing the keys of all references.
|
Collection<TopicMapReferenceIF> |
getReferences()
PUBLIC: Returns a collection containing all references.
|
TopicMapSourceIF |
getSourceById(String source_id)
PUBLIC: Returns the topic map source that has the given source id.
|
Collection<TopicMapSourceIF> |
getSources()
PUBLIC: Returns an immutable collection containing the
TopicMapSourceIFs registered with the topic map repository.
|
void |
refresh()
PUBLIC: Refreshes all sources and recreates the reference map.
|
void |
removeSource(TopicMapSourceIF source)
PUBLIC: Removes the source from the repository.
|
protected Set<TopicMapSourceIF> sources
protected Map<String,TopicMapSourceIF> smap
protected boolean refreshed
protected Map<String,TopicMapReferenceIF> keyrefs
protected Map<TopicMapReferenceIF,String> refkeys
public TopicMapSourceManager()
public TopicMapSourceManager(TopicMapSourceIF source)
public TopicMapSourceManager(Collection<TopicMapSourceIF> sources)
public Collection<TopicMapReferenceIF> getReferences()
TopicMapRepositoryIFgetReferences in interface TopicMapRepositoryIFpublic Collection<String> getReferenceKeys()
TopicMapRepositoryIFgetReferenceKeys in interface TopicMapRepositoryIFpublic TopicMapReferenceIF getReferenceByKey(String key)
TopicMapRepositoryIFgetReferenceByKey in interface TopicMapRepositoryIFpublic String getReferenceKey(TopicMapReferenceIF ref)
TopicMapRepositoryIFgetReferenceKey in interface TopicMapRepositoryIFpublic TopicMapStoreIF createStore(String refkey, boolean readonly)
TopicMapRepositoryIFcreateStore in interface TopicMapRepositoryIFpublic TopicMapSourceIF getSourceById(String source_id)
TopicMapRepositoryIFgetSourceById in interface TopicMapRepositoryIFpublic Collection<TopicMapSourceIF> getSources()
TopicMapRepositoryIFgetSources in interface TopicMapRepositoryIFpublic void addSource(TopicMapSourceIF source)
TopicMapRepositoryIFaddSource in interface TopicMapRepositoryIFpublic void removeSource(TopicMapSourceIF source)
TopicMapRepositoryIFremoveSource in interface TopicMapRepositoryIFpublic void refresh()
TopicMapRepositoryIFrefresh in interface TopicMapRepositoryIFprotected String createReferenceKey(TopicMapReferenceIF ref)
public void close()
TopicMapRepositoryIFclose in interface TopicMapRepositoryIF