org.mmbase.storage.search.implementation.database
Class BasicQueryHandler

java.lang.Object
  extended byorg.mmbase.storage.search.implementation.database.BasicQueryHandler
All Implemented Interfaces:
SearchQueryHandler

public class BasicQueryHandler
extends java.lang.Object
implements SearchQueryHandler

Basic implementation using a database. Uses a SqlHandler to create SQL string representations of search queries.

In order to execute search queries, these are represented as SQL strings by the handler, and in this form executed on the database.

Since:
MMBase-1.7
Version:
$Id: BasicQueryHandler.java,v 1.26.2.2 2004/06/17 11:21:08 pierre Exp $
Author:
Rob van Maris

Field Summary
 
Fields inherited from interface org.mmbase.storage.search.SearchQueryHandler
FEATURE_MAX_NUMBER, FEATURE_OFFSET, SUPPORT_NONE, SUPPORT_NORMAL, SUPPORT_OPTIMAL, SUPPORT_WEAK
 
Constructor Summary
BasicQueryHandler(SqlHandler sqlHandler)
          Default constructor.
 
Method Summary
 java.util.List getNodes(SearchQuery query, MMObjectBuilder builder)
          Processes a search query, returns the result as a list of nodes.
 int getSupportLevel(Constraint constraint, SearchQuery query)
          Gets the level at which a constraint is supported for a query by this handler.
 int getSupportLevel(int feature, SearchQuery query)
          Gets the level at which a feature is supported for a query by this handler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicQueryHandler

public BasicQueryHandler(SqlHandler sqlHandler)
Default constructor.

Parameters:
sqlHandler - The handler use to create SQL string representations of search queries.
Method Detail

getNodes

public java.util.List getNodes(SearchQuery query,
                               MMObjectBuilder builder)
                        throws SearchQueryException
Description copied from interface: SearchQueryHandler
Processes a search query, returns the result as a list of nodes. Depending on the specified builder, the results will be:

Specified by:
getNodes in interface SearchQueryHandler
Parameters:
query - The search query.
builder - The builder for the result nodes. Specify a ResultBuilder to get resultnodes. ClusterBuilder to get clusternodes.
Returns:
The resulting nodes.
Throws:
SearchQueryException
See Also:
ResultNode, ClusterNode

getSupportLevel

public int getSupportLevel(int feature,
                           SearchQuery query)
                    throws SearchQueryException
Description copied from interface: SearchQueryHandler
Gets the level at which a feature is supported for a query by this handler. This is one of either: Given the choice, the query handler with the highest level of support is prefered.

Specified by:
getSupportLevel in interface SearchQueryHandler
Throws:
SearchQueryException

getSupportLevel

public int getSupportLevel(Constraint constraint,
                           SearchQuery query)
                    throws SearchQueryException
Description copied from interface: SearchQueryHandler
Gets the level at which a constraint is supported for a query by this handler. This is one of either: Given the choice, the query handler with the highest level of support is prefered.

Specified by:
getSupportLevel in interface SearchQueryHandler
Throws:
SearchQueryException


MMBase build 1.7.1.20041002