org.apache.oodt.xmlquery
Class XMLQuery

java.lang.Object
  extended by org.apache.oodt.xmlquery.XMLQuery
All Implemented Interfaces:
Serializable, Cloneable

public class XMLQuery
extends Object
implements Serializable, Cloneable

EDA XML query class. Parses a DIS style keyword query and creates query SELECT, FROM, and WHERE clauses. An XML DOM structure and an XML document representing the query can also be created. A RESULT set can be added to and retrieve.

See Also:
Serialized Form

Field Summary
static int DEFAULT_MAX_RESULTS
          Maximum number results to get (default).
static String[] FROM_TOKENS
           
protected  int numResults
          Number of results so far.
static String QUERY_FPI
          The Formal Public Identifier of the query DTD.
static String QUERY_URL
          The System Identifier of the query DTD.
 
Constructor Summary
XMLQuery(Node node)
          Instantiates an XMLQuery instance from an XML query structure in DOM node format.
XMLQuery(String xmlQueryString)
          Instantiates an XMLQuery instance from an XML query structure in string format.
XMLQuery(String keywordQuery, String id, String title, String desc, String ddId, String resultModeId, String propType, String propLevels, int maxResults)
          Constructor.
XMLQuery(String keywordQuery, String id, String title, String desc, String ddId, String resultModeId, String propType, String propLevels, int maxResults, boolean parseQuery)
          Constructor.
XMLQuery(String keywordQuery, String id, String title, String desc, String ddId, String resultModeId, String propType, String propLevels, int maxResults, List mimeAccept)
          Constructor.
XMLQuery(String keywordQuery, String id, String title, String desc, String ddId, String resultModeId, String propType, String propLevels, int maxResults, List mimeAccept, boolean parseQuery)
          Constructor.
 
Method Summary
 Object clone()
           
static Document createDocument()
          Create an XML DOM document using the query DTD.
 boolean equals(Object rhs)
           
 List getFromElementSet()
           
 String getKwdQueryString()
          Gets the original DIS style keyword query string.
 int getMaxResults()
          Gets the max # of results
 List getMimeAccept()
          Get the list of acceptable MIME types.
 String getPropagationLevels()
          Get the propagation levels.
 String getPropagationType()
          Get the propagation type.
 QueryHeader getQueryHeader()
           
 QueryResult getResult()
           
 String getResultModeID()
           
 List getResults()
           
 List getSelectElementSet()
           
 List getStatistics()
          Get the list of stasitics of this query.
 List getWhereElementSet()
           
 Document getXMLDoc()
           
 String getXMLDocString()
          Gets query as an XML document in string format.
 int hashCode()
           
static void main(String[] argv)
           
 void setRetriever(Retriever retriever)
           
 void setWhereElementSet(List whereElementSet)
          Set query where element set.
 String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

numResults

protected int numResults
Number of results so far. This could be greater than results.size() because that's limited by maxResults. Meh, this isn't even updated by anyone as far as I can tell.


FROM_TOKENS

public static final String[] FROM_TOKENS

DEFAULT_MAX_RESULTS

public static final int DEFAULT_MAX_RESULTS
Maximum number results to get (default).

See Also:
Constant Field Values

QUERY_FPI

public static final String QUERY_FPI
The Formal Public Identifier of the query DTD.

See Also:
Constant Field Values

QUERY_URL

public static final String QUERY_URL
The System Identifier of the query DTD.

See Also:
Constant Field Values
Constructor Detail

XMLQuery

public XMLQuery(String keywordQuery,
                String id,
                String title,
                String desc,
                String ddId,
                String resultModeId,
                String propType,
                String propLevels,
                int maxResults)
Constructor.

Parameters:
keywordQuery - The DIS style keyword query string.
id - A query identifier.
title - A terse description of the query for display.
desc - A description of the query.
ddId - The data dictionary identifier.
resultModeId - Indicates the return of INSTANCE, PROFILE, or CLASS.
propType - Indicates query BROADCAST or PROPOGATE.
propLevels - Number of propogation levels.
maxResults - Maximum number of results to be returned.

XMLQuery

public XMLQuery(String keywordQuery,
                String id,
                String title,
                String desc,
                String ddId,
                String resultModeId,
                String propType,
                String propLevels,
                int maxResults,
                boolean parseQuery)
Constructor.

Parameters:
keywordQuery - The DIS style keyword query string.
id - A query identifier.
title - A terse description of the query for display.
desc - A description of the query.
ddId - The data dictionary identifier.
resultModeId - Indicates the return of INSTANCE, PROFILE, or CLASS.
propType - Indicates query BROADCAST or PROPOGATE.
propLevels - Number of propogation levels.
maxResults - Maximum number of results to be returned.
parseQuery - Indicates whether query should be parsed

XMLQuery

public XMLQuery(String keywordQuery,
                String id,
                String title,
                String desc,
                String ddId,
                String resultModeId,
                String propType,
                String propLevels,
                int maxResults,
                List mimeAccept)
Constructor.

Parameters:
keywordQuery - The DIS style keyword query string.
id - A query identifier.
title - A terse description of the query for display.
desc - A description of the query.
ddId - The data dictionary identifier.
resultModeId - Indicates the return of INSTANCE, PROFILE, or CLASS.
propType - Indicates query BROADCAST or PROPOGATE.
propLevels - Number of propogation levels.
maxResults - Maximum number of results to be returned.
mimeAccept - List of acceptable MIME types.

XMLQuery

public XMLQuery(String keywordQuery,
                String id,
                String title,
                String desc,
                String ddId,
                String resultModeId,
                String propType,
                String propLevels,
                int maxResults,
                List mimeAccept,
                boolean parseQuery)
Constructor.

Parameters:
keywordQuery - The DIS style keyword query string.
id - A query identifier.
title - A terse description of the query for display.
desc - A description of the query.
ddId - The data dictionary identifier.
resultModeId - Indicates the return of INSTANCE, PROFILE, or CLASS.
propType - Indicates query BROADCAST or PROPOGATE.
propLevels - Number of propogation levels.
maxResults - Maximum number of results to be returned.
mimeAccept - List of acceptable MIME types.
parseQuery - Indicates whether query should be parsed

XMLQuery

public XMLQuery(String xmlQueryString)
         throws SAXException
Instantiates an XMLQuery instance from an XML query structure in string format.

Parameters:
xmlQueryString - The XML query structure in string format.
Throws:
SAXException

XMLQuery

public XMLQuery(Node node)
Instantiates an XMLQuery instance from an XML query structure in DOM node format.

Parameters:
node - The XML <query> node.
Method Detail

getMimeAccept

public List getMimeAccept()
Get the list of acceptable MIME types.

Returns:
The list of acceptable MIME types; you may modify the list.

getKwdQueryString

public String getKwdQueryString()
Gets the original DIS style keyword query string.

Returns:
The DIS style keyword query string.

getMaxResults

public int getMaxResults()
Gets the max # of results

Returns:
the results

getSelectElementSet

public List getSelectElementSet()
Returns:
Gets the select elements

getFromElementSet

public List getFromElementSet()
Returns:
Gets the from element set from the query

getResultModeID

public String getResultModeID()
Returns:
Gets the resultModeID

getWhereElementSet

public List getWhereElementSet()
Returns:
Gets the where set

setWhereElementSet

public void setWhereElementSet(List whereElementSet)
Set query where element set.

Parameters:
whereElementSet - Thw where element set of XMLQuery.

getResult

public QueryResult getResult()
Returns:
Gets the result list

getResults

public List getResults()

setRetriever

public void setRetriever(Retriever retriever)

getXMLDoc

public Document getXMLDoc()
Returns:
The query as an XML DOM structure.

getStatistics

public List getStatistics()
Get the list of stasitics of this query.

Returns:
A list of Statistic objects.

getXMLDocString

public String getXMLDocString()
Gets query as an XML document in string format.

Returns:
The query as an XML document in string format.

getPropagationType

public String getPropagationType()
Get the propagation type.

Returns:
a String value.

getPropagationLevels

public String getPropagationLevels()
Get the propagation levels.

Returns:
a String value.

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object rhs)
Overrides:
equals in class Object

clone

public Object clone()
Overrides:
clone in class Object

toString

public String toString()
Overrides:
toString in class Object

createDocument

public static Document createDocument()
Create an XML DOM document using the query DTD.

Returns:
An XML DOM document, with a query root element, using the query DTD.

main

public static void main(String[] argv)
                 throws Exception
Throws:
Exception

getQueryHeader

public QueryHeader getQueryHeader()


Copyright © 1999-2012 Apache OODT. All Rights Reserved.