Class QueryServiceImpl
java.lang.Object
com.atlassian.greenhopper.service.query.QueryServiceImpl
- All Implemented Interfaces:
QueryService
-
Constructor Summary
ConstructorsConstructorDescriptionQueryServiceImpl(com.atlassian.jira.bc.issue.search.SearchService jiraSearchService, com.atlassian.jira.project.ProjectManager projectManager, com.atlassian.jira.issue.search.SearchRequestManager searchRequestManager, com.atlassian.jira.util.I18nHelper.BeanFactory i18nBeanFactory, RapidViewPermissionService rapidViewPermissionService, QueryToProjectMapper queryToProjectMapper) -
Method Summary
Modifier and TypeMethodDescriptionServiceOutcome<Set<com.atlassian.jira.project.Project>>getExplicitProjectsForRapidViewFilterQuery(com.atlassian.jira.user.ApplicationUser user, RapidView rapidView) Find all projects for a given rapid view filter query which are explicitly mentioned in the jql query.ServiceOutcome<Set<com.atlassian.jira.project.Project>>getProjectsForRapidViewFilterQuery(com.atlassian.jira.user.ApplicationUser user, RapidView rapidView) Find all projects for a given rapid view filter query.ServiceOutcome<Set<com.atlassian.jira.project.Project>>getProjectsForRapidViewFilterQuery(com.atlassian.jira.user.ApplicationUser user, com.atlassian.query.Query filterQuery) Find all projects for a given rapid view filter query.List<com.atlassian.jira.project.Project>getProjectsInProjectClauseOnlyQuery(com.atlassian.jira.user.ApplicationUser user, com.atlassian.query.Query projectBasedQuery) Return the projects which are included in this query.booleanisProjectClauseOnlyQuery(com.atlassian.query.Query query) Determine whether this query is "project based"; i.e.projectBelongsToRapidView(com.atlassian.jira.user.ApplicationUser user, RapidView rapidView, com.atlassian.jira.project.Project project) An optimized method to check if project is explicitly mentioned in rapidView's query.
-
Constructor Details
-
QueryServiceImpl
@Inject public QueryServiceImpl(com.atlassian.jira.bc.issue.search.SearchService jiraSearchService, com.atlassian.jira.project.ProjectManager projectManager, com.atlassian.jira.issue.search.SearchRequestManager searchRequestManager, com.atlassian.jira.util.I18nHelper.BeanFactory i18nBeanFactory, RapidViewPermissionService rapidViewPermissionService, QueryToProjectMapper queryToProjectMapper)
-
-
Method Details
-
isProjectClauseOnlyQuery
public boolean isProjectClauseOnlyQuery(@Nullable com.atlassian.query.Query query) Description copied from interface:QueryServiceDetermine whether this query is "project based"; i.e. whether this query only contains project clauses, possibly combined with the OR operator.- Specified by:
isProjectClauseOnlyQueryin interfaceQueryService- Parameters:
query- the query; may be null- Returns:
- the result
-
getProjectsInProjectClauseOnlyQuery
public List<com.atlassian.jira.project.Project> getProjectsInProjectClauseOnlyQuery(com.atlassian.jira.user.ApplicationUser user, @Nonnull com.atlassian.query.Query projectBasedQuery) Description copied from interface:QueryServiceReturn the projects which are included in this query. This does not execute a search - it instead usesQueryContextinformation.- Specified by:
getProjectsInProjectClauseOnlyQueryin interfaceQueryService- Parameters:
user- the user performing the queryprojectBasedQuery- the query; must not be null and must be a project-based query- Returns:
- the IDs
-
getProjectsForRapidViewFilterQuery
public ServiceOutcome<Set<com.atlassian.jira.project.Project>> getProjectsForRapidViewFilterQuery(com.atlassian.jira.user.ApplicationUser user, @Nonnull RapidView rapidView) Description copied from interface:QueryServiceFind all projects for a given rapid view filter query. This method extracts projects from the jql of the rapid view saved filter. It might return an empty set of projects if the query is global or not specific enough.- Specified by:
getProjectsForRapidViewFilterQueryin interfaceQueryService- Returns:
- a list of projects, empty if the filter is inconclusive
-
getProjectsForRapidViewFilterQuery
public ServiceOutcome<Set<com.atlassian.jira.project.Project>> getProjectsForRapidViewFilterQuery(com.atlassian.jira.user.ApplicationUser user, @Nonnull com.atlassian.query.Query filterQuery) Description copied from interface:QueryServiceFind all projects for a given rapid view filter query. This method extracts projects from the jql of the rapid view saved filter. It might return an empty set of projects if the query is global or not specific enough.- Specified by:
getProjectsForRapidViewFilterQueryin interfaceQueryService- Returns:
- a list of projects, empty if the filter is inconclusive
-
getExplicitProjectsForRapidViewFilterQuery
public ServiceOutcome<Set<com.atlassian.jira.project.Project>> getExplicitProjectsForRapidViewFilterQuery(com.atlassian.jira.user.ApplicationUser user, @Nonnull RapidView rapidView) Description copied from interface:QueryServiceFind all projects for a given rapid view filter query which are explicitly mentioned in the jql query. This method extracts projects from the jql of the rapid view saved filter. It might return an empty set of projects if the query is global or not specific enough.- Specified by:
getExplicitProjectsForRapidViewFilterQueryin interfaceQueryService- Returns:
- a list of projects, empty if the filter is inconclusive
-
projectBelongsToRapidView
public ServiceOutcome<Boolean> projectBelongsToRapidView(com.atlassian.jira.user.ApplicationUser user, @Nonnull RapidView rapidView, @Nonnull com.atlassian.jira.project.Project project) Description copied from interface:QueryServiceAn optimized method to check if project is explicitly mentioned in rapidView's query. This method will return an error, if there user can't see rapidView.- Specified by:
projectBelongsToRapidViewin interfaceQueryService- Returns:
- true if project is explicitly mentioned in rapidView's query.
-