com.atlassian.bamboo.resultsummary.search
Interface IndexedBuildResultsSearcher

All Known Implementing Classes:
IndexedBuildResultsSearcherImpl

public interface IndexedBuildResultsSearcher


Method Summary
 int count(org.apache.lucene.search.Query query)
          Counts the number of builds that matches the query
 org.apache.lucene.document.Document findBuildResultByNumberAndKey(PlanKey planKey, int buildNumber)
          Find document identified by plan key and build result.
<T> List<T>
findBuildResultDataByJiraIssueKey(Set<String> issueKeys, com.google.common.base.Function<org.apache.lucene.document.Document,T> transformation)
          Find documents relevant to given set of Jira issue keys and apply transformation.
 ResultsSummary findLatestRelevantBuildResult(PlanIdentifier plan, Long beforeLastCompletedTimestamp)
          Find the last finished build of a plan that completed before given time
 List<ResultsSummary> search(Map<String,String[]> params)
           
 void search(org.apache.lucene.search.Query q, AbstractDocumentHitCollector collector)
           
 PartialList<ResultsSummary> search(org.apache.lucene.search.Query q, int maxResults)
          Returns a list of ResultsSummary that matches the query up to maxResults
<T> PartialList<T>
search(org.apache.lucene.search.Query q, int maxResults, com.google.common.base.Function<org.apache.lucene.document.Document,T> documentParser)
          Returns a list of T that matches the query up to maxResults.
 

Method Detail

findLatestRelevantBuildResult

@Nullable
ResultsSummary findLatestRelevantBuildResult(@NotNull
                                                      PlanIdentifier plan,
                                                      @NotNull
                                                      Long beforeLastCompletedTimestamp)
Find the last finished build of a plan that completed before given time

Parameters:
plan - Plan to filter build results
beforeLastCompletedTimestamp - timestamp
Returns:
ResultSummary of null if there's no finished build before given time

findBuildResultDataByJiraIssueKey

@NotNull
<T> List<T> findBuildResultDataByJiraIssueKey(@NotNull
                                                      Set<String> issueKeys,
                                                      @NotNull
                                                      com.google.common.base.Function<org.apache.lucene.document.Document,T> transformation)
Find documents relevant to given set of Jira issue keys and apply transformation. Search is made across ALL ResultsSummary documents (including incomplete).

Parameters:
issueKeys - set of Jira issue keys to narrow down the search
transformation - transformation to be applied to found documents
Returns:
List of transformed objects

findBuildResultByNumberAndKey

@Nullable
org.apache.lucene.document.Document findBuildResultByNumberAndKey(@NotNull
                                                                           PlanKey planKey,
                                                                           int buildNumber)
Find document identified by plan key and build result. Search is made across ALL ResultsSummary documents (including incomplete).

Parameters:
planKey - Plan key
buildNumber - build number
Returns:
Document or null if not foud

search

List<ResultsSummary> search(Map<String,String[]> params)

search

@NotNull
PartialList<ResultsSummary> search(@NotNull
                                           org.apache.lucene.search.Query q,
                                           int maxResults)
Returns a list of ResultsSummary that matches the query up to maxResults

Parameters:
q -
maxResults -
Returns:

search

@NotNull
<T> PartialList<T> search(@NotNull
                                  org.apache.lucene.search.Query q,
                                  int maxResults,
                                  com.google.common.base.Function<org.apache.lucene.document.Document,T> documentParser)
Returns a list of T that matches the query up to maxResults. Provides a custom processor for documents.

Parameters:
q -
maxResults -
Returns:

count

int count(@NotNull
          org.apache.lucene.search.Query query)
Counts the number of builds that matches the query

Parameters:
query -
Returns:

search

void search(org.apache.lucene.search.Query q,
            AbstractDocumentHitCollector collector)


Copyright © 2015 Atlassian Software Systems Pty Ltd. All rights reserved.