@ThreadSafe public final class WAP extends HttpServlet
web.xml
configuration file. The service path is /wap
. An example request is:
http://reluk.ca:8080/v/wap?wCall=cCount&cPoll=G%2Fp%2Fsandbox&wPretty
Key | Value | Default |
---|---|---|
wCall | The list of typed calls for this request, separated by apostrophes ('). For example, "wCall=hHarvest'psPollspace" specifies call types Harvest and Pollspace under prefixes 'h' and 'ps' respectively. Prefixes provide namespacing of query parameters and results that are particular to each call type. They are restricted to lower case ASCII characters, excepting the single letter prefix 'w' which is reserved. | Null, making no calls. |
wCallback | The name of the callback function for a JSONP response, or leave it unspecified for a plain JSON response. This is a qualifier for wForm whenever that parameter is set to 'JSON'. | Null, specifying a plain JSON response. |
wForm | The form of the response. Currently only 'JSON' is supported, which gives either JSON or JSONP depending on the value of wCallback. | 'JSON' |
wNonce | An arbitrary value intended to give the request a unique URL. Use it to defeat caching in clients that ignore the cache control headers. | Null, optional item. |
wPretty | Specify 'wPretty' or 'wPretty=y' to make the response more human readable. This adds whitespace and forces a content type of 'text/plain'. | 'n' |
The response has the following general form, shown here with JSON formatting and explanatory comments. For further details, see the API documentation of the individual calls.
{ "CALL-PREFIX-1": { // response to first call }, "CALL-PREFIX-2": { // response to second call } // and so on, for each call }
Modifier and Type | Field and Description |
---|---|
(package private) static Pattern |
W_CALL_PATTERN
The pattern of a call entry in query parameter 'wCall'.
|
Constructor and Description |
---|
WAP() |
Modifier and Type | Method and Description |
---|---|
(package private) Map<String,Constructor<? extends Call>> |
callConstructors()
Map of constructors for all known call types, keyed by type name.
|
protected void |
doGet(HttpServletRequest req,
HttpServletResponse res) |
void |
init() |
VoteServer.Run |
vsRun()
The run of the vote-server against which requests are made.
|
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
static final Pattern W_CALL_PATTERN
public WAP()
public void init() throws ServletException
init
in class GenericServlet
ServletException
@Warning(value="thread restricted object, holds WAP.this") Map<String,Constructor<? extends Call>> callConstructors()
public VoteServer.Run vsRun()
protected void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException
doGet
in class HttpServlet
IOException