use of org.apache.jackrabbit.webdav.client.methods.HttpSearch in project jackrabbit by apache.
the class RepositoryServiceImpl method executeQuery.
@Override
public QueryInfo executeQuery(SessionInfo sessionInfo, String statement, String language, Map<String, String> namespaces, long limit, long offset, Map<String, QValue> values) throws RepositoryException {
HttpSearch request = null;
try {
String uri = uriResolver.getWorkspaceUri(sessionInfo.getWorkspaceName());
SearchInfo sInfo = new SearchInfo(language, ItemResourceConstants.NAMESPACE, statement, namespaces);
if (limit != -1) {
sInfo.setNumberResults(limit);
}
if (offset != -1) {
sInfo.setOffset(offset);
}
if (!(values == null || values.isEmpty())) {
throw new UnsupportedOperationException("Implementation missing: JCR-2107");
}
request = new HttpSearch(uri, sInfo);
HttpResponse response = executeRequest(sessionInfo, request);
request.checkSuccess(response);
MultiStatus ms = request.getResponseBodyAsMultiStatus(response);
NamePathResolver resolver = getNamePathResolver(sessionInfo);
return new QueryInfoImpl(ms, idFactory, resolver, valueFactory, getQValueFactory());
} catch (IOException e) {
throw new RepositoryException(e);
} catch (DavException e) {
throw ExceptionConverter.generate(e);
} finally {
if (request != null) {
request.releaseConnection();
}
}
}
Aggregations