Xindice API
version 1.2m1

org.apache.xindice.core.indexer
Interface IndexerEventHandler

All Known Implementing Classes:
BasicIndexerEventHandler

public interface IndexerEventHandler

IndexerEventHandler represents an event handler for Indexer-specific events. It is used by Indexers to manage adding and removing data.

Version:
$Revision: 564424 $, $Date: 2007-08-09 19:40:03 -0400 (Thu, 09 Aug 2007) $
See Also:
Indexer

Method Summary
 void onDocumentAdded(Key key)
          onDocumentAdded method is called after document is added and all its elements are processed.
 void onDocumentDeleted(Key key)
          onDocumentDeleted method is called after document is deleted and all its elements are processed.
 void onNameAdded(IndexPattern pattern, Key key, short elemID, short attrID)
          onNameAdded called for every element/attribute in the document being added that matches any of the Indexer pattern.
 void onNameDeleted(IndexPattern pattern, Key key, short elemID, short attrID)
          onNameDeleted called for every element/attribute in the document being deleted that matches any of the Indexer pattern.
 void onValueAdded(IndexPattern pattern, String value, Key key, int pos, int len, short elemID, short attrID)
          onValueAdded called for every element/attribute in the document being added that matches any of the Indexer pattern.
 void onValueDeleted(IndexPattern pattern, String value, Key key, int pos, int len, short elemID, short attrID)
          onValueDeleted called for every element/attribute in the document being deleted that matches any of the Indexer pattern.
 

Method Detail

onDocumentAdded

public void onDocumentAdded(Key key)
                     throws DBException
onDocumentAdded method is called after document is added and all its elements are processed. This method will be called regardless of Indexer patterns, even if no elements/attributes in that document matches any of Indexer patterns.

Parameters:
key - Document key
Throws:
DBException

onDocumentDeleted

public void onDocumentDeleted(Key key)
                       throws DBException
onDocumentDeleted method is called after document is deleted and all its elements are processed. This method will be called regardless of Indexer patterns, even if no elements/attributes in that document matches any of Indexer patterns.

Parameters:
key - Document key
Throws:
DBException

onNameAdded

public void onNameAdded(IndexPattern pattern,
                        Key key,
                        short elemID,
                        short attrID)
                 throws DBException
onNameAdded called for every element/attribute in the document being added that matches any of the Indexer pattern.

Parameters:
pattern - Indexer pattern that matches the element/attribute
key - Document key
elemID - Element ID that matches the pattern
attrID - Attribute ID that matches the pattern
Throws:
DBException

onNameDeleted

public void onNameDeleted(IndexPattern pattern,
                          Key key,
                          short elemID,
                          short attrID)
                   throws DBException
onNameDeleted called for every element/attribute in the document being deleted that matches any of the Indexer pattern.

Parameters:
pattern - Indexer pattern that matches the element/attribute
key - Document key
elemID - Element ID that matches the pattern
attrID - Attribute ID that matches the pattern
Throws:
DBException

onValueAdded

public void onValueAdded(IndexPattern pattern,
                         String value,
                         Key key,
                         int pos,
                         int len,
                         short elemID,
                         short attrID)
                  throws DBException
onValueAdded called for every element/attribute in the document being added that matches any of the Indexer pattern.

Parameters:
pattern - Indexer pattern that matches the element/attribute
value - Element/attribute value to add
key - Document key
pos - The offset into the stream the Element occurs at
len - The length of the substream for the Element
elemID - Element ID that matches the pattern
attrID - Attribute ID that matches the pattern
Throws:
DBException

onValueDeleted

public void onValueDeleted(IndexPattern pattern,
                           String value,
                           Key key,
                           int pos,
                           int len,
                           short elemID,
                           short attrID)
                    throws DBException
onValueDeleted called for every element/attribute in the document being deleted that matches any of the Indexer pattern.

Parameters:
pattern - Indexer pattern that matches the element/attribute
value - Element/attribute value to delete
key - Document key
pos - The offset into the stream the Element occurs at
len - The length of the substream for the Element
elemID - Element ID that matches the pattern
attrID - Attribute ID that matches the pattern
Throws:
DBException

Xindice API
version 1.2m1

Copyright (c) 1999-2007 The Apache Software Foundation. All Rights Reserved.