com.atlassian.jira.sharing.type
Interface ShareQueryFactory<S extends ShareTypeSearchParameter>

All Known Implementing Classes:
GlobalShareQueryFactory, GroupShareQueryFactory, PrivateShareQueryFactory, ProjectShareQueryFactory

public interface ShareQueryFactory<S extends ShareTypeSearchParameter>

Create the indexed field and then query terms to find entities that have permissions related to a particular ShareType.

Since:
v3.13

Method Summary
 org.apache.lucene.document.Field getField(SharedEntity entity, SharePermission permission)
          Get the Field we will later search for.
 org.apache.lucene.search.Query getQuery(ShareTypeSearchParameter parameter)
          Get the search query for all shares shares that match the passed parameter.
 org.apache.lucene.search.Query getQuery(ShareTypeSearchParameter parameter, com.opensymphony.user.User user)
          Get the search query for the shares that can be seen by the passed user for the passed parameter.
 org.apache.lucene.index.Term[] getTerms(com.opensymphony.user.User user)
          Get the search terms for the shares that can be seen by the passed user.
 

Method Detail

getQuery

org.apache.lucene.search.Query getQuery(ShareTypeSearchParameter parameter,
                                        com.opensymphony.user.User user)
Get the search query for the shares that can be seen by the passed user for the passed parameter. Used when the user has specified something to search for.

Parameters:
parameter - the parameters for the search.
user - the user to perform the search on behalf of.
Returns:
an array of Terms. It may be empty but never null.

getQuery

org.apache.lucene.search.Query getQuery(ShareTypeSearchParameter parameter)
Get the search query for all shares shares that match the passed parameter. Used by the system to match all entities that match the parameter, for instance when deleting Group, Project or Role.

Parameters:
parameter - the parameters for the search.
Returns:
an array of Terms. It may be empty but never null.

getTerms

org.apache.lucene.index.Term[] getTerms(com.opensymphony.user.User user)
Get the search terms for the shares that can be seen by the passed user.

Parameters:
user - the user to perform the search on behalf of.
Returns:
an array of Terms. It may be empty but never null.

getField

org.apache.lucene.document.Field getField(SharedEntity entity,
                                          SharePermission permission)
Get the Field we will later search for.

Parameters:
permission -
Returns:
the field so we can add it to the index


Copyright © 2002-2010 Atlassian. All Rights Reserved.