public class

CachingSearchRequestStore

extends Object
implements SearchRequestStore
java.lang.Object
   ↳ com.atlassian.jira.issue.search.CachingSearchRequestStore

Class Overview

Caching store for SearchRequest.

Summary

Public Constructors
CachingSearchRequestStore(SearchRequestStore delegateStore, CacheManager cacheManager)
Public Methods
SearchRequest adjustFavouriteCount(Long searchRequestId, int incrementValue)
Updates the favourite count of the SearchRequest in the database.
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 searchId)
Removes the SearchRequest GenericValue from the database based on its id
@Nonnull List<SearchRequest> findByNameIgnoreCase(String name)
Find search requests matching the given name.
EnclosedIterable<SearchRequest> get(SharedEntityAccessor.RetrievalDescriptor descriptor)
Get a EnclosedIterable of SearchRequests for the specified List of ids.
EnclosedIterable<SearchRequest> getAll()
Get a EnclosedIterable of all SearchRequests in the database.
EnclosedIterable<IndexableSharedEntity<SearchRequest>> getAllIndexableSharedEntities()
Get a EnclosedIterable of all IndexableSharedEntities representing SearchRequests in the database.
Collection<SearchRequest> getAllOwnedSearchRequests(ApplicationUser owner)
Retrieves a collection of SearchRequest objects that a user created.
Collection<SearchRequest> getAllOwnedSearchRequests(String userKey)
Retrieves a collection of SearchRequest objects that a user created.
SearchRequest getRequestByAuthorAndName(ApplicationUser author, String name)
Find a search request given the author and the request name.
SearchRequest getSearchRequest(Long searchRequestId)
Return the search request as stored in the database
EnclosedIterable<SearchRequest> getSearchRequests(Group group)
Get all search requests associated with a given Group.
EnclosedIterable<SearchRequest> getSearchRequests(Project project)
Get all search requests associate with a given Project.
@EventListener void onClearCache(ClearCacheEvent event)
SearchRequest update(SearchRequest request)
Updates an existing search request in the database.
void visitAll(Visitor<SearchRequestEntity> visitor)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.issue.search.SearchRequestStore

Public Constructors

public CachingSearchRequestStore (SearchRequestStore delegateStore, CacheManager cacheManager)

Public Methods

public SearchRequest adjustFavouriteCount (Long searchRequestId, int incrementValue)

Updates the favourite count of the SearchRequest in the database.

Parameters
searchRequestId the identifier of the search request to decrease.
incrementValue the value to increase the favourite count by. Can be a number < 0 to decrease the favourite count.
Returns

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 searchId)

Removes the SearchRequest GenericValue from the database based on its id

Parameters
searchId of the search request to be removed from storage

@Nonnull public List<SearchRequest> findByNameIgnoreCase (String name)

Find search requests matching the given name.

Parameters
name Name of the SearchRequest
Returns
  • List of all search requests matching the given name. Never null.

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

Get a EnclosedIterable of SearchRequests for the specified List of ids.

Parameters
descriptor retrieval descriptor
Returns
  • CloseableIterable that contains reference to SearchRequests with the specified ids.

public EnclosedIterable<SearchRequest> getAll ()

Get a EnclosedIterable of all SearchRequests in the database.

Returns
  • CloseableIterable that contains reference to all SearchRequests.

public EnclosedIterable<IndexableSharedEntity<SearchRequest>> getAllIndexableSharedEntities ()

Get a EnclosedIterable of all IndexableSharedEntities representing SearchRequests in the database. Note: this is used so that we can retrieve all the meta data about a SearchRequest without having to deal with the Query.

Returns
  • CloseableIterable that contains reference to all IndexableSharedEntities representing SearchRequests.

public Collection<SearchRequest> getAllOwnedSearchRequests (ApplicationUser owner)

Retrieves a collection of SearchRequest objects that a user created.

Parameters
owner The user who created the SearchRequests
Returns

public Collection<SearchRequest> getAllOwnedSearchRequests (String userKey)

Retrieves a collection of SearchRequest objects that a user created.

Parameters
userKey The key of the user who created the SearchRequests
Returns

public SearchRequest getRequestByAuthorAndName (ApplicationUser author, String name)

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

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

public SearchRequest getSearchRequest (Long searchRequestId)

Return the search request as stored in the database

Parameters
searchRequestId Id of the SearchRequest
Returns
  • The SearchRequest, or null if the request id does not exist

public EnclosedIterable<SearchRequest> getSearchRequests (Group group)

Get all search requests associated with a given Group.

Parameters
group the group that is associated with the filters
Returns
  • Collection of SearchRequest that have their project set to the given project

public EnclosedIterable<SearchRequest> getSearchRequests (Project project)

Get all search requests associate with a given Project.

Parameters
project Project that is associated with the filters
Returns
  • Collection of SearchRequest that have their project set to the given project

@EventListener public void onClearCache (ClearCacheEvent event)

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)