net.ontopia.topicmaps.impl.basic
Class SubjectIdentityCache

java.lang.Object
  extended by net.ontopia.topicmaps.impl.utils.AbstractSubjectIdentityCache
      extended by net.ontopia.topicmaps.impl.basic.SubjectIdentityCache
All Implemented Interfaces:
java.io.Serializable, EventListenerIF

public class SubjectIdentityCache
extends AbstractSubjectIdentityCache
implements java.io.Serializable

INTERNAL: Class that maintains indexes for use with the TopicMapIF locator lookup methods. This is especially useful in the cases where the topic map object cannot use queries to do the lookups.

This class uses the event model to maintain its indexes.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class net.ontopia.topicmaps.impl.utils.AbstractSubjectIdentityCache
AbstractSubjectIdentityCache.EventHandler
 
Field Summary
protected  CollectionFactoryIF cfactory
           
protected  long counter
           
protected  java.util.Map<java.lang.String,TMObject> id_objects
           
protected  java.util.Map<LocatorIF,TMObjectIF> source_locators
           
protected  java.util.Map<LocatorIF,TopicIF> subject_indicators
           
protected  java.util.Map<LocatorIF,TopicIF> subjects
           
protected  TopicMapTransactionIF txn
           
 
Fields inherited from class net.ontopia.topicmaps.impl.utils.AbstractSubjectIdentityCache
handlers
 
Constructor Summary
SubjectIdentityCache(TopicMapTransactionIF txn, CollectionFactoryIF cfactory)
           
 
Method Summary
protected  TMObjectIF _getObjectByItemIdentifier(LocatorIF source_locator)
           
protected  TopicIF _getTopicBySubjectIdentifier(LocatorIF subject_indicator)
           
protected  TopicIF _getTopicBySubjectLocator(LocatorIF subject)
           
 TMObjectIF getObjectById(java.lang.String object_id)
           
 TMObjectIF getObjectByItemIdentifier(LocatorIF locator)
           
 TopicIF getTopicBySubjectIdentifier(LocatorIF locator)
           
 TopicIF getTopicBySubjectLocator(LocatorIF locator)
           
 void refresh()
           
protected  void registerObject(TMObjectIF o)
          INTERNAL: Register the object with the identity map.
protected  void registerSourceLocator(LocatorIF source_locator, TMObjectIF object)
           
protected  void registerSubject(LocatorIF subject, TopicIF object)
           
protected  void registerSubjectIndicator(LocatorIF subject_indicator, TopicIF object)
           
protected  void unregisterObject(TMObjectIF o)
          INTERNAL: Unregister the object with the identity map.
protected  void unregisterSourceLocator(LocatorIF source_locator)
           
protected  void unregisterSubject(LocatorIF subject)
           
protected  void unregisterSubjectIndicator(LocatorIF subject_indicator)
           
 
Methods inherited from class net.ontopia.topicmaps.impl.utils.AbstractSubjectIdentityCache
processEvent, registerListeners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

txn

protected TopicMapTransactionIF txn

cfactory

protected CollectionFactoryIF cfactory

counter

protected long counter

id_objects

protected java.util.Map<java.lang.String,TMObject> id_objects

subjects

protected java.util.Map<LocatorIF,TopicIF> subjects

subject_indicators

protected java.util.Map<LocatorIF,TopicIF> subject_indicators

source_locators

protected java.util.Map<LocatorIF,TMObjectIF> source_locators
Constructor Detail

SubjectIdentityCache

public SubjectIdentityCache(TopicMapTransactionIF txn,
                            CollectionFactoryIF cfactory)
Method Detail

refresh

public void refresh()

getObjectById

public TMObjectIF getObjectById(java.lang.String object_id)
Specified by:
getObjectById in class AbstractSubjectIdentityCache

getObjectByItemIdentifier

public TMObjectIF getObjectByItemIdentifier(LocatorIF locator)
Specified by:
getObjectByItemIdentifier in class AbstractSubjectIdentityCache

getTopicBySubjectLocator

public TopicIF getTopicBySubjectLocator(LocatorIF locator)
Specified by:
getTopicBySubjectLocator in class AbstractSubjectIdentityCache

getTopicBySubjectIdentifier

public TopicIF getTopicBySubjectIdentifier(LocatorIF locator)
Specified by:
getTopicBySubjectIdentifier in class AbstractSubjectIdentityCache

_getObjectByItemIdentifier

protected TMObjectIF _getObjectByItemIdentifier(LocatorIF source_locator)
Specified by:
_getObjectByItemIdentifier in class AbstractSubjectIdentityCache

registerSourceLocator

protected void registerSourceLocator(LocatorIF source_locator,
                                     TMObjectIF object)
Specified by:
registerSourceLocator in class AbstractSubjectIdentityCache

unregisterSourceLocator

protected void unregisterSourceLocator(LocatorIF source_locator)
Specified by:
unregisterSourceLocator in class AbstractSubjectIdentityCache

_getTopicBySubjectIdentifier

protected TopicIF _getTopicBySubjectIdentifier(LocatorIF subject_indicator)
Specified by:
_getTopicBySubjectIdentifier in class AbstractSubjectIdentityCache

registerSubjectIndicator

protected void registerSubjectIndicator(LocatorIF subject_indicator,
                                        TopicIF object)
Specified by:
registerSubjectIndicator in class AbstractSubjectIdentityCache

unregisterSubjectIndicator

protected void unregisterSubjectIndicator(LocatorIF subject_indicator)
Specified by:
unregisterSubjectIndicator in class AbstractSubjectIdentityCache

_getTopicBySubjectLocator

protected TopicIF _getTopicBySubjectLocator(LocatorIF subject)
Specified by:
_getTopicBySubjectLocator in class AbstractSubjectIdentityCache

registerSubject

protected void registerSubject(LocatorIF subject,
                               TopicIF object)
Specified by:
registerSubject in class AbstractSubjectIdentityCache

unregisterSubject

protected void unregisterSubject(LocatorIF subject)
Specified by:
unregisterSubject in class AbstractSubjectIdentityCache

registerObject

protected void registerObject(TMObjectIF o)
INTERNAL: Register the object with the identity map.

Overrides:
registerObject in class AbstractSubjectIdentityCache

unregisterObject

protected void unregisterObject(TMObjectIF o)
INTERNAL: Unregister the object with the identity map.

Overrides:
unregisterObject in class AbstractSubjectIdentityCache


Copyright © 2000-2012 Ontopia.