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 boolean
deleted
protected String
id
protected boolean
isopen
protected List<TopicMapListenerIF>
listeners
protected TopicMapSourceIF
source
protected String
title
protected 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 void
addTopicListener(TopicMapListenerIF listener)
INTERNAL: Add topic listener to reference.void
clear()
EXPERIMENTAL: Closes all open stores and clears the topic map by removing all data.void
close()
PUBLIC: Closes all open stores and the reference itself.abstract TopicMapStoreIF
createStore(boolean readonly)
PUBLIC: Creates a topic map store that lets you access the referenced topic map.void
delete()
PUBLIC: Closes all open stores and deletes the topic map.String
getId()
PUBLIC: Gets the id of the reference.TopicMapSourceIF
getSource()
PUBLIC: Gets the source to which the reference belongs.String
getTitle()
PUBLIC: Gets the title of the reference.protected TopicMapListenerIF[]
getTopicListeners()
boolean
isDeleted()
PUBLIC: Returns true if the topic map has been deleted.boolean
isOpen()
PUBLIC: Returns true if the reference is open.protected void
makeListenerArray()
void
open()
PUBLIC: Opens the reference.void
registerTopicListeners(String listenerList)
INTERNAL: Register topic listener from list of listener implementations.void
removeTopicListener(TopicMapListenerIF listener)
INTERNAL: Remove topic listener from reference.void
setId(String id)
INTERNAL: Sets the id of the reference.void
setSource(TopicMapSourceIF source)
PUBLIC: Sets the source to which the reference belongs.void
setTitle(String title)
PUBLIC: Sets the title of the reference.protected void
setTopicListeners(TopicMapListenerIF[] topic_listeners)
void
storeClosed(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:TopicMapReferenceIF
PUBLIC: Gets the id of the reference.- Specified by:
getId
in interfaceTopicMapReferenceIF
-
setId
public void setId(String id)
Description copied from interface:TopicMapReferenceIF
INTERNAL: Sets the id of the reference. Warning: Intended for internal use only. The reference should throw anUnsupportedOperationException
if it does not support setting the id.- Specified by:
setId
in interfaceTopicMapReferenceIF
-
getTitle
public String getTitle()
Description copied from interface:TopicMapReferenceIF
PUBLIC: Gets the title of the reference.- Specified by:
getTitle
in interfaceTopicMapReferenceIF
-
setTitle
public void setTitle(String title)
Description copied from interface:TopicMapReferenceIF
PUBLIC: Sets the title of the reference.- Specified by:
setTitle
in interfaceTopicMapReferenceIF
-
getSource
public TopicMapSourceIF getSource()
Description copied from interface:TopicMapReferenceIF
PUBLIC: Gets the source to which the reference belongs.- Specified by:
getSource
in interfaceTopicMapReferenceIF
-
setSource
public void setSource(TopicMapSourceIF source)
Description copied from interface:TopicMapReferenceIF
PUBLIC: Sets the source to which the reference belongs. The reference should throw anUnsupportedOperationException
if it does not support setting the source.- Specified by:
setSource
in interfaceTopicMapReferenceIF
-
isOpen
public boolean isOpen()
Description copied from interface:TopicMapReferenceIF
PUBLIC: Returns true if the reference is open.- Specified by:
isOpen
in interfaceTopicMapReferenceIF
-
open
public void open()
Description copied from interface:TopicMapReferenceIF
PUBLIC: Opens the reference.- Specified by:
open
in interfaceTopicMapReferenceIF
-
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
-
isDeleted
public boolean isDeleted()
Description copied from interface:TopicMapReferenceIF
PUBLIC: Returns true if the topic map has been deleted.- Specified by:
isDeleted
in interfaceTopicMapReferenceIF
-
delete
public void delete()
Description copied from interface:TopicMapReferenceIF
PUBLIC: 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:
delete
in interfaceTopicMapReferenceIF
-
clear
public void clear() throws IOException
Description copied from interface:TopicMapReferenceIF
EXPERIMENTAL: 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:
clear
in interfaceTopicMapReferenceIF
- Throws:
IOException
-
createStore
public abstract 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
- Throws:
IOException
-
storeClosed
public void storeClosed(TopicMapStoreIF store)
Description copied from interface:TopicMapReferenceIF
INTERNAL: Callback from the specified TopicMapStoreIF after it has been closed. Warning: Intended for internal use only.- Specified by:
storeClosed
in 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()
-
-