Class 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 Detail

      • IndexingChangeListener

        public IndexingChangeListener​(SearchIndexer searchIndexer)
    • Method Detail

      • shutdown

        public void shutdown()
      • addedStatement

        public void addedStatement​(org.apache.jena.rdf.model.Statement stmt)
        Specified by:
        addedStatement in interface org.apache.jena.rdf.model.ModelChangedListener
        Overrides:
        addedStatement in class org.apache.jena.rdf.listeners.StatementListener
      • removedStatement

        public void removedStatement​(org.apache.jena.rdf.model.Statement stmt)
        Specified by:
        removedStatement in interface org.apache.jena.rdf.model.ModelChangedListener
        Overrides:
        removedStatement in class org.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:
        notifyEvent in interface org.apache.jena.rdf.model.ModelChangedListener
        Overrides:
        notifyEvent in class org.apache.jena.rdf.listeners.StatementListener