Interface SearchRequestStore

All Known Implementing Classes:
CachingSearchRequestStore, OfBizSearchRequestStore

public interface SearchRequestStore
Store used for CRUD of SearchRequests
Since:
v3.13
  • Method Details

    • get

      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.
    • getAll

      Get a EnclosedIterable of all SearchRequests in the database.
      Returns:
      CloseableIterable that contains reference to all SearchRequests.
    • getAllIndexableSharedEntities

      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.
    • getAllOwnedSearchRequests

      Collection<SearchRequest> getAllOwnedSearchRequests(ApplicationUser user)
      Retrieves a collection of SearchRequest objects that a user created.
      Parameters:
      user - The user who created the SearchRequests
      Returns:
      Collection of all SearchRequest that user created.
    • getAllOwnedSearchRequests

      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:
      Collection of all SearchRequest that user created.
    • getRequestByAuthorAndName

      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
    • getSearchRequest

      SearchRequest getSearchRequest(@Nonnull Long id)
      Return the search request as stored in the database
      Parameters:
      id - Id of the SearchRequest
      Returns:
      The SearchRequest, or null if the request id does not exist
    • create

      SearchRequest create(@Nonnull 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
    • update

      SearchRequest update(@Nonnull SearchRequest request)
      Updates an existing search request in the database.
      Parameters:
      request - the request to persist.
      Returns:
      A SearchRequest that was persisted to the database
    • adjustFavouriteCount

      SearchRequest adjustFavouriteCount(@Nonnull 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 invalid input: '<' 0 to decrease the favourite count.
      Returns:
      the updated SearchRequest.
    • delete

      void delete(@Nonnull Long id)
      Removes the SearchRequest GenericValue from the database based on its id
      Parameters:
      id - of the search request to be removed from storage
    • getSearchRequests

      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
    • findByNameIgnoreCase

      @Nonnull 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.
    • getSearchRequests

      EnclosedIterable<SearchRequest> getSearchRequests(com.atlassian.crowd.embedded.api.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
    • visitAll

      void visitAll(Visitor<SearchRequestEntity> visitor)