public abstract class QueryServlet extends GridServlet
xmlq
request parameter appears) or constructs a new XMLQuery (using the
q
request parameter, which contains just a query expression), updates
system properties for the handlers, instantiates any new handlers, and then runs the
query.Modifier and Type | Field and Description |
---|---|
protected List |
handlers
Instantiated query handlers.
|
Constructor and Description |
---|
QueryServlet() |
Modifier and Type | Method and Description |
---|---|
void |
doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Treat GETs as POSTs.
|
void |
doPost(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Handle the query.
|
protected XMLQuery |
getQuery(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Get the query from an HTTP request.
|
protected abstract List |
getServers(Configuration config)
Get a list of
Server s that will provide handlers to handle the query. |
protected abstract void |
handleQuery(XMLQuery query,
List handlers,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Handle the query.
|
approveAccess, getConfigBean, getConfiguration
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
protected List handlers
ProfileHandler
s or product QueryHandler
s.protected abstract List getServers(Configuration config)
Server
s that will provide handlers to handle the query.
Subclasses implement this by returning a list of either ProductServer
s
or ProfileServer
s.config
- a Configuration
value.List
value of Server
s of some kind.protected abstract void handleQuery(XMLQuery query, List handlers, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws IOException, javax.servlet.ServletException
query
- The query to handle.handlers
- A list of either product QueryHandler
s or profile ProfileHandler
s.req
- a HttpServletRequest
value.res
- a HttpServletResponse
value.IOException
- if an I/O error occurs.javax.servlet.ServletException
- if a servlet error occurs.public void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws IOException, javax.servlet.ServletException
doGet
in class GridServlet
req
- a HttpServletRequest
value.res
- a HttpServletResponse
value.IOException
- if an error occurs.javax.servlet.ServletException
- if an error occurs.public void doPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws IOException, javax.servlet.ServletException
doPost
in class javax.servlet.http.HttpServlet
req
- a HttpServletRequest
value.res
- a HttpServletResponse
value.IOException
- if an error occurs.javax.servlet.ServletException
- if an error occurs.protected XMLQuery getQuery(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws IOException
xmlq
parameter (which is given priority) or a q
parameter. We expect xmlq
to contain the XML text format of an
XMLQuery object. q
can contain just the query expression, from
which we'll construct a fresh XMLQuery
with reasonable defaults.
If the user specifies the q
paramater, we'll treat it as a parsed
query, letting the XMLQuery class parse it and build its various expression
stacks according to the DIS syntax. The user can specify the unp
parameter to control this behavior, though. Set to the string
true
and we'll treat the query as unparsed, and the
XMLQuery class should leave it alone. Otherwise, an other value (or
unspecified) will be interpreted as false
, meaning the query will
be parsed.req
- a HttpServletRequest
value.res
- a HttpServletResponse
value.XMLQuery
value.IOException
- if an error occurs.Copyright © 1999-2014 Apache OODT. All Rights Reserved.