Exemplo n.º 1
0
  @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);
    }
  }
Exemplo n.º 2
0
 public Map<String, Long> listTagsForComponent(IssueQuery query, int pageSize) {
   return issueIndex.countTags(query, pageSize);
 }
Exemplo n.º 3
0
 public SearchResult<IssueDoc> search(IssueQuery query, SearchOptions options) {
   return issueIndex.search(query, options);
 }
Exemplo n.º 4
0
 public List<String> listAuthors(@Nullable String textQuery, int pageSize) {
   IssueQuery query = IssueQuery.builder(userSession).checkAuthorization(false).build();
   return issueIndex.listAuthors(query, textQuery, pageSize);
 }
Exemplo n.º 5
0
 public Issue getByKey(String key) {
   return issueIndex.getByKey(key);
 }