Class IndexingChangeListener
- java.lang.Object
-
- org.apache.jena.rdf.listeners.StatementListener
-
- edu.cornell.mannlib.vitro.webapp.searchindex.IndexingChangeListener
-
- All Implemented Interfaces:
SearchIndexer.Listener,org.apache.jena.rdf.model.ModelChangedListener
public class IndexingChangeListener extends org.apache.jena.rdf.listeners.StatementListener implements org.apache.jena.rdf.model.ModelChangedListener, SearchIndexer.Listener
When a change is heard, wait for an interval to see if more changes come in. When changes stop coming in for a specified interval, send what has accumulated. When the SearchIndexer pauses, stop sending changes until the SearchIndexer unpauses. If the SearchIndexer begins a rebuild, discard any changes that we had accumulated. They will be accomplished by the rebuild. ----------------------- When a changed statement is received, it should not be added to the list of pending changes. The elements of the statement hold references to the model in which they were created, as well as to other structures. Thus, an action that produces many changes to the models could become unscalable. To avoid this, we use the ResourceFactory to create a "sanitized" statement which is semantically equivalent to the original, and add that to the list instead. The original statement is released.
-
-
Constructor Summary
Constructors Constructor Description IndexingChangeListener(SearchIndexer searchIndexer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddedStatement(org.apache.jena.rdf.model.Statement stmt)voidnotifyEvent(org.apache.jena.rdf.model.Model model, Object event)We only care about events that signal the end of an edit operation.voidreceiveSearchIndexerEvent(SearchIndexer.Event event)voidremovedStatement(org.apache.jena.rdf.model.Statement stmt)voidshutdown()-
Methods inherited from class org.apache.jena.rdf.listeners.StatementListener
addedStatements, addedStatements, addedStatements, addedStatements, removedStatements, removedStatements, removedStatements, removedStatements
-
-
-
-
Constructor Detail
-
IndexingChangeListener
public IndexingChangeListener(SearchIndexer searchIndexer)
-
-
Method Detail
-
receiveSearchIndexerEvent
public void receiveSearchIndexerEvent(SearchIndexer.Event event)
- Specified by:
receiveSearchIndexerEventin interfaceSearchIndexer.Listener
-
shutdown
public void shutdown()
-
addedStatement
public void addedStatement(org.apache.jena.rdf.model.Statement stmt)
- Specified by:
addedStatementin interfaceorg.apache.jena.rdf.model.ModelChangedListener- Overrides:
addedStatementin classorg.apache.jena.rdf.listeners.StatementListener
-
removedStatement
public void removedStatement(org.apache.jena.rdf.model.Statement stmt)
- Specified by:
removedStatementin interfaceorg.apache.jena.rdf.model.ModelChangedListener- Overrides:
removedStatementin classorg.apache.jena.rdf.listeners.StatementListener
-
notifyEvent
public void notifyEvent(org.apache.jena.rdf.model.Model model, Object event)We only care about events that signal the end of an edit operation.- Specified by:
notifyEventin interfaceorg.apache.jena.rdf.model.ModelChangedListener- Overrides:
notifyEventin classorg.apache.jena.rdf.listeners.StatementListener
-
-