@Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp)
	    throws ServletException, IOException {
	Map<String, String[]> requestParameters = req.getParameterMap();

	String uri = url.toString();
	Query query = null;
	PostMethod proxyMethod = new PostMethod(uri);
	for (String name : requestParameters.keySet()) {
	    for (String value : requestParameters.get(name)) {
		if ("query".equals(name))
		    query = new Query(value);

		// TODO determine what subscriptions can be affected by this
		// query
		// query.subscriptionsImpact
		proxyMethod.addParameter(name, value);
	    }
	}

	if (query != null) {
	    query.setStartTime(System.currentTimeMillis());
	    LOGGER.debug(query.getQuery());
	}
	proxy.executeMethod(proxyMethod);

	if (query != null) {
	    query.setEndTime(System.currentTimeMillis());
	    Queries.getInstance().addQuery(query);
	    LOGGER.debug("duration:"
		    + (query.getEndTime() - query.getStartTime()));
	}

	write(proxyMethod.getResponseBodyAsStream(), resp.getOutputStream());

	proxyMethod.releaseConnection();
    }