org.apache.lucene.gdata.search.index
Class IndexController

java.lang.Object
  extended by org.apache.lucene.gdata.search.index.IndexController
All Implemented Interfaces:
IndexEventListener, SearchComponent, EntryEventListener, ServerComponent

public class IndexController
extends Object
implements SearchComponent, IndexEventListener, EntryEventListener

Default implementation of the SearchComponent interface. All actions on the index will be controlled from this class. Only this class grants read or write actions access to the index.

Author:
Simon Willnauer

Field Summary
protected  Map<String,org.apache.lucene.gdata.search.index.IndexController.ServiceIndex> indexerMap
           
 
Constructor Summary
IndexController()
          Creates a new IndexController -- call initialize() to set up the controller.
 
Method Summary
protected  void addIndexSchema(IndexSchema schema)
           
 void commitCallBack(String service)
          This method will be invoked by an instance of GDataIndexer if the index is commited
protected  boolean createIndexDirectory(File file)
           
protected  org.apache.lucene.gdata.search.index.IndexController.ServiceIndex createIndexer(IndexSchema schema)
           
protected  File createIndexLocation(String path, String name)
           
 void destroy()
          will be called when the registry is going down e.g.
 void fireDeleteAllEntries(ServerBaseFeed feed)
          will be invoked on every successful feed delete
 void fireDeleteEvent(ServerBaseEntry entry)
          will be invoked on every successful entry delete
 void fireInsertEvent(ServerBaseEntry entry)
          will be invoked on every successful entry insert
 void fireUpdateEvent(ServerBaseEntry entry)
          will be invoked on every successful update on every entry
 GDataSearcher<String> getServiceSearcher(ProvidedService service)
          TODO document this when Search comes into play
 void initialize()
          will be call when the component is registered.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

indexerMap

protected Map<String,org.apache.lucene.gdata.search.index.IndexController.ServiceIndex> indexerMap
Constructor Detail

IndexController

public IndexController()
Creates a new IndexController -- call initialize() to set up the controller.

Method Detail

initialize

public void initialize()
Description copied from interface: ServerComponent
will be call when the component is registered. if this fails the server must not startup.

Specified by:
initialize in interface ServerComponent
See Also:
ServerComponent.initialize()

addIndexSchema

protected void addIndexSchema(IndexSchema schema)

createIndexer

protected org.apache.lucene.gdata.search.index.IndexController.ServiceIndex createIndexer(IndexSchema schema)
                                                                                   throws IOException
Throws:
IOException

createIndexLocation

protected File createIndexLocation(String path,
                                   String name)

createIndexDirectory

protected boolean createIndexDirectory(File file)

commitCallBack

public void commitCallBack(String service)
Description copied from interface: IndexEventListener
This method will be invoked by an instance of GDataIndexer if the index is commited

Specified by:
commitCallBack in interface IndexEventListener
Parameters:
service - - the name of the service the invoking indexer runs for
See Also:
IndexEventListener.commitCallBack(java.lang.String)

fireUpdateEvent

public void fireUpdateEvent(ServerBaseEntry entry)
Description copied from interface: EntryEventListener
will be invoked on every successful update on every entry

Specified by:
fireUpdateEvent in interface EntryEventListener
Parameters:
entry - the updated entry
See Also:
EntryEventListener.fireUpdateEvent(org.apache.lucene.gdata.data.ServerBaseEntry)

fireInsertEvent

public void fireInsertEvent(ServerBaseEntry entry)
Description copied from interface: EntryEventListener
will be invoked on every successful entry insert

Specified by:
fireInsertEvent in interface EntryEventListener
See Also:
EntryEventListener.fireInsertEvent(org.apache.lucene.gdata.data.ServerBaseEntry)

fireDeleteEvent

public void fireDeleteEvent(ServerBaseEntry entry)
Description copied from interface: EntryEventListener
will be invoked on every successful entry delete

Specified by:
fireDeleteEvent in interface EntryEventListener
See Also:
EntryEventListener.fireDeleteEvent(org.apache.lucene.gdata.data.ServerBaseEntry)

fireDeleteAllEntries

public void fireDeleteAllEntries(ServerBaseFeed feed)
Description copied from interface: EntryEventListener
will be invoked on every successful feed delete

Specified by:
fireDeleteAllEntries in interface EntryEventListener
Parameters:
feed - - the feed containing the feed id to delete all entries for
See Also:
EntryEventListener.fireDeleteAllEntries(org.apache.lucene.gdata.data.ServerBaseFeed)

getServiceSearcher

public GDataSearcher<String> getServiceSearcher(ProvidedService service)
Description copied from interface: SearchComponent
TODO document this when Search comes into play

Specified by:
getServiceSearcher in interface SearchComponent
Returns:
a GDataSearcher
See Also:
SearchComponent.getServiceSearcher(org.apache.lucene.gdata.server.registry.ProvidedService)

destroy

public void destroy()
Description copied from interface: ServerComponent
will be called when the registry is going down e.g. when the GDataServerRegistry.destroy() method is called.

Specified by:
destroy in interface ServerComponent
See Also:
ServerComponent.destroy()


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.