Package net.ontopia.topicmaps.entry
Class AbstractTopicMapReference
- java.lang.Object
-
- net.ontopia.topicmaps.entry.AbstractTopicMapReference
-
- All Implemented Interfaces:
AutoCloseable,TopicMapReferenceIF
- Direct Known Subclasses:
AbstractURLTopicMapReference,MergeReference,RDBMSTopicMapReference,StoreFactoryReference
public abstract class AbstractTopicMapReference extends Object implements TopicMapReferenceIF
INTERNAL: An abstract topic map reference class that contains methods that handles the id and title properties. Subclasses should implement the createStore method.
-
-
Field Summary
Fields Modifier and Type Field Description protected booleandeletedprotected Stringidprotected booleanisopenprotected List<TopicMapListenerIF>listenersprotected TopicMapSourceIFsourceprotected Stringtitleprotected TopicMapListenerIF[]topic_listeners
-
Constructor Summary
Constructors Constructor Description AbstractTopicMapReference(String id, String title)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddTopicListener(TopicMapListenerIF listener)INTERNAL: Add topic listener to reference.voidclear()EXPERIMENTAL: Closes all open stores and clears the topic map by removing all data.voidclose()PUBLIC: Closes all open stores and the reference itself.abstract TopicMapStoreIFcreateStore(boolean readonly)PUBLIC: Creates a topic map store that lets you access the referenced topic map.voiddelete()PUBLIC: Closes all open stores and deletes the topic map.StringgetId()PUBLIC: Gets the id of the reference.TopicMapSourceIFgetSource()PUBLIC: Gets the source to which the reference belongs.StringgetTitle()PUBLIC: Gets the title of the reference.protected TopicMapListenerIF[]getTopicListeners()booleanisDeleted()PUBLIC: Returns true if the topic map has been deleted.booleanisOpen()PUBLIC: Returns true if the reference is open.protected voidmakeListenerArray()voidopen()PUBLIC: Opens the reference.voidregisterTopicListeners(String listenerList)INTERNAL: Register topic listener from list of listener implementations.voidremoveTopicListener(TopicMapListenerIF listener)INTERNAL: Remove topic listener from reference.voidsetId(String id)INTERNAL: Sets the id of the reference.voidsetSource(TopicMapSourceIF source)PUBLIC: Sets the source to which the reference belongs.voidsetTitle(String title)PUBLIC: Sets the title of the reference.protected voidsetTopicListeners(TopicMapListenerIF[] topic_listeners)voidstoreClosed(TopicMapStoreIF store)INTERNAL: Callback from the specified TopicMapStoreIF after it has been closed.
-
-
-
Field Detail
-
id
protected String id
-
title
protected String title
-
isopen
protected boolean isopen
-
deleted
protected boolean deleted
-
source
protected TopicMapSourceIF source
-
listeners
protected List<TopicMapListenerIF> listeners
-
topic_listeners
protected TopicMapListenerIF[] topic_listeners
-
-
Method Detail
-
getId
public String getId()
Description copied from interface:TopicMapReferenceIFPUBLIC: Gets the id of the reference.- Specified by:
getIdin interfaceTopicMapReferenceIF
-
setId
public void setId(String id)
Description copied from interface:TopicMapReferenceIFINTERNAL: Sets the id of the reference. Warning: Intended for internal use only. The reference should throw anUnsupportedOperationExceptionif it does not support setting the id.- Specified by:
setIdin interfaceTopicMapReferenceIF
-
getTitle
public String getTitle()
Description copied from interface:TopicMapReferenceIFPUBLIC: Gets the title of the reference.- Specified by:
getTitlein interfaceTopicMapReferenceIF
-
setTitle
public void setTitle(String title)
Description copied from interface:TopicMapReferenceIFPUBLIC: Sets the title of the reference.- Specified by:
setTitlein interfaceTopicMapReferenceIF
-
getSource
public TopicMapSourceIF getSource()
Description copied from interface:TopicMapReferenceIFPUBLIC: Gets the source to which the reference belongs.- Specified by:
getSourcein interfaceTopicMapReferenceIF
-
setSource
public void setSource(TopicMapSourceIF source)
Description copied from interface:TopicMapReferenceIFPUBLIC: Sets the source to which the reference belongs. The reference should throw anUnsupportedOperationExceptionif it does not support setting the source.- Specified by:
setSourcein interfaceTopicMapReferenceIF
-
isOpen
public boolean isOpen()
Description copied from interface:TopicMapReferenceIFPUBLIC: Returns true if the reference is open.- Specified by:
isOpenin interfaceTopicMapReferenceIF
-
open
public void open()
Description copied from interface:TopicMapReferenceIFPUBLIC: Opens the reference.- Specified by:
openin interfaceTopicMapReferenceIF
-
close
public void close()
Description copied from interface:TopicMapReferenceIFPUBLIC: 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:
closein interfaceAutoCloseable- Specified by:
closein interfaceTopicMapReferenceIF
-
isDeleted
public boolean isDeleted()
Description copied from interface:TopicMapReferenceIFPUBLIC: Returns true if the topic map has been deleted.- Specified by:
isDeletedin interfaceTopicMapReferenceIF
-
delete
public void delete()
Description copied from interface:TopicMapReferenceIFPUBLIC: Closes all open stores and deletes the topic map. The reference is closed before the topic map is deleted. The reference cannot be reopened after the topic map has been deleted.- Specified by:
deletein interfaceTopicMapReferenceIF
-
clear
public void clear() throws IOExceptionDescription copied from interface:TopicMapReferenceIFEXPERIMENTAL: Closes all open stores and clears the topic map by removing all data. The reference is closed before the topic map is deleted. The reference can be reopened after the topic map has been deleted.- Specified by:
clearin interfaceTopicMapReferenceIF- Throws:
IOException
-
createStore
public abstract TopicMapStoreIF createStore(boolean readonly) throws IOException
Description copied from interface:TopicMapReferenceIFPUBLIC: Creates a topic map store that lets you access the referenced topic map.- Specified by:
createStorein interfaceTopicMapReferenceIF- Throws:
IOException
-
storeClosed
public void storeClosed(TopicMapStoreIF store)
Description copied from interface:TopicMapReferenceIFINTERNAL: Callback from the specified TopicMapStoreIF after it has been closed. Warning: Intended for internal use only.- Specified by:
storeClosedin interfaceTopicMapReferenceIF
-
getTopicListeners
protected TopicMapListenerIF[] getTopicListeners()
-
setTopicListeners
protected void setTopicListeners(TopicMapListenerIF[] topic_listeners)
-
addTopicListener
public void addTopicListener(TopicMapListenerIF listener)
INTERNAL: Add topic listener to reference.
-
removeTopicListener
public void removeTopicListener(TopicMapListenerIF listener)
INTERNAL: Remove topic listener from reference.
-
registerTopicListeners
public void registerTopicListeners(String listenerList)
INTERNAL: Register topic listener from list of listener implementations.
-
makeListenerArray
protected void makeListenerArray()
-
-