com.atlassian.bamboo.resultsummary.search
Class IndexedBuildResultsSearcherImpl

java.lang.Object
  extended by com.atlassian.bamboo.resultsummary.search.IndexedBuildResultsSearcherImpl
All Implemented Interfaces:
IndexedBuildResultsSearcher

public class IndexedBuildResultsSearcherImpl
extends Object
implements IndexedBuildResultsSearcher


Constructor Summary
IndexedBuildResultsSearcherImpl()
           
IndexedBuildResultsSearcherImpl(com.google.common.base.Supplier<LucenePermissionChecker.PermissionChecker> permissionChecker)
           
 
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
 BuildResultsSummaryDocumentFactory getBuildResultsSummaryDocumentFactory()
           
 List<ResultsSummary> search(Map<String,String[]> params)
           
 void search(org.apache.lucene.search.Query query, AbstractDocumentHitCollector collector)
           
 PartialList<ResultsSummary> search(org.apache.lucene.search.Query query, int maxResults)
          Returns a list of ResultsSummary that matches the query up to maxResults
<T> PartialList<T>
search(org.apache.lucene.search.Query query, 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.
 void setBuildResultsSummaryDocumentFactory(BuildResultsSummaryDocumentFactory buildResultsSummaryDocumentFactory)
           
 void setCachedPlanManager(CachedPlanManager cachedPlanManager)
           
 void setLuceneConnection(com.atlassian.bonnie.ILuceneConnection luceneConnection)
           
 void setPlanManager(PlanManager planManager)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexedBuildResultsSearcherImpl

public IndexedBuildResultsSearcherImpl()

IndexedBuildResultsSearcherImpl

public IndexedBuildResultsSearcherImpl(com.google.common.base.Supplier<LucenePermissionChecker.PermissionChecker> permissionChecker)
Method Detail

findLatestRelevantBuildResult

@Nullable
public ResultsSummary findLatestRelevantBuildResult(@NotNull
                                                             PlanIdentifier plan,
                                                             @NotNull
                                                             Long beforeLastCompletedTimestamp)
Description copied from interface: IndexedBuildResultsSearcher
Find the last finished build of a plan that completed before given time

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

findBuildResultDataByJiraIssueKey

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

Specified by:
findBuildResultDataByJiraIssueKey in interface IndexedBuildResultsSearcher
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
public org.apache.lucene.document.Document findBuildResultByNumberAndKey(@NotNull
                                                                                  PlanKey planKey,
                                                                                  int buildNumber)
Description copied from interface: IndexedBuildResultsSearcher
Find document identified by plan key and build result. Search is made across ALL ResultsSummary documents (including incomplete).

Specified by:
findBuildResultByNumberAndKey in interface IndexedBuildResultsSearcher
Parameters:
planKey - Plan key
buildNumber - build number
Returns:
Document or null if not foud

search

public List<ResultsSummary> search(Map<String,String[]> params)
Specified by:
search in interface IndexedBuildResultsSearcher

search

@NotNull
public PartialList<ResultsSummary> search(@NotNull
                                                  org.apache.lucene.search.Query query,
                                                  int maxResults)
Description copied from interface: IndexedBuildResultsSearcher
Returns a list of ResultsSummary that matches the query up to maxResults

Specified by:
search in interface IndexedBuildResultsSearcher
Returns:

search

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

Specified by:
search in interface IndexedBuildResultsSearcher
Returns:

count

public int count(@NotNull
                 org.apache.lucene.search.Query query)
Description copied from interface: IndexedBuildResultsSearcher
Counts the number of builds that matches the query

Specified by:
count in interface IndexedBuildResultsSearcher
Returns:

search

public void search(org.apache.lucene.search.Query query,
                   AbstractDocumentHitCollector collector)
Specified by:
search in interface IndexedBuildResultsSearcher

setLuceneConnection

public void setLuceneConnection(com.atlassian.bonnie.ILuceneConnection luceneConnection)

getBuildResultsSummaryDocumentFactory

public BuildResultsSummaryDocumentFactory getBuildResultsSummaryDocumentFactory()

setBuildResultsSummaryDocumentFactory

public void setBuildResultsSummaryDocumentFactory(BuildResultsSummaryDocumentFactory buildResultsSummaryDocumentFactory)

setPlanManager

public void setPlanManager(PlanManager planManager)

setCachedPlanManager

public void setCachedPlanManager(CachedPlanManager cachedPlanManager)


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