Minor fixes for query processing.
| | |
| | | } |
| | | |
| | | public void handleResult(final Map<String, Object> result) { |
| | | synchronized (this) { |
| | | results.add(result); |
| | | if (result != null && !result.isEmpty()) { |
| | | synchronized (this) { |
| | | results.add(result); |
| | | } |
| | | } |
| | | if (latch.decrementAndGet() == 0) { |
| | | final Map<String, Object> mergeResult; |
| | |
| | | public void toJson(final ServerContext c, final Entry e, |
| | | final ResultHandler<Map<String, Object>> h) { |
| | | // FIXME: how do we know if the user requested it??? |
| | | final Map<String, Object> result = Collections.singletonMap(jsonAttributeName, |
| | | jsonAttributeValue); |
| | | h.handleResult(result); |
| | | h.handleResult(Collections.singletonMap(jsonAttributeName, jsonAttributeValue)); |
| | | |
| | | } |
| | | |
| | |
| | | final ResourceException result = pendingResult.get(); |
| | | if (result != null && resultSent.compareAndSet(false, true)) { |
| | | if (result == SUCCESS) { |
| | | handler.handleResult(null); |
| | | handler.handleResult(new QueryResult()); |
| | | } else { |
| | | handler.handleError(result); |
| | | } |
| | |
| | | } else { |
| | | value = a.parse().asSetOf(f, defaultValue); |
| | | } |
| | | final Map<String, Object> result = Collections.singletonMap(jsonAttributeName, value); |
| | | h.handleResult(result); |
| | | h.handleResult(Collections.singletonMap(jsonAttributeName, value)); |
| | | } else { |
| | | h.handleResult(null); |
| | | } |
| | | } |
| | | |