JXTA

net.jxta.impl.cm
Class Indexer

java.lang.Object
  extended by net.jxta.impl.cm.Indexer

public final class Indexer
extends Object


Nested Class Summary
static class Indexer.SearchCallback
           
 
Constructor Summary
Indexer()
           
Indexer(boolean sync)
          Creates an indexer
 
Method Summary
 void addToIndex(Map<String,String> indexables, long pos)
           
 boolean close()
           
 boolean create()
           
 Map<String,NameIndexer> getIndexers()
          returns an iteration of index fields (attributes)
 BTreeFiler getListDB()
          returns listDB
 boolean open()
           
 void purge(List<Long> list)
          purge all index entries pointing to a certain record.
 void purge(long pos)
          purge all index entries pointing to a certain record.
static Set<Long> readRecord(Record record)
           
 void removeFromIndex(Map<String,String> indexables, long pos)
           
 void search(IndexQuery query, String name, BTreeCallback callback)
           
 void setLocation(String dir, String file)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Indexer

public Indexer()

Indexer

public Indexer(boolean sync)
Creates an indexer

Parameters:
sync - passed through to xindice to determine a lazy checkpoint or not false == lazy checkpoint
Method Detail

setLocation

public void setLocation(String dir,
                        String file)

open

public boolean open()
             throws DBException
Throws:
DBException

create

public boolean create()
               throws DBException
Throws:
DBException

close

public boolean close()
              throws DBException
Throws:
DBException

getIndexers

public Map<String,NameIndexer> getIndexers()
returns an iteration of index fields (attributes)


getListDB

public BTreeFiler getListDB()
returns listDB


search

public void search(IndexQuery query,
                   String name,
                   BTreeCallback callback)
            throws IOException,
                   BTreeException
Throws:
IOException
BTreeException

addToIndex

public void addToIndex(Map<String,String> indexables,
                       long pos)
                throws IOException,
                       DBException
Throws:
IOException
DBException

removeFromIndex

public void removeFromIndex(Map<String,String> indexables,
                            long pos)
                     throws DBException
Throws:
DBException

purge

public void purge(List<Long> list)
           throws IOException,
                  BTreeException
purge all index entries pointing to a certain record.

Parameters:
list - List of Long position(s) at which the record to be purged is located in the main database.
Throws:
IOException - if an io error occurs
BTreeException - if an DB error occurs

purge

public void purge(long pos)
           throws IOException,
                  BTreeException
purge all index entries pointing to a certain record.

Parameters:
pos - the position at which the record to be purged is located in the main database.
Throws:
IOException - if an io error occurs
BTreeException - if an BTree error occurs

readRecord

public static Set<Long> readRecord(Record record)

JXSE