|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.ontopia.topicmaps.entry.TopicMapSourceManager
public class TopicMapSourceManager
INTERNAL: This is the primary implementation of the TopicMapRepositoryIF interface. This class also implements the TopicMapSourceIF interface making it a topic map source that behaves as a facade for the results of multiple topic map sources.
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.
Field Summary | |
---|---|
protected java.util.Map<java.lang.String,TopicMapReferenceIF> |
keyrefs
|
protected java.util.Map<TopicMapReferenceIF,java.lang.String> |
refkeys
|
protected boolean |
refreshed
|
protected java.util.Map<java.lang.String,TopicMapSourceIF> |
smap
|
protected java.util.Set<TopicMapSourceIF> |
sources
|
Constructor Summary | |
---|---|
TopicMapSourceManager()
|
|
TopicMapSourceManager(java.util.Collection<TopicMapSourceIF> sources)
|
|
TopicMapSourceManager(TopicMapSourceIF source)
|
Method Summary | |
---|---|
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 java.lang.String |
createReferenceKey(TopicMapReferenceIF ref)
INTERNAL: Creates a unique id. |
TopicMapStoreIF |
createStore(java.lang.String refkey,
boolean readonly)
PUBLIC: Creates a new topic map store for the given topic map id. |
java.util.Collection<java.lang.String> |
getIds()
Deprecated. replaced by getReferenceKeys() |
TopicMapReferenceIF |
getReferenceById(java.lang.String reference_id)
Deprecated. replaced by getReferenceByKey(String) |
TopicMapReferenceIF |
getReferenceByKey(java.lang.String key)
PUBLIC: Gets a topic map reference by its reference key. |
java.lang.String |
getReferenceKey(TopicMapReferenceIF ref)
PUBLIC: Gets the key used to identify the reference in the repository. |
java.util.Collection<java.lang.String> |
getReferenceKeys()
PUBLIC: Returns a collection containing the keys of all references. |
java.util.Collection<TopicMapReferenceIF> |
getReferences()
PUBLIC: Returns a collection containing all references. |
TopicMapSourceIF |
getSourceById(java.lang.String source_id)
PUBLIC: Returns the topic map source that has the given source id. |
java.util.Collection<TopicMapSourceIF> |
getSources()
PUBLIC: Returns an immutable collection containing the TopicMapSourceIFs registered with the topic map repository. |
boolean |
hasId(java.lang.String reference_id)
Deprecated. use 'getReferenceByKey(key) != null' instead |
void |
refresh()
PUBLIC: Refreshes all sources and recreates the reference map. |
void |
removeSource(TopicMapSourceIF source)
PUBLIC: Removes the source from the repository. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.Set<TopicMapSourceIF> sources
protected java.util.Map<java.lang.String,TopicMapSourceIF> smap
protected boolean refreshed
protected java.util.Map<java.lang.String,TopicMapReferenceIF> keyrefs
protected java.util.Map<TopicMapReferenceIF,java.lang.String> refkeys
Constructor Detail |
---|
public TopicMapSourceManager()
public TopicMapSourceManager(TopicMapSourceIF source)
public TopicMapSourceManager(java.util.Collection<TopicMapSourceIF> sources)
Method Detail |
---|
public java.util.Collection<TopicMapReferenceIF> getReferences()
TopicMapRepositoryIF
getReferences
in interface TopicMapRepositoryIF
public java.util.Collection<java.lang.String> getReferenceKeys()
TopicMapRepositoryIF
getReferenceKeys
in interface TopicMapRepositoryIF
public TopicMapReferenceIF getReferenceByKey(java.lang.String key)
TopicMapRepositoryIF
getReferenceByKey
in interface TopicMapRepositoryIF
public java.lang.String getReferenceKey(TopicMapReferenceIF ref)
TopicMapRepositoryIF
getReferenceKey
in interface TopicMapRepositoryIF
public TopicMapStoreIF createStore(java.lang.String refkey, boolean readonly)
TopicMapRepositoryIF
createStore
in interface TopicMapRepositoryIF
public TopicMapSourceIF getSourceById(java.lang.String source_id)
TopicMapRepositoryIF
getSourceById
in interface TopicMapRepositoryIF
public java.util.Collection<TopicMapSourceIF> getSources()
TopicMapRepositoryIF
getSources
in interface TopicMapRepositoryIF
public void addSource(TopicMapSourceIF source)
TopicMapRepositoryIF
addSource
in interface TopicMapRepositoryIF
public void removeSource(TopicMapSourceIF source)
TopicMapRepositoryIF
removeSource
in interface TopicMapRepositoryIF
public void refresh()
TopicMapRepositoryIF
refresh
in interface TopicMapRepositoryIF
protected java.lang.String createReferenceKey(TopicMapReferenceIF ref)
public void close()
TopicMapRepositoryIF
close
in interface TopicMapRepositoryIF
public TopicMapReferenceIF getReferenceById(java.lang.String reference_id)
public boolean hasId(java.lang.String reference_id)
public java.util.Collection<java.lang.String> getIds()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |