public class SearchManager
extends java.lang.Object
For different requirement for search configuration, this class can be modified to add more searchers chain configuration.
Constructor and Description |
---|
SearchManager() |
Modifier and Type | Method and Description |
---|---|
void |
search(SearchCriteria searchCriteria,
ResultHandler searchResultBuffer)
This method is used to be called by the GUI layer class to pass the
search criteria.
|
public void search(SearchCriteria searchCriteria, ResultHandler searchResultBuffer) throws DBConnectionException, DBExecutionException
Algorithm: The search manager first creates all the searchers needed
in the search, and configures them in the order of attribute searcher ->
command searcher -> graph searcher.
Once all the results are searched and found, the results will be passed
to the hierarchy fetcher to fetch the referencing information.
After the hierarchy of the results are fetched, the results will be
written to the result buffer together with the hierarchy.
searchCriteria
- The search criteria input by the user.searchResultBuffer
- The buffer that is used to store the search
results. The search result buffer extends the class Observable. The
GUI layer has registered some listener for checking search
result before passing the buffer to this method.DBConnectionException
- Thrown from the database layer when the
database layer fails to create a connection to the database.DBExecutionException
- Thrown from the database layer when the
database layer fails to execute the searching in the database.