public class

DefaultSearchRequestManager

extends Object
implements SearchRequestManager
java.lang.Object
   ↳ com.atlassian.jira.issue.search.DefaultSearchRequestManager

Summary

Public Constructors
DefaultSearchRequestManager(ColumnLayoutManager columnLayoutManager, SubscriptionManager subscriptionManager, ShareManager shareManager, SearchRequestStore searchRequestStore, SharedEntityIndexer indexer, SearchService searchService, UserUtil userUtil)
Public Methods
void adjustFavouriteCount(SharedEntity entity, int adjustmentValue)
Adjusts the favourite counts for a given entity.
SearchRequest 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 details
void delete(Long id)
Removes the SearchRequest GenericValue from the database based on its id
List<SearchRequest> findByNameIgnoreCase(String name)
EnclosedIterable<SearchRequest> get(User user, SharedEntityAccessor.RetrievalDescriptor descriptor)
Used to get sharable entities from a search result.
EnclosedIterable<SearchRequest> get(SharedEntityAccessor.RetrievalDescriptor descriptor)
Used to get sharable entities from a search result.
EnclosedIterable<SearchRequest> getAll()
Get all SearchRequests.
EnclosedIterable<SharedEntity> getAllIndexableSharedEntities()
Get all sharable entities this accessor can see for use in indexing.
Collection<SearchRequest> getAllOwnedSearchRequests(ApplicationUser user)
Retrieves a collection of SearchRequest objects that a user created.
Collection<SearchRequest> getAllOwnedSearchRequests(User user)
SearchRequest getOwnedSearchRequestByName(ApplicationUser author, String name)
Find a search request given the author and the request name.
SearchRequest getOwnedSearchRequestByName(User author, String name)
SearchRequest getSearchRequestById(Long id)
Return the search request as stored in the database without any permission checks.
SearchRequest getSearchRequestById(ApplicationUser user, Long id)
Return the search request as stored in the database if the user has permission to see it.
SearchRequest getSearchRequestById(User user, Long id)
ApplicationUser getSearchRequestOwner(Long id)
String getSearchRequestOwnerUserName(Long id)
SearchRequest getSharedEntity(Long entityId)
This will call back to ask for a SharedEntity based on id.
SearchRequest getSharedEntity(User user, Long entityId)
This is called to get SharedEntity by id If the user is allows to see it
TypeDescriptor<SearchRequest> getType()
Returns the type that this object can work with.
boolean hasPermissionToUse(User user, SearchRequest entity)
SharedEntitySearchResult<SearchRequest> search(SharedEntitySearchParameters searchParameters, User user, int pagePosition, int pageWidth)
SharedEntitySearchResult<SearchRequest> search(SharedEntitySearchParameters searchParameters, ApplicationUser user, int pagePosition, int pageWidth)
Search for the SearchRequests that match the passed searchParameters.
SearchRequest update(SearchRequest request)
Updates an existing search request in the database.
void visitAll(Visitor<SearchRequestEntity> visitor)
Iterates over all SearchRequests using a Visitor pattern callback.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.issue.search.SearchRequestManager
From interface com.atlassian.jira.sharing.SharedEntityAccessor

Public Constructors

public DefaultSearchRequestManager (ColumnLayoutManager columnLayoutManager, SubscriptionManager subscriptionManager, ShareManager shareManager, SearchRequestStore searchRequestStore, SharedEntityIndexer indexer, SearchService searchService, UserUtil userUtil)

Public Methods

public void adjustFavouriteCount (SharedEntity entity, int adjustmentValue)

Adjusts the favourite counts for a given entity. This resulting value must always be greater or equal to one.

Parameters
entity the entity to adjust
adjustmentValue the value to adjust by.

public SearchRequest 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 details

Parameters
request SearchResult that should be persisted
Returns
  • SearchRequest object that was persisted to the database

public void delete (Long id)

Removes the SearchRequest GenericValue from the database based on its id

Parameters
id of the search request to be removed from storage

public List<SearchRequest> findByNameIgnoreCase (String name)

public EnclosedIterable<SearchRequest> get (User user, SharedEntityAccessor.RetrievalDescriptor descriptor)

Used to get sharable entities from a search result. The entities returned may be modified by the user parameter (e.g. permissions or clause sanitisation).

Parameters
user the user performing the search
descriptor retrieval descriptor

public EnclosedIterable<SearchRequest> get (SharedEntityAccessor.RetrievalDescriptor descriptor)

Used to get sharable entities from a search result.

Parameters
descriptor retrieval descriptor

public EnclosedIterable<SearchRequest> getAll ()

Get all SearchRequests. WARNING: This method will run horribly slow on systems with a lot of saved filters.

Returns

public EnclosedIterable<SharedEntity> getAllIndexableSharedEntities ()

Get all sharable entities this accessor can see for use in indexing.

public Collection<SearchRequest> getAllOwnedSearchRequests (ApplicationUser user)

Retrieves a collection of SearchRequest objects that a user created.

Parameters
user The user who created the SearchRequests
Returns

public Collection<SearchRequest> getAllOwnedSearchRequests (User user)

public SearchRequest getOwnedSearchRequestByName (ApplicationUser author, String name)

Find a search request given the author and the request name.

Parameters
author The author of the SearchRequest
name The name of the SearchRequest
Returns
  • The SearchRequest, or null if there is no matching request

public SearchRequest getOwnedSearchRequestByName (User author, String name)

public SearchRequest getSearchRequestById (Long id)

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

public SearchRequest getSearchRequestById (ApplicationUser user, Long id)

Return the search request as stored in the database if the user has permission to see it.

Parameters
user The user to check shares with
id The id of the filter
Returns
  • The SearchRequest, or null if the request id does not exist

public SearchRequest getSearchRequestById (User user, Long id)

public ApplicationUser getSearchRequestOwner (Long id)

public String getSearchRequestOwnerUserName (Long id)

public SearchRequest getSharedEntity (Long entityId)

This will call back to ask for a SharedEntity based on id.

Parameters
entityId the id of the SharedEntity
Returns

public SearchRequest getSharedEntity (User user, Long entityId)

This is called to get SharedEntity by id If the user is allows to see it

Parameters
user the user in play
entityId the id of the SharedEntity
Returns
  • a SharedEntity if it exists and the user can see it and null otherwise

public TypeDescriptor<SearchRequest> getType ()

Returns the type that this object can work with.

Returns
  • the type that this object can work with.

public boolean hasPermissionToUse (User user, SearchRequest entity)

public SharedEntitySearchResult<SearchRequest> search (SharedEntitySearchParameters searchParameters, User user, int pagePosition, int pageWidth)

public SharedEntitySearchResult<SearchRequest> search (SharedEntitySearchParameters searchParameters, ApplicationUser user, 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
searchParameters the searchParameters to query.
user the user performing the search.
pagePosition the page to return.
pageWidth the number of results per page.
Returns
  • the result of the search.

public SearchRequest update (SearchRequest request)

Updates an existing search request in the database.

Parameters
request the request to persist
Returns

public void visitAll (Visitor<SearchRequestEntity> visitor)

Iterates over all SearchRequests using a Visitor pattern callback.