public class

DefaultSearchRequestManager

extends Object
implements FeatureFlagProvider 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, FeatureManager featureManager, InstrumentationListenerManager instrumentationListenerManager, InstrumentationLogger instrumentationLogger)
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(ApplicationUser 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.
Set<FeatureFlag> getFeatureFlags()
SearchRequest getOwnedSearchRequestByName(ApplicationUser author, String name)
Find a search request given the author and the request name.
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(Long id)
Return the search request as stored in the database without any permission checks.
ApplicationUser getSearchRequestOwner(Long id)
String getSearchRequestOwnerUserName(Long id)
EnclosedIterable<SearchRequest> getSearchRequests(ApplicationUser user, SharedEntityAccessor.RetrievalDescriptor descriptor)
Used to get sharable entities from a search result filtered to only those that are shared with the searcher.
SearchRequest getSharedEntity(ApplicationUser user, Long entityId)
This is called to get SharedEntity by id If the user is allows to see it
SearchRequest getSharedEntity(Long entityId)
This will call back to ask for a SharedEntity based on id.
TypeDescriptor<SearchRequest> getType()
Returns the type that this object can work with.
boolean hasPermissionToUse(ApplicationUser user, SearchRequest entity)
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.config.FeatureFlagProvider
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, FeatureManager featureManager, InstrumentationListenerManager instrumentationListenerManager, InstrumentationLogger instrumentationLogger)

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 (ApplicationUser 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 Set<FeatureFlag> getFeatureFlags ()

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 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 (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 ApplicationUser getSearchRequestOwner (Long id)

public String getSearchRequestOwnerUserName (Long id)

public EnclosedIterable<SearchRequest> getSearchRequests (ApplicationUser user, SharedEntityAccessor.RetrievalDescriptor descriptor)

Used to get sharable entities from a search result filtered to only those that are shared with the searcher. 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 SearchRequest getSharedEntity (ApplicationUser 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 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 TypeDescriptor<SearchRequest> getType ()

Returns the type that this object can work with.

Returns
  • the type that this object can work with.

public boolean hasPermissionToUse (ApplicationUser user, SearchRequest entity)

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.