(final TSDB tsdb, final HttpQuery query)
| 122 | } |
| 123 | |
| 124 | public void execute(final TSDB tsdb, final HttpQuery query) { |
| 125 | if (!query.hasQueryStringParam("json") |
| 126 | && !query.hasQueryStringParam("png") |
| 127 | && !query.hasQueryStringParam("ascii")) { |
| 128 | String uri = query.request().getUri(); |
| 129 | if (uri.length() < 4) { // Shouldn't happen... |
| 130 | uri = "/"; // But just in case, redirect. |
| 131 | } else { |
| 132 | uri = "/#" + uri.substring(3); // Remove "/q?" |
| 133 | } |
| 134 | query.redirect(uri); |
| 135 | return; |
| 136 | } |
| 137 | try { |
| 138 | doGraph(tsdb, query); |
| 139 | } catch (IOException e) { |
| 140 | query.internalError(e); |
| 141 | } catch (IllegalArgumentException e) { |
| 142 | query.badRequest(e.getMessage()); |
| 143 | } |
| 144 | } |
| 145 | |
| 146 | // TODO(HugoMFernandes): Most of this (query-related) logic is implemented in |
| 147 | // net.opentsdb.tsd.QueryRpc.java (which actually does this asynchronously), |
nothing calls this directly
no test coverage detected