Class QueryRequestParser
- java.lang.Object
-
- org.intermine.webservice.server.WebServiceRequestParser
-
- org.intermine.webservice.server.query.QueryRequestParser
-
- Direct Known Subclasses:
QueryResultRequestParser
public class QueryRequestParser extends WebServiceRequestParser
Processes query request parameters. The main function of this abstraction to to ensure the Query-xml is properly decoded.- Author:
- Alex Kalderimis
-
-
Field Summary
Fields Modifier and Type Field Description protected javax.servlet.http.HttpServletRequestrequest-
Fields inherited from class org.intermine.webservice.server.WebServiceRequestParser
ADD_HEADER_PARAMETER, CALLBACK_PARAMETER, DEFAULT_LIMIT, FILENAME_PARAMETER, FORMAT_PARAMETER_ANY, FORMAT_PARAMETER_COUNT, FORMAT_PARAMETER_CSV, FORMAT_PARAMETER_HTML, FORMAT_PARAMETER_JSON, FORMAT_PARAMETER_JSON_COUNT, FORMAT_PARAMETER_JSON_DATA_TABLE, FORMAT_PARAMETER_JSON_OBJ, FORMAT_PARAMETER_JSON_ROW, FORMAT_PARAMETER_JSON_TABLE, FORMAT_PARAMETER_JSONP, FORMAT_PARAMETER_JSONP_COUNT, FORMAT_PARAMETER_JSONP_DATA_TABLE, FORMAT_PARAMETER_JSONP_OBJ, FORMAT_PARAMETER_JSONP_ROW, FORMAT_PARAMETER_JSONP_TABLE, FORMAT_PARAMETER_TAB, FORMAT_PARAMETER_TEXT, FORMAT_PARAMETER_TSV, FORMAT_PARAMETER_XML, LIMIT_PARAMETER, MIN_LIMIT, OUTPUT_PARAMETER, START_PARAMETER
-
-
Constructor Summary
Constructors Constructor Description QueryRequestParser(QueryStore queryStore, javax.servlet.http.HttpServletRequest request)RequestProcessor constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.StringdecodeLZWString(java.lang.String encoded)Take in a LZW encoded string and return a decoded plain-text string.static java.lang.StringdecompressLZW(java.util.List<java.lang.Integer> compressed)Decompress a list of output ks to a string.java.lang.StringgetQueryXml()Get query XML from a request.-
Methods inherited from class org.intermine.webservice.server.WebServiceRequestParser
getAcceptableFormats, interpretFormat, isCountRequest, isJsonP, parseFormatFromPathInfo, parseRequest
-
-
-
-
Constructor Detail
-
QueryRequestParser
public QueryRequestParser(QueryStore queryStore, javax.servlet.http.HttpServletRequest request)
RequestProcessor constructor.- Parameters:
request- requestqueryStore- a place to retrieve queries by qid.
-
-
Method Detail
-
decompressLZW
public static java.lang.String decompressLZW(java.util.List<java.lang.Integer> compressed)
Decompress a list of output ks to a string. Gratefully nicked from Stack-Overflow.- Parameters:
compressed- A query compressed to a list of bytes.- Returns:
- The decompressed query.
-
decodeLZWString
public static java.lang.String decodeLZWString(java.lang.String encoded)
Take in a LZW encoded string and return a decoded plain-text string.- Parameters:
encoded- The compressed and encoded representation of the query.- Returns:
- the decompressed query.
-
getQueryXml
public java.lang.String getQueryXml()
Get query XML from a request.- Returns:
- The XML string version of the query, in the correct encoding.
-
-