@PublicApi public interface

SearchRequestService

com.atlassian.jira.bc.filter.SearchRequestService
Known Indirect Subclasses

@PublicApi

This interface is designed for plugins to consume (call its methods).

Clients of @PublicApi can expect that programs compiled against a given version will remain binary compatible with later versions of the @PublicApi as per each product's API policy as long as the client does not implement/extend @PublicApi interfaces or classes (refer to each product's API policy for the exact guarantee---usually binary compatibility is guaranteed at least across minor versions).

Note: since @PublicApi interfaces and classes are not designed to be implemented or extended by clients, we may perform certain types of binary-incompatible changes to these classes and interfaces, but these will not affect well-behaved clients that do not extend/implement these types (in general, only classes and interfaces annotated with @PublicSpi are safe to extend/implement).

Class Overview

Service exposing Search Request Management and retrieval.

Summary

Public Methods
SearchRequest createFilter(JiraServiceContext serviceCtx, SearchRequest request, boolean isFavourite)
Persists a SearchRequest to the database.
SearchRequest createFilter(JiraServiceContext serviceCtx, SearchRequest request)
Persists a SearchRequest to the database.
void deleteAllFiltersForUser(JiraServiceContext serviceCtx, ApplicationUser user)
Delete all filters for a given user
void deleteAllFiltersForUser(JiraServiceContext serviceCtx, User user)
This method is deprecated. Use deleteAllFiltersForUser(com.atlassian.jira.bc.JiraServiceContext, com.atlassian.jira.user.ApplicationUser) instead. Since v6.0. Delete all filters for a given user
void deleteFilter(JiraServiceContext serviceCtx, Long filterId)
Delete a given filter.
Collection<SearchRequest> getFavouriteFilters(ApplicationUser user)
Retrieve all filters a user has favourited.
Collection<SearchRequest> getFavouriteFilters(User user)
This method is deprecated. Use getFavouriteFilters(com.atlassian.jira.user.ApplicationUser) instead. Since v6.0. Retrieve all filters a user has favourited. Permission checks are done to ensure the user can see the filter, as visibility may have been removed from underneath them.
SearchRequest getFilter(JiraServiceContext serviceCtx, Long filterId)
Retrieve a given filter by id.
Collection<SearchRequest> getFiltersFavouritedByOthers(ApplicationUser user)
Get filters owned by a given user that have been favourited by at least one other user
Collection<SearchRequest> getFiltersFavouritedByOthers(User user)
This method is deprecated. Use getFiltersFavouritedByOthers(com.atlassian.jira.user.ApplicationUser) instead. Since v6.0. Get filters owned by a given user that have been favourited by at least one other user
Collection<SearchRequest> getNonPrivateFilters(ApplicationUser user)
Get a user's non private filters.
Collection<SearchRequest> getNonPrivateFilters(User user)
This method is deprecated. Use getNonPrivateFilters(com.atlassian.jira.user.ApplicationUser) instead. Since v6.0. Get a user's non private filters. I.e. filters that other users can possibly see.
Collection<SearchRequest> getOwnedFilters(ApplicationUser user)
Retrieve all filters a user owns/has created.
Collection<SearchRequest> getOwnedFilters(User user)
This method is deprecated. Use getOwnedFilters(com.atlassian.jira.user.ApplicationUser) instead. Since v6.0. Retrieve all filters a user owns/has created.
SharedEntitySearchResult<SearchRequest> search(JiraServiceContext serviceCtx, SharedEntitySearchParameters searchParameters, int pagePosition, int pageWidth)
Search for the SearchRequests that match the passed searchParameters.
SearchRequest updateFilter(JiraServiceContext serviceCtx, SearchRequest request)
Persists a SearchRequest to the database.
SearchRequest updateFilter(JiraServiceContext serviceCtx, SearchRequest request, boolean isFavourite)
Persists a SearchRequest to the database.
SearchRequest updateFilterOwner(JiraServiceContext serviceCtx, ApplicationUser user, SearchRequest request)
Persists a SearchRequest to the database - only available to administrators.
SearchRequest updateFilterOwner(JiraServiceContext serviceCtx, User user, SearchRequest request)
This method is deprecated. Use updateFilterOwner(com.atlassian.jira.bc.JiraServiceContext, com.atlassian.jira.user.ApplicationUser, com.atlassian.jira.issue.search.SearchRequest) instead. Since v6.0. Persists a SearchRequest to the database - only available to administrators.
SearchRequest updateSearchParameters(JiraServiceContext serviceCtx, SearchRequest request)
Persists changes to passed SearchRequest's search parameters and search sorts.
void validateFilterForChangeOwner(JiraServiceContext serviceCtx, SearchRequest request)
Validates that the proposed owner can take over the ownership of the filter
void validateFilterForCreate(JiraServiceContext serviceCtx, SearchRequest request)
Validates that a filter is in a correct state to be created.
void validateFilterForUpdate(JiraServiceContext serviceCtx, SearchRequest request)
Validates that a filter is in a correct state to be updated.
void validateForDelete(JiraServiceContext serviceCtx, Long filterId)
Validates that the filter can be deleted successfully.
void validateForSearch(JiraServiceContext serviceCtx, SharedEntitySearchParameters searchParameters)
This will validate that the input parameters are valid for a search that encompasses ANY share entity type.
boolean validateUpdateSearchParameters(JiraServiceContext serviceContext, SearchRequest request)
Validate that the passed SearchRequest's search parameters and search sorts can be persisted.

Public Methods

public SearchRequest createFilter (JiraServiceContext serviceCtx, SearchRequest request, boolean isFavourite)

Persists a SearchRequest to the database.

Parameters
serviceCtx Context containing user, error collection and i18n bean
request the request to save
isFavourite saves the SearchRequest as a favourite (or not)
Returns
  • returns the SearchRequest that was persisted to the database.

public SearchRequest createFilter (JiraServiceContext serviceCtx, SearchRequest request)

Persists a SearchRequest to the database.

Parameters
serviceCtx Context containing user, error collection and i18n bean
request the request to save
Returns
  • returns the SearchRequest that was persisted to the database.

public void deleteAllFiltersForUser (JiraServiceContext serviceCtx, ApplicationUser user)

Delete all filters for a given user

Parameters
serviceCtx JIRA Service context containing an error collection and user performing action
user The user to remove all filters for

public void deleteAllFiltersForUser (JiraServiceContext serviceCtx, User user)

This method is deprecated.
Use deleteAllFiltersForUser(com.atlassian.jira.bc.JiraServiceContext, com.atlassian.jira.user.ApplicationUser) instead. Since v6.0. Delete all filters for a given user

Parameters
serviceCtx JIRA Service context containing an error collection and user performing action
user The user to remove all filters for

public void deleteFilter (JiraServiceContext serviceCtx, Long filterId)

Delete a given filter.

Parameters
serviceCtx JIRA Service context containing an error collection and user performing action. User must be owner of filter, else error is passed back through the error collection.
filterId The id of the filter to delete. Id must not be null, else error is passed back through the error collection.

public Collection<SearchRequest> getFavouriteFilters (ApplicationUser user)

Retrieve all filters a user has favourited. Permission checks are done to ensure the user can see the filter, as visibility may have been removed from underneath them.

Parameters
user The user who has favourite filters. Also to test visibility and with
Returns
  • a Collection of SearchRequest objects that represent filters the user has favourited.

public Collection<SearchRequest> getFavouriteFilters (User user)

This method is deprecated.
Use getFavouriteFilters(com.atlassian.jira.user.ApplicationUser) instead. Since v6.0. Retrieve all filters a user has favourited. Permission checks are done to ensure the user can see the filter, as visibility may have been removed from underneath them.

Parameters
user The user who has favourite filters. Also to test visibility and with
Returns
  • a Collection of SearchRequest objects that represent filters the user has favourited.

public SearchRequest getFilter (JiraServiceContext serviceCtx, Long filterId)

Retrieve a given filter by id.

Parameters
serviceCtx JIRA Service context containing an error collection and user requesting (to run) the filter. The filter must exist and the user must be able to see filter else an error will result.
filterId The id of the filter to retrieve. Id must not be null.
Returns
  • The Filter as specified by the id, or null if none exists for the user.

public Collection<SearchRequest> getFiltersFavouritedByOthers (ApplicationUser user)

Get filters owned by a given user that have been favourited by at least one other user

Parameters
user The author of the filters
Returns
  • Collection of SearchRequest objects owned by the given user and favourited by at least one other user

public Collection<SearchRequest> getFiltersFavouritedByOthers (User user)

This method is deprecated.
Use getFiltersFavouritedByOthers(com.atlassian.jira.user.ApplicationUser) instead. Since v6.0. Get filters owned by a given user that have been favourited by at least one other user

Parameters
user The author of the filters
Returns
  • Collection of SearchRequest objects owned by the given user and favourited by at least one other user

public Collection<SearchRequest> getNonPrivateFilters (ApplicationUser user)

Get a user's non private filters. I.e. filters that other users can possibly see.

Parameters
user The author of the filters
Returns
  • Collection of SearchRequest objects that do not have private scope.

public Collection<SearchRequest> getNonPrivateFilters (User user)

This method is deprecated.
Use getNonPrivateFilters(com.atlassian.jira.user.ApplicationUser) instead. Since v6.0. Get a user's non private filters. I.e. filters that other users can possibly see.

Parameters
user The author of the filters
Returns
  • Collection of SearchRequest objects that do not have private scope.

public Collection<SearchRequest> getOwnedFilters (ApplicationUser user)

Retrieve all filters a user owns/has created.

Parameters
user The user who created the filters.
Returns
  • a Collection of SearchRequest objects that represent filters the user has created.

public Collection<SearchRequest> getOwnedFilters (User user)

This method is deprecated.
Use getOwnedFilters(com.atlassian.jira.user.ApplicationUser) instead. Since v6.0. Retrieve all filters a user owns/has created.

Parameters
user The user who created the filters.
Returns
  • a Collection of SearchRequest objects that represent filters the user has created.

public SharedEntitySearchResult<SearchRequest> search (JiraServiceContext serviceCtx, SharedEntitySearchParameters searchParameters, int pagePosition, int pageWidth)

Search for the SearchRequests that match the passed searchParameters. The result can be paged so that a subset of the results can be returned.

Parameters
serviceCtx Context containing user, error collection and i18n bean
searchParameters the searchParameters to query.
pagePosition the page to return.
pageWidth the number of results per page.
Returns
  • the result of the search.

public SearchRequest updateFilter (JiraServiceContext serviceCtx, SearchRequest request)

Persists a SearchRequest to the database.

Parameters
serviceCtx Context containing user, error collection and i18n bean
request the request to update
Returns
  • returns the SearchRequest that was persisted to the database.

public SearchRequest updateFilter (JiraServiceContext serviceCtx, SearchRequest request, boolean isFavourite)

Persists a SearchRequest to the database.

Parameters
serviceCtx Context containing user, error collection and i18n bean
request the request to update
isFavourite saves the SearchRequest as a favourite (or not)
Returns
  • returns the SearchRequest that was persisted to the database.

public SearchRequest updateFilterOwner (JiraServiceContext serviceCtx, ApplicationUser user, SearchRequest request)

Persists a SearchRequest to the database - only available to administrators.

Parameters
serviceCtx Context containing the new owner, error collection and i18n bean
user the user requesting the update, must have Permissions.ADMINISTER permissions
request the request to update
Returns
  • returns the SearchRequest that was persisted to the database .

public SearchRequest updateFilterOwner (JiraServiceContext serviceCtx, User user, SearchRequest request)

This method is deprecated.
Use updateFilterOwner(com.atlassian.jira.bc.JiraServiceContext, com.atlassian.jira.user.ApplicationUser, com.atlassian.jira.issue.search.SearchRequest) instead. Since v6.0. Persists a SearchRequest to the database - only available to administrators.

Parameters
serviceCtx Context containing the new owner, error collection and i18n bean
user the user requesting the update, must have Permissions.ADMINISTER permissions
request the request to update
Returns
  • returns the SearchRequest that was persisted to the database .

public SearchRequest updateSearchParameters (JiraServiceContext serviceCtx, SearchRequest request)

Persists changes to passed SearchRequest's search parameters and search sorts. Changes to the SearchRequest's other fields (name, description, share permissions, ...) are not saved. Any errors will be reported in the passed context. This method does not check the validity of the SearchRequest's share permissions when saving. This is to allow JIRA to save search parameter changes even when the SearchRequest's permissions are invalid.

Parameters
serviceCtx Context containing user, error collection and i18n bean
request the request to update.
Returns
  • returns the SearchRequest that was persisted to the database. May return null if an error occurs. The passed service context will have details of any errors.

public void validateFilterForChangeOwner (JiraServiceContext serviceCtx, SearchRequest request)

Validates that the proposed owner can take over the ownership of the filter

Parameters
serviceCtx containing proposed owner
request the SearchRequest that you want to change ownership of

public void validateFilterForCreate (JiraServiceContext serviceCtx, SearchRequest request)

Validates that a filter is in a correct state to be created.

Parameters
serviceCtx Context containing user, error collection and i18n bean
request the SearchRequest to validate

public void validateFilterForUpdate (JiraServiceContext serviceCtx, SearchRequest request)

Validates that a filter is in a correct state to be updated.

Parameters
serviceCtx Context containing user, error collection and i18n bean
request the SearchRequest to validate

public void validateForDelete (JiraServiceContext serviceCtx, Long filterId)

Validates that the filter can be deleted successfully.

Parameters
serviceCtx context of the calling user.
filterId the filter to delete.

public void validateForSearch (JiraServiceContext serviceCtx, SharedEntitySearchParameters searchParameters)

This will validate that the input parameters are valid for a search that encompasses ANY share entity type.

Parameters
serviceCtx Context containing user, error collection and i18n bean
searchParameters the SharedEntitySearchParameters to validate

public boolean validateUpdateSearchParameters (JiraServiceContext serviceContext, SearchRequest request)

Validate that the passed SearchRequest's search parameters and search sorts can be persisted. This method does *not* check the validity of the name, description, share permissions or any other fields in the SearchRequest. Any errors will be reported in the passed context.

Parameters
serviceContext Context containing user, error collection and i18n bean
request the request to validate.
Returns
  • true iff the passed request's parameters can be saved.