@Override public void handle(Request request, Response response) throws Exception { userSession.checkPermission(GlobalPermissions.PREVIEW_EXECUTION); final String moduleKey = request.mandatoryParam(PARAM_KEY); response.stream().setMediaType(MediaTypes.PROTOBUF); DbSession session = dbClient.openSession(false); try { ComponentDto component = componentFinder.getByKey(session, moduleKey); Map<String, String> keysByUUid = keysByUUid(session, component); BatchInput.ServerIssue.Builder issueBuilder = BatchInput.ServerIssue.newBuilder(); for (Iterator<IssueDoc> issueDocIterator = issueIndex.selectIssuesForBatch(component); issueDocIterator.hasNext(); ) { handleIssue(issueDocIterator.next(), issueBuilder, keysByUUid, response.stream().output()); } } finally { MyBatis.closeQuietly(session); } }
public Map<String, Long> listTagsForComponent(IssueQuery query, int pageSize) { return issueIndex.countTags(query, pageSize); }
public SearchResult<IssueDoc> search(IssueQuery query, SearchOptions options) { return issueIndex.search(query, options); }
public List<String> listAuthors(@Nullable String textQuery, int pageSize) { IssueQuery query = IssueQuery.builder(userSession).checkAuthorization(false).build(); return issueIndex.listAuthors(query, textQuery, pageSize); }
public Issue getByKey(String key) { return issueIndex.getByKey(key); }