Package net.ontopia.topicmaps.impl.rdbms
Class RDBMSPatternSingleTopicMapSource
- java.lang.Object
-
- net.ontopia.topicmaps.impl.rdbms.RDBMSPatternSingleTopicMapSource
-
- All Implemented Interfaces:
AutoCloseable
,TopicMapSourceIF
public class RDBMSPatternSingleTopicMapSource extends Object implements TopicMapSourceIF
PUBLIC: A topic map source that refers to single reference that is located by pattern. If multiple topic maps match the pattern then the topic map with the highest object id is chosen. This source is therefore able to swap to later versions of the same topic map when the topic map repository is refreshed.- Since:
- 3.4.2
-
-
Field Summary
Fields Modifier and Type Field Description protected LocatorIF
base_address
protected String
id
protected String
match
protected String
pattern
protected String
propfile
protected RDBMSTopicMapReference
reference
protected String
referenceId
protected RDBMSStorage
storage
protected String
title
-
Constructor Summary
Constructors Constructor Description RDBMSPatternSingleTopicMapSource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
PUBLIC: Closes the source by releasing references it holds to e.g.protected RDBMSStorage
createStorage()
TopicMapReferenceIF
createTopicMap(String name, String baseAddress)
PUBLIC: Creates a new topic map in the underlying source and returns a reference to the created topic map.String
getBaseAddress()
PUBLIC: Gets the base address of the topic maps retrieved from the source.String
getId()
PUBLIC: Gets the id of the source.String
getMatch()
PUBLIC: Returns the match type used by the source.String
getPattern()
PUBLIC: Returns the pattern value used by the source.String
getPropertyFile()
PUBLIC: Gets the database property file containing configuration parameters for accessing the rdbms database.String
getReferenceId()
PUBLIC: Gets the id of the topic map reference for this topic map source.Collection
getReferences()
PUBLIC: Returns an unmodifiable collection ofTopicMapReferenceIF
s found by the topic map source.String
getTitle()
PUBLIC: Gets the title of the source.void
refresh()
PUBLIC: Refreshes the collection of references.void
setBaseAddress(String base_address)
PUBLIC: Sets the base address of the topic maps retrieved from the source.void
setId(String id)
PUBLIC: Sets the id of the source.void
setMatch(String match)
PUBLIC: Sets the match type used by the source.void
setPattern(String pattern)
PUBLIC: Sets the pattern value used by the source.void
setPropertyFile(String propfile)
PUBLIC: Sets the database property file containing configuration parameters for accessing the rdbms database.void
setReferenceId(String referenceId)
PUBLIC: Sets the id of the topic map reference for this topic map source.void
setTitle(String title)
PUBLIC: Sets the title of the source.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.
-
-
-
Field Detail
-
id
protected String id
-
referenceId
protected String referenceId
-
title
protected String title
-
base_address
protected LocatorIF base_address
-
propfile
protected String propfile
-
match
protected String match
-
pattern
protected String pattern
-
reference
protected RDBMSTopicMapReference reference
-
storage
protected RDBMSStorage storage
-
-
Method Detail
-
createTopicMap
public TopicMapReferenceIF createTopicMap(String name, 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 interfaceTopicMapSourceIF
-
getReferences
public Collection getReferences()
Description copied from interface:TopicMapSourceIF
PUBLIC: Returns an unmodifiable collection ofTopicMapReferenceIF
s found by the topic map source.- Specified by:
getReferences
in interfaceTopicMapSourceIF
-
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 interfaceTopicMapSourceIF
-
close
public void close()
Description copied from interface:TopicMapSourceIF
PUBLIC: Closes the source by releasing references it holds to e.g. database or file system objects.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceTopicMapSourceIF
-
getId
public String getId()
Description copied from interface:TopicMapSourceIF
PUBLIC: Gets the id of the source.- Specified by:
getId
in interfaceTopicMapSourceIF
-
setId
public void setId(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 anUnsupportedOperationException
if it does not support setting the id.- Specified by:
setId
in interfaceTopicMapSourceIF
-
getTitle
public String getTitle()
Description copied from interface:TopicMapSourceIF
PUBLIC: Gets the title of the source.- Specified by:
getTitle
in interfaceTopicMapSourceIF
-
setTitle
public void setTitle(String title)
Description copied from interface:TopicMapSourceIF
PUBLIC: Sets the title of the source.- Specified by:
setTitle
in interfaceTopicMapSourceIF
-
getMatch
public String getMatch()
PUBLIC: Returns the match type used by the source.
-
setMatch
public void setMatch(String match)
PUBLIC: Sets the match type used by the source. This can either be 'title' or 'comments'. The default is 'title'.
-
getPattern
public String getPattern()
PUBLIC: Returns the pattern value used by the source.
-
setPattern
public void setPattern(String pattern)
PUBLIC: Sets the pattern value used by the source. This is typically the title of the topic map, but can also be the comments attached to a topic map. Which of the two the pattern matches depends on the match type given.
-
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 interfaceTopicMapSourceIF
-
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 interfaceTopicMapSourceIF
-
createStorage
protected RDBMSStorage createStorage() throws IOException
- Throws:
IOException
-
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:'.
-
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'.
-
-