Package com.atlassian.jira.issue.search
Class DefaultSearchRequestManager
java.lang.Object
com.atlassian.jira.issue.search.DefaultSearchRequestManager
- All Implemented Interfaces:
SearchRequestManager,SharedEntityAccessor<SearchRequest>
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.atlassian.jira.sharing.SharedEntityAccessor
SharedEntityAccessor.Factory, SharedEntityAccessor.RetrievalDescriptor -
Constructor Summary
ConstructorsConstructorDescriptionDefaultSearchRequestManager(ColumnLayoutManager columnLayoutManager, SubscriptionManager subscriptionManager, ShareManager shareManager, SearchRequestStore searchRequestStore, SharedEntityIndexer indexer, SearchService searchService, com.atlassian.event.api.EventPublisher eventPublisher, FeatureManager featureManager, GlobalPermissionManager globalPermissionManager) -
Method Summary
Modifier and TypeMethodDescriptionvoidadjustFavouriteCount(SharedEntity entity, int adjustmentValue) Adjusts the favourite counts for a given entity.create(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 detailsvoidRemoves the SearchRequest GenericValue from the database based on its idfindByNameIgnoreCase(String name) get(SharedEntityAccessor.RetrievalDescriptor descriptor) Used to getsharable entitiesfrom a search result.get(ApplicationUser user, SharedEntityAccessor.RetrievalDescriptor descriptor) Used to getsharable entitiesfrom a search result.getAll()Get all SearchRequests.Get allsharable entitiesthis accessor can see for use in indexing.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.getSearchRequests(ApplicationUser user, SharedEntityAccessor.RetrievalDescriptor descriptor) Used to getsharable entitiesfrom a search result filtered to only those that are shared with the searcher.getSharedEntity(ApplicationUser user, Long entityId) This is called to getSharedEntityby id If the user is allows to see itgetSharedEntity(Long entityId) This will call back to ask for aSharedEntitybased on id.getType()Returns the type that this object can work with.booleanhasPermissionToUse(ApplicationUser user, SearchRequest entity) Returns true if the user has permission to use theSharedEntitybooleanhasShareRights(ApplicationUser user, SearchRequest searchRequest, ShareRight shareRights) 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 requestToPersist) Updates an existing search request in the database.update(ApplicationUser editor, SearchRequest requestToPersist) Updates an existing search request in the database.voidvisitAll(Visitor<SearchRequestEntity> visitor) Iterates over all SearchRequests using a Visitor pattern callback.
-
Constructor Details
-
Method Details
-
getAll
Description copied from interface:SearchRequestManagerGet all SearchRequests.WARNING: This method will run horribly slow on systems with a lot of saved filters.
- Specified by:
getAllin interfaceSearchRequestManager- Specified by:
getAllin interfaceSharedEntityAccessor<SearchRequest>- Returns:
- an
EnclosedIterableof SearchRequests
-
visitAll
Description copied from interface:SearchRequestManagerIterates over all SearchRequests using a Visitor pattern callback.- Specified by:
visitAllin interfaceSearchRequestManager
-
getAllOwnedSearchRequests
Description copied from interface:SearchRequestManagerRetrieves a collection of SearchRequest objects that a user created.- Specified by:
getAllOwnedSearchRequestsin interfaceSearchRequestManager- Parameters:
user- The user who created the SearchRequests- Returns:
- Collection of all
SearchRequestthat user created.
-
getOwnedSearchRequestByName
Description copied from interface:SearchRequestManagerFind a search request given the author and the request name.- Specified by:
getOwnedSearchRequestByNamein interfaceSearchRequestManager- Parameters:
author- The author of the SearchRequestname- The name of the SearchRequest- Returns:
- The SearchRequest, or null if there is no matching request
-
getSearchRequestById
Description copied from interface:SearchRequestManagerReturn the search request as stored in the database if the user has permission to see it.- Specified by:
getSearchRequestByIdin interfaceSearchRequestManager- 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
Description copied from interface:SearchRequestManagerReturn the search request as stored in the database without any permission checks.- Specified by:
getSearchRequestByIdin interfaceSearchRequestManager- Parameters:
id- The id of the filter- Returns:
- The SearchRequest, or null if the request id does not exist
-
findByNameIgnoreCase
- Specified by:
findByNameIgnoreCasein interfaceSearchRequestManager
-
getSearchRequestOwnerUserName
- Specified by:
getSearchRequestOwnerUserNamein interfaceSearchRequestManager- 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
- Specified by:
getSearchRequestOwnerin interfaceSearchRequestManager
-
create
Description copied from interface:SearchRequestManagerTakes 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- Specified by:
createin interfaceSearchRequestManager- Parameters:
request- SearchResult that should be persisted- Returns:
- SearchRequest object that was persisted to the database
-
update
Description copied from interface:SearchRequestManagerUpdates an existing search request in the database.- Specified by:
updatein interfaceSearchRequestManager- Parameters:
requestToPersist- the request to persist- Returns:
- A
SearchRequestthat was persisted to the database and by default sanitized for the owner of the request. To change the default behaviour useSearchRequestManager.update(ApplicationUser, SearchRequest)instead
-
update
Description copied from interface:SearchRequestManagerUpdates an existing search request in the database.- Specified by:
updatein interfaceSearchRequestManager- Parameters:
editor- application user which updates the search requestrequestToPersist- the request to persist- Returns:
- A
SearchRequestthat was persisted to the database and sanitized for the editor
-
delete
Description copied from interface:SearchRequestManagerRemoves the SearchRequest GenericValue from the database based on its id- Specified by:
deletein interfaceSearchRequestManager- Parameters:
id- of the search request to be removed from storage
-
getType
Description copied from interface:SharedEntityAccessorReturns the type that this object can work with.- Specified by:
getTypein interfaceSharedEntityAccessor<SearchRequest>- Returns:
- the type that this object can work with.
-
hasPermissionToUse
Description copied from interface:SharedEntityAccessorReturns true if the user has permission to use theSharedEntity- Specified by:
hasPermissionToUsein interfaceSharedEntityAccessor<SearchRequest>- Parameters:
user- the user in playentity- theSharedEntityto check- Returns:
- true if the user has permission to use it