com.esri.adf.web.data.query
Class QueryFunctionality

java.lang.Object
  extended by com.esri.adf.web.data.query.QueryFunctionality
All Implemented Interfaces:
GISFunctionality, Serializable
Direct Known Subclasses:
AGSImageQueryFunctionality, AGSQueryFunctionality, AIMSQueryFunctionality, GraphicsQueryFunctionality, WMSQueryFunctionality

public abstract class QueryFunctionality
extends Object
implements GISFunctionality, Serializable

The abstract QueryFunctionality class is extended by functionalities to provide querying capabilities for the resource. For instance, the AGSQueryFunctionality provides querying for ArcGIS Server resources, the AIMSQueryFunctionality provides querying for ArcIMS resources, et al.

The WebQuery works with several query functionalities referenced by the resources by the name FUNCTIONALITY_NAME.

QueryCriteriaHandlers for various types of QueryCriteria can be registered with the query functionalities by using the addFindCriteriaHandler(String, QueryCriteriaHandler) method. When the find() method is called on this functionality, it delegates the handling of the query to the appropriate query handler.

See Also:
Serialized Form

Field Summary
static String FUNCTIONALITY_NAME
           The name that should be given to the QueryFunctionality in order for it to be consumed by the WebQuery
protected  Map<String,QueryCriteriaHandler> handlers
           The QueryCriteriaHandlers supported by this functionality as a java.util.Map of <critera type(String)>-<QueryCriteriaHandler> pairs.
 
Constructor Summary
QueryFunctionality()
           
 
Method Summary
 void addFindCriteriaHandler(String criteriaType, QueryCriteriaHandler handler)
           Registers this query handler for the given criteriaType with this functionality.
 List<QueryResult> find(QueryCriteria criteria, List<WebLayerInfo> layers, WebQuery query)
           Query the given set of layers based on the given criteria.
 Map<String,QueryCriteriaHandler> getFindCriteriaHandlers()
           Returns the QueryCriteriaHandlers registered with this functionality.
abstract  List<WebLayerInfo> getQueryLayers()
           Returns the query-able layers as a List of WebLayerInfo objects.
 QueryCriteriaHandler removeFindCriteriaHandler(String criteriaType)
           Removes the QueryCriteriaHandler associated with the given criteriaType.
 void setFindCriteriaHandlers(Map<String,? extends QueryCriteriaHandler> handlers)
           Registers the given set of QueryCriteriaHandlers with this functionality.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.esri.adf.web.data.GISFunctionality
destroyFunctionality, getResource, initFunctionality
 

Field Detail

FUNCTIONALITY_NAME

public static final String FUNCTIONALITY_NAME

The name that should be given to the QueryFunctionality in order for it to be consumed by the WebQuery

See Also:
Constant Field Values

handlers

protected Map<String,QueryCriteriaHandler> handlers

The QueryCriteriaHandlers supported by this functionality as a java.util.Map of <critera type(String)>-<QueryCriteriaHandler> pairs.

Constructor Detail

QueryFunctionality

public QueryFunctionality()
Method Detail

setFindCriteriaHandlers

public void setFindCriteriaHandlers(Map<String,? extends QueryCriteriaHandler> handlers)

Registers the given set of QueryCriteriaHandlers with this functionality.

Parameters:
handlers - a java.util.Map of <critera type(String)>-<QueryCriteriaHandler> pairs to be registered with this functionality

getFindCriteriaHandlers

public Map<String,QueryCriteriaHandler> getFindCriteriaHandlers()

Returns the QueryCriteriaHandlers registered with this functionality.

Returns:
a java.util.Map of <critera type(String)>-<QueryCriteriaHandler> pairs registered with this functionality

addFindCriteriaHandler

public void addFindCriteriaHandler(String criteriaType,
                                   QueryCriteriaHandler handler)

Registers this query handler for the given criteriaType with this functionality.

Parameters:
criteriaType - the type of criteria supported by this handler
handler - the QueryCriteriaHandler to be registered with this functionality

removeFindCriteriaHandler

public QueryCriteriaHandler removeFindCriteriaHandler(String criteriaType)

Removes the QueryCriteriaHandler associated with the given criteriaType.

Parameters:
criteriaType - the type of criteria whose handler is to be removed
Returns:
the QueryCriteriaHandler removed

getQueryLayers

public abstract List<WebLayerInfo> getQueryLayers()

Returns the query-able layers as a List of WebLayerInfo objects.

Returns:
the query-able layers as a List of WebLayerInfo objects

find

public List<QueryResult> find(QueryCriteria criteria,
                              List<WebLayerInfo> layers,
                              WebQuery query)

Query the given set of layers based on the given criteria. The results should be returned as a List of QueryResult objects.

This method delegates the actual handling of the query to the appropriate query handler based on the type of the given criteria.

Parameters:
criteria - the QueryCriteria based on which the query is performed
layers - the List of WebLayerInfos to query.
query - the associated WebQuery object
Returns:
a List of QueryResult objects