net.ontopia.topicmaps.entry
Class TopicMapSourceManager

java.lang.Object
  extended by net.ontopia.topicmaps.entry.TopicMapSourceManager
All Implemented Interfaces:
TopicMapRepositoryIF

public class TopicMapSourceManager
extends java.lang.Object
implements TopicMapRepositoryIF

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.


Constructor Summary
TopicMapSourceManager()
           
TopicMapSourceManager(java.util.Collection 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.
 TopicMapStoreIF createStore(java.lang.String refkey, boolean readonly)
          PUBLIC: Creates a new topic map store for the given topic map id.
 java.util.Collection 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 getReferenceKeys()
          PUBLIC: Returns a collection containing the keys of all references.
 java.util.Collection 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 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
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TopicMapSourceManager

public TopicMapSourceManager()

TopicMapSourceManager

public TopicMapSourceManager(TopicMapSourceIF source)

TopicMapSourceManager

public TopicMapSourceManager(java.util.Collection sources)
Method Detail

getReferences

public java.util.Collection getReferences()
Description copied from interface: TopicMapRepositoryIF
PUBLIC: Returns a collection containing all references.

Specified by:
getReferences in interface TopicMapRepositoryIF

getReferenceKeys

public java.util.Collection getReferenceKeys()
Description copied from interface: TopicMapRepositoryIF
PUBLIC: Returns a collection containing the keys of all references.

Specified by:
getReferenceKeys in interface TopicMapRepositoryIF

getReferenceByKey

public TopicMapReferenceIF getReferenceByKey(java.lang.String key)
Description copied from interface: TopicMapRepositoryIF
PUBLIC: Gets a topic map reference by its reference key. Returns null if not found.

Specified by:
getReferenceByKey in interface TopicMapRepositoryIF

getReferenceKey

public java.lang.String getReferenceKey(TopicMapReferenceIF ref)
Description copied from interface: TopicMapRepositoryIF
PUBLIC: Gets the key used to identify the reference in the repository.

Specified by:
getReferenceKey in interface TopicMapRepositoryIF

createStore

public TopicMapStoreIF createStore(java.lang.String refkey,
                                   boolean readonly)
Description copied from interface: TopicMapRepositoryIF
PUBLIC: Creates a new topic map store for the given topic map id. This method effectively delegates the call to the underlying topic map reference. An exception is thrown if the topic map reference cannot be found or any errors occurs while loading it.

Specified by:
createStore in interface TopicMapRepositoryIF

getSourceById

public TopicMapSourceIF getSourceById(java.lang.String source_id)
Description copied from interface: TopicMapRepositoryIF
PUBLIC: Returns the topic map source that has the given source id.

Specified by:
getSourceById in interface TopicMapRepositoryIF

getSources

public java.util.Collection getSources()
Description copied from interface: TopicMapRepositoryIF
PUBLIC: Returns an immutable collection containing the TopicMapSourceIFs registered with the topic map repository.

Specified by:
getSources in interface TopicMapRepositoryIF

addSource

public void addSource(TopicMapSourceIF source)
Description copied from interface: TopicMapRepositoryIF
PUBLIC: Adds the source to the repository.

Specified by:
addSource in interface TopicMapRepositoryIF

removeSource

public void removeSource(TopicMapSourceIF source)
Description copied from interface: TopicMapRepositoryIF
PUBLIC: Removes the source from the repository.

Specified by:
removeSource in interface TopicMapRepositoryIF

refresh

public void refresh()
Description copied from interface: TopicMapRepositoryIF
PUBLIC: Refreshes all sources and recreates the reference map.

Specified by:
refresh in interface TopicMapRepositoryIF

close

public void close()
Description copied from interface: TopicMapRepositoryIF
PUBLIC: Closes the repository and releases all resources bound by the repository. Closing the repository will also close any open topic map references held by the topic map repository.

Specified by:
close in interface TopicMapRepositoryIF

getReferenceById

public TopicMapReferenceIF getReferenceById(java.lang.String reference_id)
Deprecated. replaced by getReferenceByKey(String)

INTERNAL: Gets the reference that has the given id.


hasId

public boolean hasId(java.lang.String reference_id)
Deprecated. use 'getReferenceByKey(key) != null' instead

INTERNAL: Returns true if the manager manages a reference with the given id.


getIds

public java.util.Collection getIds()
Deprecated. replaced by getReferenceKeys()

INTERNAL: Gets the ids of the references managed by this manager.



Copyright © 2000-2009 Ontopia.