de.topicmapslab.majortom.core
Class TopicMapSystemImpl

java.lang.Object
  extended by de.topicmapslab.majortom.core.TopicMapSystemImpl
All Implemented Interfaces:
de.topicmapslab.majortom.model.core.ITopicMapSystem, org.tmapi.core.TopicMapSystem
Direct Known Subclasses:
JdbcTopicMapSystem, RedisTopicMapSystem

public class TopicMapSystemImpl
extends java.lang.Object
implements de.topicmapslab.majortom.model.core.ITopicMapSystem

Base implementation of TopicMapSystem

Author:
Sven Krosse

Field Summary
private  TopicMapSystemFactoryImpl factory
          the parent factory
private  java.util.Map<java.lang.String,java.lang.Object> features
          the topic map factory features
private  java.util.Map<java.lang.String,org.tmapi.core.Locator> locators
          a map of all locators created by the topic map system
private  java.util.Properties properties
          the topic map system properties
private  java.util.Map<org.tmapi.core.Locator,de.topicmapslab.majortom.model.core.ITopicMap> topicMaps
          a map of all contained topic maps
 
Constructor Summary
TopicMapSystemImpl()
          constructor for JAVA services
TopicMapSystemImpl(TopicMapSystemFactoryImpl factory)
          constructor
 
Method Summary
protected  void addTopicMap(org.tmapi.core.Locator locator, de.topicmapslab.majortom.model.core.ITopicMap topicMap)
          Internal method to add a topic map to internal storage
 void close()
          
protected  boolean containsTopicMap(org.tmapi.core.Locator locator)
          Internal method to check if the locator is bound to a topic map instance
 org.tmapi.core.Locator createLocator(java.lang.String arg0)
          
 org.tmapi.core.TopicMap createTopicMap(org.tmapi.core.Locator locator)
          
 org.tmapi.core.TopicMap createTopicMap(org.tmapi.core.Locator locator, de.topicmapslab.majortom.model.store.ITopicMapStore store)
          
 org.tmapi.core.TopicMap createTopicMap(java.lang.String arg0)
          
 org.tmapi.core.TopicMap createTopicMap(java.lang.String ref, de.topicmapslab.majortom.model.store.ITopicMapStore store)
          
protected  TopicMapSystemFactoryImpl getFactory()
          Returns the topic map factory instance
 boolean getFeature(java.lang.String arg0)
          
 java.lang.Class<? extends de.topicmapslab.majortom.model.store.ITopicMapStore> getHandledClass()
          
 java.util.Set<org.tmapi.core.Locator> getLocators()
          
 java.lang.Object getProperty(java.lang.String arg0)
          
 org.tmapi.core.TopicMap getTopicMap(org.tmapi.core.Locator arg0)
          
 org.tmapi.core.TopicMap getTopicMap(java.lang.String arg0)
          
 de.topicmapslab.majortom.model.core.ITopicMap removeTopicMap(org.tmapi.core.Locator locator)
          
 void setFactory(org.tmapi.core.TopicMapSystemFactory factory)
          
 void setFactory(TopicMapSystemFactoryImpl factory)
          Internal method to set the factory instance
 void setFeature(java.lang.String key, boolean value)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

topicMaps

private java.util.Map<org.tmapi.core.Locator,de.topicmapslab.majortom.model.core.ITopicMap> topicMaps
a map of all contained topic maps


locators

private final java.util.Map<java.lang.String,org.tmapi.core.Locator> locators
a map of all locators created by the topic map system


properties

private java.util.Properties properties
the topic map system properties


features

private java.util.Map<java.lang.String,java.lang.Object> features
the topic map factory features


factory

private TopicMapSystemFactoryImpl factory
the parent factory

Constructor Detail

TopicMapSystemImpl

public TopicMapSystemImpl()
constructor for JAVA services


TopicMapSystemImpl

public TopicMapSystemImpl(TopicMapSystemFactoryImpl factory)
constructor

Parameters:
factory - the factory
Method Detail

close

public void close()

Specified by:
close in interface org.tmapi.core.TopicMapSystem

createLocator

public org.tmapi.core.Locator createLocator(java.lang.String arg0)
                                     throws org.tmapi.core.MalformedIRIException

Specified by:
createLocator in interface org.tmapi.core.TopicMapSystem
Throws:
org.tmapi.core.MalformedIRIException

createTopicMap

public org.tmapi.core.TopicMap createTopicMap(org.tmapi.core.Locator locator)
                                       throws org.tmapi.core.TopicMapExistsException

Specified by:
createTopicMap in interface org.tmapi.core.TopicMapSystem
Throws:
org.tmapi.core.TopicMapExistsException

createTopicMap

public org.tmapi.core.TopicMap createTopicMap(java.lang.String arg0)
                                       throws org.tmapi.core.TopicMapExistsException

Specified by:
createTopicMap in interface org.tmapi.core.TopicMapSystem
Throws:
org.tmapi.core.TopicMapExistsException

createTopicMap

public org.tmapi.core.TopicMap createTopicMap(org.tmapi.core.Locator locator,
                                              de.topicmapslab.majortom.model.store.ITopicMapStore store)
                                       throws org.tmapi.core.TopicMapExistsException

Specified by:
createTopicMap in interface de.topicmapslab.majortom.model.core.ITopicMapSystem
Throws:
org.tmapi.core.TopicMapExistsException

createTopicMap

public org.tmapi.core.TopicMap createTopicMap(java.lang.String ref,
                                              de.topicmapslab.majortom.model.store.ITopicMapStore store)
                                       throws org.tmapi.core.TopicMapExistsException

Specified by:
createTopicMap in interface de.topicmapslab.majortom.model.core.ITopicMapSystem
Throws:
org.tmapi.core.TopicMapExistsException

getFeature

public boolean getFeature(java.lang.String arg0)
                   throws org.tmapi.core.FeatureNotRecognizedException

Specified by:
getFeature in interface org.tmapi.core.TopicMapSystem
Throws:
org.tmapi.core.FeatureNotRecognizedException

getLocators

public java.util.Set<org.tmapi.core.Locator> getLocators()

Specified by:
getLocators in interface org.tmapi.core.TopicMapSystem

getProperty

public java.lang.Object getProperty(java.lang.String arg0)

Specified by:
getProperty in interface org.tmapi.core.TopicMapSystem

getTopicMap

public org.tmapi.core.TopicMap getTopicMap(java.lang.String arg0)

Specified by:
getTopicMap in interface org.tmapi.core.TopicMapSystem

getTopicMap

public org.tmapi.core.TopicMap getTopicMap(org.tmapi.core.Locator arg0)

Specified by:
getTopicMap in interface org.tmapi.core.TopicMapSystem

removeTopicMap

public de.topicmapslab.majortom.model.core.ITopicMap removeTopicMap(org.tmapi.core.Locator locator)


setFeature

public void setFeature(java.lang.String key,
                       boolean value)
                throws org.tmapi.core.FeatureNotSupportedException,
                       org.tmapi.core.FeatureNotRecognizedException

Specified by:
setFeature in interface de.topicmapslab.majortom.model.core.ITopicMapSystem
Throws:
org.tmapi.core.FeatureNotSupportedException
org.tmapi.core.FeatureNotRecognizedException

addTopicMap

protected final void addTopicMap(org.tmapi.core.Locator locator,
                                 de.topicmapslab.majortom.model.core.ITopicMap topicMap)
                          throws org.tmapi.core.TopicMapExistsException
Internal method to add a topic map to internal storage

Parameters:
locator - the base locator
topicMap - the topic map
Throws:
org.tmapi.core.TopicMapExistsException

containsTopicMap

protected final boolean containsTopicMap(org.tmapi.core.Locator locator)
Internal method to check if the locator is bound to a topic map instance

Parameters:
locator - the locator
Returns:
true if the locator is known as base locator for a topic map instance, false otherwise.

getFactory

protected TopicMapSystemFactoryImpl getFactory()
Returns the topic map factory instance


setFactory

public void setFactory(org.tmapi.core.TopicMapSystemFactory factory)

Specified by:
setFactory in interface de.topicmapslab.majortom.model.core.ITopicMapSystem

setFactory

public void setFactory(TopicMapSystemFactoryImpl factory)
Internal method to set the factory instance

Parameters:
factory - the factory to set

getHandledClass

public java.lang.Class<? extends de.topicmapslab.majortom.model.store.ITopicMapStore> getHandledClass()

Specified by:
getHandledClass in interface de.topicmapslab.majortom.model.core.ITopicMapSystem