Package net.ontopia.topicmaps.entry
Class AbstractURLTopicMapReference
- java.lang.Object
-
- net.ontopia.topicmaps.entry.AbstractTopicMapReference
-
- net.ontopia.topicmaps.entry.AbstractURLTopicMapReference
-
- All Implemented Interfaces:
AutoCloseable
,TopicMapReferenceIF
- Direct Known Subclasses:
AbstractOntopolyURLReference
public abstract class AbstractURLTopicMapReference extends AbstractTopicMapReference
INTERNAL: An abstract topic map reference class that retrieves topic maps referenced through URLs. Subclasses should implement the loadTopicMap method.- Since:
- 1.3.2
-
-
Field Summary
Fields Modifier and Type Field Description protected LocatorIF
base_address
protected boolean
duplicate_suppression
protected String
indexDirectory
protected boolean
maintainFulltextIndexes
protected boolean
reuse_store
protected TopicMapStoreIF
store
protected URL
url
-
Fields inherited from class net.ontopia.topicmaps.entry.AbstractTopicMapReference
deleted, id, isopen, listeners, source, title, topic_listeners
-
-
Constructor Summary
Constructors Constructor Description AbstractURLTopicMapReference(String id, String title, URL url, LocatorIF base_address)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
close()
PUBLIC: Closes all open stores and the reference itself.TopicMapStoreIF
createStore(boolean readonly)
PUBLIC: Creates a topic map store that lets you access the referenced topic map.void
delete()
INTERNAL: Deletes the topic map pointed to.LocatorIF
getBaseAddress()
INTERNAL: Returns the base address locator to be used when loading the topic map.boolean
getDuplicateSuppression()
INTERNAL: Gets the duplicate suppression flag.String
getIndexDirectory()
boolean
getMaintainFulltextIndexes()
INTERNAL: Returns true if stores will keep underlying fulltext indexes up-to-date.boolean
getReuseStore()
INTERNAL: Flag that indicates whether the same store should be returned by the createStore(boolean) method on every.URL
getURL()
INTERNAL: Returns the URL of the topic map pointed at.protected abstract TopicMapIF
loadTopicMap(boolean readonly)
void
open()
PUBLIC: Opens the reference.void
setBaseAddress(LocatorIF base_address)
INTERNAL: Sets the base address locator to be used when loading the topic map.void
setDuplicateSuppression(boolean duplicate_suppression)
INTERNAL: Sets the duplicate suppression flag.void
setIndexDirectory(String indexDirectory)
void
setMaintainFulltextIndexes(boolean maintainFulltextIndexes)
INTERNAL: Specifies whether underlying fulltext indexes are to be kept up-to-date or not.void
setReuseStore(boolean reuse_store)
INTERNAL: Sets the reuse_store flag.protected void
setTopicListeners(TopicMapListenerIF[] topic_listeners)
String
toString()
-
Methods inherited from class net.ontopia.topicmaps.entry.AbstractTopicMapReference
addTopicListener, clear, getId, getSource, getTitle, getTopicListeners, isDeleted, isOpen, makeListenerArray, registerTopicListeners, removeTopicListener, setId, setSource, setTitle, storeClosed
-
-
-
-
Field Detail
-
url
protected URL url
-
base_address
protected LocatorIF base_address
-
duplicate_suppression
protected boolean duplicate_suppression
-
reuse_store
protected boolean reuse_store
-
store
protected TopicMapStoreIF store
-
maintainFulltextIndexes
protected boolean maintainFulltextIndexes
-
indexDirectory
protected String indexDirectory
-
-
Method Detail
-
getURL
public URL getURL()
INTERNAL: Returns the URL of the topic map pointed at.
-
getBaseAddress
public LocatorIF getBaseAddress()
INTERNAL: Returns the base address locator to be used when loading the topic map.
-
setBaseAddress
public void setBaseAddress(LocatorIF base_address)
INTERNAL: Sets the base address locator to be used when loading the topic map.
-
getDuplicateSuppression
public boolean getDuplicateSuppression()
INTERNAL: Gets the duplicate suppression flag. If the flag is true duplicate suppression is to be performed when loading the topic maps.- Since:
- 1.4.2
-
setDuplicateSuppression
public void setDuplicateSuppression(boolean duplicate_suppression)
INTERNAL: Sets the duplicate suppression flag. If the flag is true duplicate suppression is to be performed when loading the topic maps.- Since:
- 1.4.2
-
getReuseStore
public boolean getReuseStore()
INTERNAL: Flag that indicates whether the same store should be returned by the createStore(boolean) method on every. If the flag is false then a new store will be returned every time. Returning a new store every time effectively means that the referenced topic map will be loaded on every method call.- Since:
- 2.1
-
setReuseStore
public void setReuseStore(boolean reuse_store)
INTERNAL: Sets the reuse_store flag.- Since:
- 2.1
-
open
public void open()
Description copied from interface:TopicMapReferenceIF
PUBLIC: Opens the reference.- Specified by:
open
in interfaceTopicMapReferenceIF
- Overrides:
open
in classAbstractTopicMapReference
-
close
public void close()
Description copied from interface:TopicMapReferenceIF
PUBLIC: Closes all open stores and the reference itself. Note that topic map stores created through this reference are closed and dereferenced when the reference is closed. The reference can be reopened after it has been closed.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceTopicMapReferenceIF
- Overrides:
close
in classAbstractTopicMapReference
-
delete
public void delete()
INTERNAL: Deletes the topic map pointed to. The reference is closed before the topic map is deleted. Note that only URIs pointing to through files can actually be deleted, i.e. "file:" URLs.- Specified by:
delete
in interfaceTopicMapReferenceIF
- Overrides:
delete
in classAbstractTopicMapReference
- Since:
- 1.3.2
-
createStore
public TopicMapStoreIF createStore(boolean readonly) throws IOException
Description copied from interface:TopicMapReferenceIF
PUBLIC: Creates a topic map store that lets you access the referenced topic map.- Specified by:
createStore
in interfaceTopicMapReferenceIF
- Specified by:
createStore
in classAbstractTopicMapReference
- Throws:
IOException
-
loadTopicMap
protected abstract TopicMapIF loadTopicMap(boolean readonly) throws IOException
- Throws:
IOException
-
getMaintainFulltextIndexes
public boolean getMaintainFulltextIndexes()
INTERNAL: Returns true if stores will keep underlying fulltext indexes up-to-date.- Returns:
- True if fulltext indexes are maintained.
- Since:
- 3.0
-
setMaintainFulltextIndexes
public void setMaintainFulltextIndexes(boolean maintainFulltextIndexes)
INTERNAL: Specifies whether underlying fulltext indexes are to be kept up-to-date or not.- Parameters:
maintainFulltextIndexes
- True if fulltext indexes are maintained.- Since:
- 3.0
-
getIndexDirectory
public String getIndexDirectory()
-
setIndexDirectory
public void setIndexDirectory(String indexDirectory)
-
setTopicListeners
protected void setTopicListeners(TopicMapListenerIF[] topic_listeners)
- Overrides:
setTopicListeners
in classAbstractTopicMapReference
-
-