Class RestRepositoryUtils


  • @Component
    public class RestRepositoryUtils
    extends Object
    Collection of utility methods to work with the Rest Repositories
    Author:
    Andrea Bollini (andrea.bollini at 4science.it)
    • Constructor Detail

      • RestRepositoryUtils

        public RestRepositoryUtils()
    • Method Detail

      • haveSearchMethods

        public boolean haveSearchMethods​(DSpaceRestRepository repository)
        Parameters:
        repository -
        Returns:
        if the repository have at least one search method
      • listSearchMethods

        public List<String> listSearchMethods​(DSpaceRestRepository repository)
        Parameters:
        repository -
        Returns:
        the names of the search methods if any. Otherwise an empty list
      • getSearchMethod

        public Method getSearchMethod​(String searchMethodName,
                                      DSpaceRestRepository repository)
        Parameters:
        searchMethodName -
        repository -
        Returns:
        the search method in the repository with the specified name or null if it is not found
      • executeQueryMethod

        public Object executeQueryMethod​(DSpaceRestRepository repository,
                                         org.springframework.util.MultiValueMap<String,​Object> parameters,
                                         Method method,
                                         org.springframework.data.domain.Pageable pageable,
                                         org.springframework.data.domain.Sort sort,
                                         org.springframework.data.web.PagedResourcesAssembler assembler)
      • invokeQueryMethod

        public Object invokeQueryMethod​(DSpaceRestRepository repository,
                                        Method method,
                                        org.springframework.util.MultiValueMap<String,​? extends Object> parameters,
                                        org.springframework.data.domain.Pageable pageable,
                                        org.springframework.data.domain.Sort sort)