Package com.atlassian.jira.issue.search
Interface SearchRequestManager
- All Superinterfaces:
SharedEntityAccessor<SearchRequest>
- All Known Implementing Classes:
DefaultSearchRequestManager
This manager is responsible for
SearchRequest
s. SearchRequests encapsulate all information used for searches in the issue navigator.-
Nested Class Summary
Nested classes/interfaces inherited from interface com.atlassian.jira.sharing.SharedEntityAccessor
SharedEntityAccessor.Factory, SharedEntityAccessor.RetrievalDescriptor
-
Method Summary
Modifier and TypeMethodDescriptioncreate
(SearchRequest request) Takes a SearchRequest, user, name of search request and description and persists the XML representation of the SearchRequest object to the database along with the rest of the detailsvoid
Removes the SearchRequest GenericValue from the database based on its idfindByNameIgnoreCase
(String name) getAll()
Deprecated.Retrieves a collection of SearchRequest objects that a user created.getOwnedSearchRequestByName
(ApplicationUser author, String name) Find a search request given the author and the request name.getSearchRequestById
(ApplicationUser user, Long id) Return the search request as stored in the database if the user has permission to see it.Return the search request as stored in the database without any permission checks.Deprecated.UsegetSearchRequestOwner(Long id)
instead.getSearchRequests
(ApplicationUser searcher, SharedEntityAccessor.RetrievalDescriptor descriptor) Used to getsharable entities
from a search result filtered to only those that are shared with the searcher.boolean
hasShareRights
(ApplicationUser user, SearchRequest searchRequest, ShareRight shareRight) Checks if provided user has share rights for given search request.search
(SharedEntitySearchParameters searchParameters, ApplicationUser user, int pagePosition, int pageWidth) Search for the SearchRequests that match the passed searchParameters.update
(SearchRequest request) Deprecated.useupdate(ApplicationUser, SearchRequest)
insteadupdate
(ApplicationUser editor, SearchRequest request) Updates an existing search request in the database.void
visitAll
(Visitor<SearchRequestEntity> visitor) Iterates over all SearchRequests using a Visitor pattern callback.Methods inherited from interface com.atlassian.jira.sharing.SharedEntityAccessor
adjustFavouriteCount, get, get, getAllIndexableSharedEntities, getSharedEntity, getSharedEntity, getType, hasPermissionToUse
-
Method Details
-
getAllOwnedSearchRequests
Retrieves a collection of SearchRequest objects that a user created.- Parameters:
user
- The user who created the SearchRequests- Returns:
- Collection of all
SearchRequest
that user created.
-
getOwnedSearchRequestByName
Find a search request given the author and the request name.- Parameters:
author
- The author of the SearchRequestname
- The name of the SearchRequest- Returns:
- The SearchRequest, or null if there is no matching request
-
getSearchRequestById
Return the search request as stored in the database if the user has permission to see it.- Parameters:
user
- The user to check shares withid
- The id of the filter- Returns:
- The SearchRequest, or null if the request id does not exist
- See Also:
-
getSearchRequestById
Return the search request as stored in the database without any permission checks.- Parameters:
id
- The id of the filter- Returns:
- The SearchRequest, or null if the request id does not exist
-
getAll
EnclosedIterable<SearchRequest> getAll()Deprecated.UsevisitAll(Visitor)
instead. Since v5.2.Get all SearchRequests.WARNING: This method will run horribly slow on systems with a lot of saved filters.
- Specified by:
getAll
in interfaceSharedEntityAccessor<SearchRequest>
- Returns:
- an
EnclosedIterable
of SearchRequests
-
visitAll
Iterates over all SearchRequests using a Visitor pattern callback. -
findByNameIgnoreCase
-
getSearchRequestOwnerUserName
Deprecated.UsegetSearchRequestOwner(Long id)
instead. Since v6.0.Return the owner of the passed SearchRequest. This is mainly used for permission checks.
- Parameters:
id
- the identifier of the SearchRequest.- Returns:
- the username of the owner of the SearchRequest. Null is returned if the SearchRequest does not exist.
-
getSearchRequestOwner
-
create
Takes a SearchRequest, user, name of search request and description and persists the XML representation of the SearchRequest object to the database along with the rest of the details- Parameters:
request
- SearchResult that should be persisted- Returns:
- SearchRequest object that was persisted to the database
-
update
Deprecated.useupdate(ApplicationUser, SearchRequest)
insteadUpdates an existing search request in the database.- Parameters:
request
- the request to persist- Returns:
- A
SearchRequest
that was persisted to the database and by default sanitized for the owner of the request. To change the default behaviour useupdate(ApplicationUser, SearchRequest)
instead
-
update
Updates an existing search request in the database.- Parameters:
editor
- application user which updates the search requestrequest
- the request to persist- Returns:
- A
SearchRequest
that was persisted to the database and sanitized for the editor - Since:
- v7.12
-
delete
Removes the SearchRequest GenericValue from the database based on its id- Parameters:
id
- of the search request to be removed from storage
visitAll(Visitor)
instead.