org.sourceforge.beanindex
Class BeanIndex

java.lang.Object
  extended byorg.sourceforge.beanindex.BeanIndex
All Implemented Interfaces:
DataProviderCallBack

public class BeanIndex
extends java.lang.Object
implements DataProviderCallBack

This is the main class.

Author:
Sakthivel Muthusamy

Field Summary
static java.lang.String BASE_DIR
           
static java.lang.String BCKP_DIR
           
static java.lang.String DEPLOY_DIR
           
static java.lang.String WORKING_DIR
           
 
Constructor Summary
BeanIndex(java.lang.String path)
           
 
Method Summary
 void add(Index index, java.lang.Object bean)
          This method adds the beans to the index and stores the object into beanrepository
 void cancelSchedule()
           
 Index createIndex(java.lang.String name)
           
 void deploy()
          Call this method to deploy a new index dataset.
 BeanIndexBuilder getBeanIndexBuilder(BeanIndexMetaInfo beanInfo, boolean useVirtualMemory)
           
 BeanIndexSearcher getBeanIndexSearcher(SearcherConfigInfo searcherConfig)
           
 BeanIndexSearcher getBeanIndexSearcher(java.lang.String defLglOp, SearcherConfigInfo searcherConfig)
          pass a default logical operator to be used in search term evaluations Either OR or AND.
 DataProvider getRegisteredDataProvider()
           
 void hotDeploy()
          This method should be called by the client to hotdeploy new index dataset.
 void hotDeploy(SearcherConfigInfo newSearcherConfig)
          Call this method to deploy new index dataset with a new Searcher Configuration while BeanIndexSearcher is serving the clients
 void notifyEnd()
          This method should be called by the DataProvider at the end of DataTransmission
 void notifyStart(boolean useVirtualMemory)
          This method should be called by the DataProvider before starting the Transmission after receiving the initiateDataTransmission signal
 void registerDataProvider(DataProvider provider)
           
 void registerDeployEventListener(DeployEventListener listener)
           
 java.lang.String[] resolveWildCardSearchTerm(java.lang.String term)
           
 void setSelfReDeploySchedule(Schedule schedule)
           
 void updateDataProviderSchedule(Schedule schedule)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BASE_DIR

public static java.lang.String BASE_DIR

WORKING_DIR

public static java.lang.String WORKING_DIR

BCKP_DIR

public static java.lang.String BCKP_DIR

DEPLOY_DIR

public static java.lang.String DEPLOY_DIR
Constructor Detail

BeanIndex

public BeanIndex(java.lang.String path)
Parameters:
path -
Method Detail

getBeanIndexBuilder

public BeanIndexBuilder getBeanIndexBuilder(BeanIndexMetaInfo beanInfo,
                                            boolean useVirtualMemory)
                                     throws java.lang.Exception
Parameters:
beanInfo -
Returns:
BeanIndexBuilder @throws Exception
Throws:
java.lang.Exception

createIndex

public Index createIndex(java.lang.String name)
                  throws java.lang.Exception
Parameters:
name -
Returns:
Index
Throws:
java.lang.Exception

getBeanIndexSearcher

public BeanIndexSearcher getBeanIndexSearcher(SearcherConfigInfo searcherConfig)
                                       throws BeanIndexException
Parameters:
searcherConfig -
Returns:
BeanIndexSearcher @throws BeanIndexException
Throws:
BeanIndexException

getBeanIndexSearcher

public BeanIndexSearcher getBeanIndexSearcher(java.lang.String defLglOp,
                                              SearcherConfigInfo searcherConfig)
                                       throws BeanIndexException
pass a default logical operator to be used in search term evaluations Either OR or AND. BeanIndex defaults to AND

Parameters:
defLglOp -
searcherConfig -
Returns:
BeanIndexSearcher @throws BeanIndexException
Throws:
BeanIndexException

registerDataProvider

public void registerDataProvider(DataProvider provider)
                          throws BeanIndexException
Parameters:
provider -
Throws:
BeanIndexException

cancelSchedule

public void cancelSchedule()

getRegisteredDataProvider

public DataProvider getRegisteredDataProvider()
Returns:
DataProvider

registerDeployEventListener

public void registerDeployEventListener(DeployEventListener listener)

updateDataProviderSchedule

public void updateDataProviderSchedule(Schedule schedule)
                                throws BeanIndexException
Parameters:
schedule -
Throws:
BeanIndexException

setSelfReDeploySchedule

public void setSelfReDeploySchedule(Schedule schedule)
                             throws BeanIndexException
Parameters:
schedule -
Throws:
BeanIndexException

deploy

public void deploy()
            throws java.lang.Exception
Call this method to deploy a new index dataset. This method should not be called while BeanIndexSearcher is serving client search requests.

Throws:
java.lang.Exception

hotDeploy

public void hotDeploy(SearcherConfigInfo newSearcherConfig)
               throws BeanIndexException
Call this method to deploy new index dataset with a new Searcher Configuration while BeanIndexSearcher is serving the clients

Throws:
BeanIndexException

hotDeploy

public void hotDeploy()
               throws BeanIndexException
This method should be called by the client to hotdeploy new index dataset. If there is any scheduled deployment exists, it is delayed until this request is complete. if any other scheduled deployment is in progress this request Method to redeploy while BeanIndexSearcher is serving the clients

Throws:
BeanIndexException

notifyStart

public void notifyStart(boolean useVirtualMemory)
                 throws java.lang.Exception
Description copied from interface: DataProviderCallBack
This method should be called by the DataProvider before starting the Transmission after receiving the initiateDataTransmission signal

Specified by:
notifyStart in interface DataProviderCallBack
Parameters:
useVirtualMemory -
Throws:
java.lang.Exception

add

public void add(Index index,
                java.lang.Object bean)
         throws java.lang.Exception
Description copied from interface: DataProviderCallBack
This method adds the beans to the index and stores the object into beanrepository

Specified by:
add in interface DataProviderCallBack
Parameters:
index -
bean -
Throws:
java.lang.Exception

notifyEnd

public void notifyEnd()
               throws java.lang.Exception
Description copied from interface: DataProviderCallBack
This method should be called by the DataProvider at the end of DataTransmission

Specified by:
notifyEnd in interface DataProviderCallBack
Throws:
java.lang.Exception

resolveWildCardSearchTerm

public java.lang.String[] resolveWildCardSearchTerm(java.lang.String term)
                                             throws java.lang.Exception
Parameters:
term -
Returns:
wildcardvalues
Throws:
java.lang.Exception