Package com.atlassian.jira.issue.search
Class CachingSearchRequestStore
java.lang.Object
com.atlassian.jira.issue.search.CachingSearchRequestStore
- All Implemented Interfaces:
InitializingComponent,SearchRequestStore
public class CachingSearchRequestStore
extends Object
implements SearchRequestStore, InitializingComponent
Caching store for
SearchRequest.- Since:
- v3.13
-
Constructor Summary
ConstructorsConstructorDescriptionCachingSearchRequestStore(SearchRequestStore delegateStore, com.atlassian.cache.CacheManager cacheManager) -
Method Summary
Modifier and TypeMethodDescriptionadjustFavouriteCount(Long searchRequestId, int incrementValue) Updates the favourite count of the SearchRequest in the database.voidCalled after all the beans are constructed and the ApplicationContext is fully populated.protected voidcreate(SearchRequest request) Takes aSearchRequest, 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) Find search requests matching the given name.get(SharedEntityAccessor.RetrievalDescriptor descriptor) Get aEnclosedIterableof SearchRequests for the specified List of ids.getAll()Get aEnclosedIterableof all SearchRequests in the database.Get aEnclosedIterableof all IndexableSharedEntities representing SearchRequests in the database.Retrieves a collection of SearchRequest objects that a user created.getAllOwnedSearchRequests(String userKey) Retrieves a collection of SearchRequest objects that a user created.getRequestByAuthorAndName(ApplicationUser author, String name) Find a search request given the author and the request name.getSearchRequest(Long searchRequestId) Return the search request as stored in the databasegetSearchRequests(com.atlassian.crowd.embedded.api.Group group) Get allsearch requestsassociated with a givenGroup.getSearchRequests(Project project) Get allsearch requestsassociate with a givenProject.voidonClearCache(ClearCacheEvent event) voidupdate(SearchRequest request) Updates an existing search request in the database.voidvisitAll(Visitor<SearchRequestEntity> visitor)
-
Constructor Details
-
CachingSearchRequestStore
public CachingSearchRequestStore(SearchRequestStore delegateStore, com.atlassian.cache.CacheManager cacheManager)
-
-
Method Details
-
afterInstantiation
Description copied from interface:InitializingComponentCalled after all the beans are constructed and the ApplicationContext is fully populated. Order of execution is order of bean creation, driven by InitializingComponentProcessor.- Specified by:
afterInstantiationin interfaceInitializingComponent- Throws:
Exception
-
onClearCache
-
onSearchRequestUserFKChangedEvent
-
clearCache
protected void clearCache() -
getAll
Description copied from interface:SearchRequestStoreGet aEnclosedIterableof all SearchRequests in the database.- Specified by:
getAllin interfaceSearchRequestStore- Returns:
- CloseableIterable that contains reference to all SearchRequests.
-
visitAll
- Specified by:
visitAllin interfaceSearchRequestStore
-
getAllOwnedSearchRequests
Description copied from interface:SearchRequestStoreRetrieves a collection of SearchRequest objects that a user created.- Specified by:
getAllOwnedSearchRequestsin interfaceSearchRequestStore- Parameters:
owner- The user who created the SearchRequests- Returns:
- Collection of all
SearchRequestthat user created.
-
getAllOwnedSearchRequests
Description copied from interface:SearchRequestStoreRetrieves a collection of SearchRequest objects that a user created.- Specified by:
getAllOwnedSearchRequestsin interfaceSearchRequestStore- Parameters:
userKey- The key of the user who created the SearchRequests- Returns:
- Collection of all
SearchRequestthat user created.
-
getRequestByAuthorAndName
Description copied from interface:SearchRequestStoreFind a search request given the author and the request name.- Specified by:
getRequestByAuthorAndNamein interfaceSearchRequestStore- Parameters:
author- Author of the SearchRequestname- Name of the SearchRequest- Returns:
- The SearchRequest, or null if there is no matching request
-
getSearchRequest
Description copied from interface:SearchRequestStoreReturn the search request as stored in the database- Specified by:
getSearchRequestin interfaceSearchRequestStore- Parameters:
searchRequestId- Id of the SearchRequest- Returns:
- The SearchRequest, or null if the request id does not exist
-
create
Description copied from interface:SearchRequestStoreTakes aSearchRequest, 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 interfaceSearchRequestStore- Parameters:
request- SearchResult that should be persisted- Returns:
- SearchRequest object that was persisted to the database
-
update
Description copied from interface:SearchRequestStoreUpdates an existing search request in the database.- Specified by:
updatein interfaceSearchRequestStore- Parameters:
request- the request to persist.- Returns:
- A
SearchRequestthat was persisted to the database
-
adjustFavouriteCount
Description copied from interface:SearchRequestStoreUpdates the favourite count of the SearchRequest in the database.- Specified by:
adjustFavouriteCountin interfaceSearchRequestStore- Parameters:
searchRequestId- the identifier of the search request to decrease.incrementValue- the value to increase the favourite count by. Can be a number invalid input: '<' 0 to decrease the favourite count.- Returns:
- the updated
SearchRequest.
-
delete
Description copied from interface:SearchRequestStoreRemoves the SearchRequest GenericValue from the database based on its id- Specified by:
deletein interfaceSearchRequestStore- Parameters:
searchId- of the search request to be removed from storage
-
getSearchRequests
Description copied from interface:SearchRequestStoreGet allsearch requestsassociate with a givenProject.- Specified by:
getSearchRequestsin interfaceSearchRequestStore- Parameters:
project- Project that is associated with the filters- Returns:
- Collection of
SearchRequestthat have their project set to the given project
-
findByNameIgnoreCase
Description copied from interface:SearchRequestStoreFind search requests matching the given name.- Specified by:
findByNameIgnoreCasein interfaceSearchRequestStore- Parameters:
name- Name of the SearchRequest- Returns:
- List of all search requests matching the given name. Never null.
-
getSearchRequests
public EnclosedIterable<SearchRequest> getSearchRequests(com.atlassian.crowd.embedded.api.Group group) Description copied from interface:SearchRequestStoreGet allsearch requestsassociated with a givenGroup.- Specified by:
getSearchRequestsin interfaceSearchRequestStore- Parameters:
group- the group that is associated with the filters- Returns:
- Collection of
SearchRequestthat have their project set to the given project
-