public class CachingSearchRequestStore extends Object implements SearchRequestStore
SearchRequest.| Constructor and Description |
|---|
CachingSearchRequestStore(SearchRequestStore delegateStore,
com.atlassian.cache.CacheManager cacheManager) |
| Modifier and Type | Method and Description |
|---|---|
SearchRequest |
adjustFavouriteCount(Long searchRequestId,
int incrementValue)
Updates the favourite count of the SearchRequest in the database.
|
protected void |
clearCache() |
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
|
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(com.atlassian.crowd.embedded.api.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. |
void |
onClearCache(ClearCacheEvent event) |
void |
onSearchRequestUserFKChangedEvent(SearchRequestUserFKChangedEvent event) |
SearchRequest |
update(SearchRequest request)
Updates an existing search request in the database.
|
void |
visitAll(Visitor<SearchRequestEntity> visitor) |
public CachingSearchRequestStore(SearchRequestStore delegateStore, com.atlassian.cache.CacheManager cacheManager)
@EventListener public void onClearCache(ClearCacheEvent event)
@EventListener public void onSearchRequestUserFKChangedEvent(SearchRequestUserFKChangedEvent event)
protected void clearCache()
public EnclosedIterable<SearchRequest> get(SharedEntityAccessor.RetrievalDescriptor descriptor)
SearchRequestStoreEnclosedIterable of SearchRequests for the specified List of ids.get in interface SearchRequestStoredescriptor - retrieval descriptorpublic EnclosedIterable<SearchRequest> getAll()
SearchRequestStoreEnclosedIterable of all SearchRequests in the database.getAll in interface SearchRequestStorepublic void visitAll(Visitor<SearchRequestEntity> visitor)
visitAll in interface SearchRequestStorepublic EnclosedIterable<IndexableSharedEntity<SearchRequest>> getAllIndexableSharedEntities()
SearchRequestStoreEnclosedIterable 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.
getAllIndexableSharedEntities in interface SearchRequestStorepublic Collection<SearchRequest> getAllOwnedSearchRequests(ApplicationUser owner)
SearchRequestStoregetAllOwnedSearchRequests in interface SearchRequestStoreowner - The user who created the SearchRequestsSearchRequest that user created.public Collection<SearchRequest> getAllOwnedSearchRequests(String userKey)
SearchRequestStoregetAllOwnedSearchRequests in interface SearchRequestStoreuserKey - The key of the user who created the SearchRequestsSearchRequest that user created.public SearchRequest getRequestByAuthorAndName(ApplicationUser author, String name)
SearchRequestStoregetRequestByAuthorAndName in interface SearchRequestStoreauthor - Author of the SearchRequestname - Name of the SearchRequestpublic SearchRequest getSearchRequest(@Nonnull Long searchRequestId)
SearchRequestStoregetSearchRequest in interface SearchRequestStoresearchRequestId - Id of the SearchRequestpublic SearchRequest create(@Nonnull SearchRequest request)
SearchRequestStoreSearchRequest, 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 detailscreate in interface SearchRequestStorerequest - SearchResult that should be persistedpublic SearchRequest update(@Nonnull SearchRequest request)
SearchRequestStoreupdate in interface SearchRequestStorerequest - the request to persist.SearchRequest that was persisted to the databasepublic SearchRequest adjustFavouriteCount(@Nonnull Long searchRequestId, int incrementValue)
SearchRequestStoreadjustFavouriteCount in interface SearchRequestStoresearchRequestId - 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.SearchRequest.public void delete(@Nonnull Long searchId)
SearchRequestStoredelete in interface SearchRequestStoresearchId - of the search request to be removed from storagepublic EnclosedIterable<SearchRequest> getSearchRequests(Project project)
SearchRequestStoresearch requests associate with a given Project.getSearchRequests in interface SearchRequestStoreproject - Project that is associated with the filtersSearchRequest that have their project set to the given project@Nonnull public List<SearchRequest> findByNameIgnoreCase(String name)
SearchRequestStorefindByNameIgnoreCase in interface SearchRequestStorename - Name of the SearchRequestpublic EnclosedIterable<SearchRequest> getSearchRequests(com.atlassian.crowd.embedded.api.Group group)
SearchRequestStoresearch requests associated with a given Group.getSearchRequests in interface SearchRequestStoregroup - the group that is associated with the filtersSearchRequest that have their project set to the given projectCopyright © 2002-2024 Atlassian. All Rights Reserved.