net.ontopia.topicmaps.entry
Class AbstractOntopolyURLReference

java.lang.Object
  extended by net.ontopia.topicmaps.entry.AbstractTopicMapReference
      extended by net.ontopia.topicmaps.entry.AbstractURLTopicMapReference
          extended by net.ontopia.topicmaps.entry.AbstractOntopolyURLReference
All Implemented Interfaces:
TopicMapReferenceIF, TransactionEventListenerIF
Direct Known Subclasses:
CTMTopicMapReference, LTMTopicMapReference, TMXMLTopicMapReference, XTMTopicMapReference

public abstract class AbstractOntopolyURLReference
extends AbstractURLTopicMapReference
implements TransactionEventListenerIF

INTERNAL: Common abstract superclass for references from sources that support what Ontopoly needs.


Field Summary
protected  boolean alwaysReindexOnLoad
           
protected  FulltextIndexManager ftmanager
           
 
Fields inherited from class net.ontopia.topicmaps.entry.AbstractURLTopicMapReference
base_address, duplicate_suppression, indexDirectory, maintainFulltextIndexes, reuse_store, store, url
 
Fields inherited from class net.ontopia.topicmaps.entry.AbstractTopicMapReference
deleted, id, isopen, listeners, source, title, topic_listeners
 
Constructor Summary
AbstractOntopolyURLReference(java.net.URL url, java.lang.String id, java.lang.String title, LocatorIF base)
           
 
Method Summary
 void close()
          PUBLIC: Closes all open stores and the reference itself.
 void delete()
          INTERNAL: Deletes the topic map pointed to.
 boolean getAlwaysReindexOnLoad()
           
protected abstract  TopicMapImporterIF getImporter()
           
protected  long getLastModifiedAt(java.io.File file)
           
protected  long getLastModifiedAt(java.net.URL url)
           
 SearcherIF getSearcher()
           
protected  TopicMapIF loadTopicMap(boolean readonly)
           
 void setAlwaysReindexOnLoad(boolean alwaysReindexOnLoad)
           
 boolean synchronizeFulltextIndex()
          INTERNAL: Synchronizes the underlying fulltext index with the latest changes in the topic map.
protected  boolean synchronizeFulltextIndex(boolean replaceIndex)
           
 void transactionAbort(TopicMapTransactionIF transaction)
           
 void transactionCommit(TopicMapTransactionIF transaction)
           
 
Methods inherited from class net.ontopia.topicmaps.entry.AbstractURLTopicMapReference
createStore, getBaseAddress, getDuplicateSuppression, getIndexDirectory, getMaintainFulltextIndexes, getReuseStore, getURL, open, setBaseAddress, setDuplicateSuppression, setIndexDirectory, setMaintainFulltextIndexes, setReuseStore, setTopicListeners, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ftmanager

protected FulltextIndexManager ftmanager

alwaysReindexOnLoad

protected boolean alwaysReindexOnLoad
Constructor Detail

AbstractOntopolyURLReference

public AbstractOntopolyURLReference(java.net.URL url,
                                    java.lang.String id,
                                    java.lang.String title,
                                    LocatorIF base)
Method Detail

loadTopicMap

protected TopicMapIF loadTopicMap(boolean readonly)
                           throws java.io.IOException
Specified by:
loadTopicMap in class AbstractURLTopicMapReference
Throws:
java.io.IOException

getLastModifiedAt

protected long getLastModifiedAt(java.io.File file)

getLastModifiedAt

protected long getLastModifiedAt(java.net.URL url)

getAlwaysReindexOnLoad

public boolean getAlwaysReindexOnLoad()

setAlwaysReindexOnLoad

public void setAlwaysReindexOnLoad(boolean alwaysReindexOnLoad)

synchronizeFulltextIndex

public boolean synchronizeFulltextIndex()
                                 throws java.io.IOException
INTERNAL: Synchronizes the underlying fulltext index with the latest changes in the topic map.

Returns:
True if index was modified.
Throws:
java.io.IOException

synchronizeFulltextIndex

protected boolean synchronizeFulltextIndex(boolean replaceIndex)
                                    throws java.io.IOException
Throws:
java.io.IOException

getSearcher

public SearcherIF getSearcher()

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 interface TopicMapReferenceIF
Overrides:
close in class AbstractURLTopicMapReference

delete

public void delete()
Description copied from class: AbstractURLTopicMapReference
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 interface TopicMapReferenceIF
Overrides:
delete in class AbstractURLTopicMapReference

transactionCommit

public void transactionCommit(TopicMapTransactionIF transaction)
Specified by:
transactionCommit in interface TransactionEventListenerIF

transactionAbort

public void transactionAbort(TopicMapTransactionIF transaction)
Specified by:
transactionAbort in interface TransactionEventListenerIF

getImporter

protected abstract TopicMapImporterIF getImporter()


Copyright © 2000-2012 Ontopia.