Package net.ontopia.topicmaps.impl.rdbms
Class RDBMSSingleTopicMapSource
- java.lang.Object
-
- net.ontopia.topicmaps.impl.rdbms.RDBMSSingleTopicMapSource
-
- All Implemented Interfaces:
AutoCloseable,TopicMapSourceIF
public class RDBMSSingleTopicMapSource extends Object implements TopicMapSourceIF
PUBLIC: A topic map source that holds a reference to a single rdbms topic map. Individual topic maps can thus be pointed to by this source implementation.- Since:
- 1.3.4
-
-
Field Summary
Fields Modifier and Type Field Description protected LocatorIFbase_addressprotected booleanhiddenprotected Stringidprotected Stringpropfileprotected RDBMSTopicMapReferencereferenceprotected StringreferenceIdprotected RDBMSStoragestorageprotected Stringtitleprotected StringtopicListenersprotected longtopicmap_id
-
Constructor Summary
Constructors Constructor Description RDBMSSingleTopicMapSource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()PUBLIC: Closes the source by releasing references it holds to e.g.protected RDBMSStoragecreateStorage()TopicMapReferenceIFcreateTopicMap(String name, String baseAddress)PUBLIC: Creates a new topic map in the underlying source and returns a reference to the created topic map.StringgetBaseAddress()PUBLIC: Gets the base address of the topic maps retrieved from the source.booleangetHidden()StringgetId()PUBLIC: Gets the id of the source.StringgetPropertyFile()PUBLIC: Gets the database property file containing configuration parameters for accessing the rdbms database.StringgetReferenceId()PUBLIC: Gets the id of the topic map reference for this topic map source.protected StringgetReferenceId(long topicmap_id)CollectiongetReferences()PUBLIC: Returns an unmodifiable collection ofTopicMapReferenceIFs found by the topic map source.StringgetTitle()PUBLIC: Gets the title of the source.StringgetTopicListeners()StringgetTopicMapId()PUBLIC: Gets the id of the topic map referenced.voidrefresh()PUBLIC: Refreshes the collection of references.voidsetBaseAddress(String base_address)PUBLIC: Sets the base address of the topic maps retrieved from the source.voidsetHidden(boolean hidden)voidsetId(String id)PUBLIC: Sets the id of the source.voidsetPropertyFile(String propfile)PUBLIC: Sets the database property file containing configuration parameters for accessing the rdbms database.voidsetReferenceId(String referenceId)PUBLIC: Sets the id of the topic map reference for this topic map source.voidsetTitle(String title)PUBLIC: Sets the title of the source.voidsetTopicListeners(String topicListeners)voidsetTopicMapId(long id)PUBLIC: Sets the id of the topic map referenced.voidsetTopicMapId(String id)PUBLIC: Sets the id of the topic map referenced.booleansupportsCreate()PUBLIC: Returns true if the source supports creating new topic maps with the createTopicMap.booleansupportsDelete()PUBLIC: Returns true if the source supports deleting topic map with the TopicMapReferenceIF.delete() method.
-
-
-
Field Detail
-
id
protected String id
-
referenceId
protected String referenceId
-
title
protected String title
-
propfile
protected String propfile
-
topicmap_id
protected long topicmap_id
-
base_address
protected LocatorIF base_address
-
hidden
protected boolean hidden
-
topicListeners
protected String topicListeners
-
reference
protected RDBMSTopicMapReference reference
-
storage
protected RDBMSStorage storage
-
-
Method Detail
-
createTopicMap
public TopicMapReferenceIF createTopicMap(String name, String baseAddress)
Description copied from interface:TopicMapSourceIFPUBLIC: 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:
createTopicMapin interfaceTopicMapSourceIF
-
getReferences
public Collection getReferences()
Description copied from interface:TopicMapSourceIFPUBLIC: Returns an unmodifiable collection ofTopicMapReferenceIFs found by the topic map source.- Specified by:
getReferencesin interfaceTopicMapSourceIF
-
refresh
public void refresh()
Description copied from interface:TopicMapSourceIFPUBLIC: 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:
refreshin interfaceTopicMapSourceIF
-
close
public void close()
Description copied from interface:TopicMapSourceIFPUBLIC: Closes the source by releasing references it holds to e.g. database or file system objects.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceTopicMapSourceIF
-
getId
public String getId()
Description copied from interface:TopicMapSourceIFPUBLIC: Gets the id of the source.- Specified by:
getIdin interfaceTopicMapSourceIF
-
setId
public void setId(String id)
Description copied from interface:TopicMapSourceIFPUBLIC: 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 anUnsupportedOperationExceptionif it does not support setting the id.- Specified by:
setIdin interfaceTopicMapSourceIF
-
getTitle
public String getTitle()
Description copied from interface:TopicMapSourceIFPUBLIC: Gets the title of the source.- Specified by:
getTitlein interfaceTopicMapSourceIF
-
setTitle
public void setTitle(String title)
Description copied from interface:TopicMapSourceIFPUBLIC: Sets the title of the source.- Specified by:
setTitlein interfaceTopicMapSourceIF
-
supportsCreate
public boolean supportsCreate()
Description copied from interface:TopicMapSourceIFPUBLIC: Returns true if the source supports creating new topic maps with the createTopicMap.- Specified by:
supportsCreatein interfaceTopicMapSourceIF
-
supportsDelete
public boolean supportsDelete()
Description copied from interface:TopicMapSourceIFPUBLIC: Returns true if the source supports deleting topic map with the TopicMapReferenceIF.delete() method.- Specified by:
supportsDeletein interfaceTopicMapSourceIF
-
createStorage
protected RDBMSStorage createStorage() throws IOException
- Throws:
IOException
-
getReferenceId
protected String getReferenceId(long topicmap_id)
-
getPropertyFile
public String getPropertyFile()
PUBLIC: Gets the database property file containing configuration parameters for accessing the rdbms database.
-
setPropertyFile
public void setPropertyFile(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:'.
-
getTopicMapId
public String getTopicMapId()
PUBLIC: Gets the id of the topic map referenced. Note that this id must be the string representation of a long.
-
setTopicMapId
public void setTopicMapId(String id)
PUBLIC: Sets the id of the topic map referenced. Note that this id must be the string representation of a long.
-
setTopicMapId
public void setTopicMapId(long id)
PUBLIC: Sets the id of the topic map referenced.
-
getReferenceId
public String getReferenceId()
PUBLIC: Gets the id of the topic map reference for this topic map source.
-
setReferenceId
public void setReferenceId(String referenceId)
PUBLIC: Sets the id of the topic map reference for this topic map source.
-
getBaseAddress
public 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(String base_address)
PUBLIC: Sets the base address of the topic maps retrieved from the source. The notation is assumed to be 'URI'.
-
getHidden
public boolean getHidden()
-
setHidden
public void setHidden(boolean hidden)
-
getTopicListeners
public String getTopicListeners()
-
setTopicListeners
public void setTopicListeners(String topicListeners)
-
-