net.ontopia.topicmaps.impl.rdbms
Class RDBMSTopicMapSource

java.lang.Object
  extended by net.ontopia.topicmaps.impl.rdbms.RDBMSTopicMapSource
All Implemented Interfaces:
TopicMapSourceIF

public class RDBMSTopicMapSource
extends java.lang.Object
implements TopicMapSourceIF

PUBLIC: A topic map source that holds the list of all topic map references accessible by a rdbms session.


Field Summary
protected  LocatorIF base_address
           
protected  boolean hidden
           
protected  java.lang.String id
           
protected  java.util.Map properties
           
protected  java.lang.String propfile
           
protected  java.util.Map refmap
           
protected  RDBMSStorage storage
           
protected  boolean supportsCreate
           
protected  boolean supportsDelete
           
protected  java.lang.String title
           
protected  java.lang.String topicListeners
           
 
Constructor Summary
RDBMSTopicMapSource()
          PUBLIC: Creates an rdbms topic map source.
RDBMSTopicMapSource(java.util.Map properties)
          INTERNAL: Creates an rdbms topic map source with the specified database properties.
RDBMSTopicMapSource(java.lang.String propfile)
          INTERNAL: Creates an rdbms topic map source with the database property file set.
 
Method Summary
protected  RDBMSStorage createStorage()
           
 TopicMapReferenceIF createTopicMap(java.lang.String name, java.lang.String baseAddress)
          PUBLIC: Creates a new topic map in the underlying source and returns a reference to the created topic map.
 java.lang.String getBaseAddress()
          PUBLIC: Gets the base address of the topic maps retrieved from the source.
 boolean getHidden()
           
 java.lang.String getId()
          PUBLIC: Gets the id of the source.
 java.lang.String getPropertyFile()
          PUBLIC: Gets the database property file containing configuration parameters for accessing the rdbms database.
protected  java.lang.String getReferenceId(long topicmap_id)
           
 java.util.Collection getReferences()
          PUBLIC: Returns an unmodifiable collection of TopicMapReferenceIFs found by the topic map source.
 boolean getSupportsCreate()
           
 boolean getSupportsDelete()
           
 java.lang.String getTitle()
          PUBLIC: Gets the title of the source.
 java.lang.String getTopicListeners()
           
 void refresh()
          PUBLIC: Refreshes the collection of references.
 void setBaseAddress(java.lang.String base_address)
          PUBLIC: Sets the base address of the topic maps retrieved from the source.
 void setHidden(boolean hidden)
           
 void setId(java.lang.String id)
          PUBLIC: Sets the id of the source.
 void setPropertyFile(java.lang.String propfile)
          PUBLIC: Sets the database property file containing configuration parameters for accessing the rdbms database.
 void setSupportsCreate(boolean supportsCreate)
           
 void setSupportsDelete(boolean supportsDelete)
           
 void setTitle(java.lang.String title)
          PUBLIC: Sets the title of the source.
 void setTopicListeners(java.lang.String topicListeners)
           
 boolean supportsCreate()
          PUBLIC: Returns true if the source supports creating new topic maps with the createTopicMap.
 boolean supportsDelete()
          PUBLIC: Returns true if the source supports deleting topic map with the TopicMapReferenceIF.delete() method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

supportsCreate

protected boolean supportsCreate

supportsDelete

protected boolean supportsDelete

base_address

protected LocatorIF base_address

hidden

protected boolean hidden

id

protected java.lang.String id

title

protected java.lang.String title

properties

protected java.util.Map properties

propfile

protected java.lang.String propfile

topicListeners

protected java.lang.String topicListeners

refmap

protected java.util.Map refmap

storage

protected RDBMSStorage storage
Constructor Detail

RDBMSTopicMapSource

public RDBMSTopicMapSource()
PUBLIC: Creates an rdbms topic map source. Use the setter methods to provide the instance with the properties it needs.

If the property file has not been given the 'net.ontopia.topicmaps.impl.rdbms.PropertyFile' system properties will be used.


RDBMSTopicMapSource

public RDBMSTopicMapSource(java.lang.String propfile)
INTERNAL: Creates an rdbms topic map source with the database property file set.


RDBMSTopicMapSource

public RDBMSTopicMapSource(java.util.Map properties)
INTERNAL: Creates an rdbms topic map source with the specified database properties.

Since:
1.2.4
Method Detail

getId

public java.lang.String getId()
Description copied from interface: TopicMapSourceIF
PUBLIC: Gets the id of the source.

Specified by:
getId in interface TopicMapSourceIF

setId

public void setId(java.lang.String id)
Description copied from interface: TopicMapSourceIF
PUBLIC: Sets the id of the source. Note that this method is intended for use when the source is used in a TopicMapRepositoryIF. The source should throw an UnsupportedOperationException if it does not support setting the id.

Specified by:
setId in interface TopicMapSourceIF

getTitle

public java.lang.String getTitle()
Description copied from interface: TopicMapSourceIF
PUBLIC: Gets the title of the source.

Specified by:
getTitle in interface TopicMapSourceIF

setTitle

public void setTitle(java.lang.String title)
Description copied from interface: TopicMapSourceIF
PUBLIC: Sets the title of the source.

Specified by:
setTitle in interface TopicMapSourceIF

getBaseAddress

public java.lang.String getBaseAddress()
PUBLIC: Gets the base address of the topic maps retrieved from the source. The notation is assumed to be 'URI'.


setBaseAddress

public void setBaseAddress(java.lang.String base_address)
PUBLIC: Sets the base address of the topic maps retrieved from the source. The notation is assumed to be 'URI'.


getPropertyFile

public java.lang.String getPropertyFile()
PUBLIC: Gets the database property file containing configuration parameters for accessing the rdbms database.


setPropertyFile

public void setPropertyFile(java.lang.String propfile)
PUBLIC: Sets the database property file containing configuration parameters for accessing the rdbms database. The propfile given with first be attempted loaded from the file system. If it does not exist on the file system it will be loaded from the classpath. If the access must be explicit then the property file name can be prefixed by 'file:' or 'classpath:'.


getReferences

public java.util.Collection getReferences()
Description copied from interface: TopicMapSourceIF
PUBLIC: Returns an unmodifiable collection of TopicMapReferenceIFs found by the topic map source.

Specified by:
getReferences in interface TopicMapSourceIF

createStorage

protected RDBMSStorage createStorage()
                              throws java.io.IOException
Throws:
java.io.IOException

refresh

public void refresh()
Description copied from interface: TopicMapSourceIF
PUBLIC: Refreshes the collection of references. This lets the source look at its underlying data source to reflect any changes made since the last refresh.

Specified by:
refresh in interface TopicMapSourceIF

getReferenceId

protected java.lang.String getReferenceId(long topicmap_id)

supportsCreate

public boolean supportsCreate()
Description copied from interface: TopicMapSourceIF
PUBLIC: Returns true if the source supports creating new topic maps with the createTopicMap.

Specified by:
supportsCreate in interface TopicMapSourceIF

getSupportsCreate

public boolean getSupportsCreate()

setSupportsCreate

public void setSupportsCreate(boolean supportsCreate)

supportsDelete

public boolean supportsDelete()
Description copied from interface: TopicMapSourceIF
PUBLIC: Returns true if the source supports deleting topic map with the TopicMapReferenceIF.delete() method.

Specified by:
supportsDelete in interface TopicMapSourceIF

getSupportsDelete

public boolean getSupportsDelete()

setSupportsDelete

public void setSupportsDelete(boolean supportsDelete)

createTopicMap

public TopicMapReferenceIF createTopicMap(java.lang.String name,
                                          java.lang.String baseAddress)
Description copied from interface: TopicMapSourceIF
PUBLIC: Creates a new topic map in the underlying source and returns a reference to the created topic map. The method takes a name and the base address for the topic map to create.

Specified by:
createTopicMap in interface TopicMapSourceIF

getHidden

public boolean getHidden()

setHidden

public void setHidden(boolean hidden)

getTopicListeners

public java.lang.String getTopicListeners()

setTopicListeners

public void setTopicListeners(java.lang.String topicListeners)


Copyright © 2000-2012 Ontopia.