Class RestSearchServiceImpl

java.lang.Object
ch.tocco.nice2.rest.entity.impl.search.RestSearchServiceImpl
All Implemented Interfaces:
RestSearchService

@Component public class RestSearchServiceImpl extends Object implements RestSearchService
  • Constructor Details

  • Method Details

    • buildSearchRequestFromUri

      public SearchRequest.Builder buildSearchRequestFromUri(String modelName, jakarta.ws.rs.core.UriInfo uriInfo, @Nullable @Nullable Set<String> allowedPaths)
      Description copied from interface: RestSearchService
      build a SearchRequest from arguments passed to the URI to search for entities
      Specified by:
      buildSearchRequestFromUri in interface RestSearchService
      Parameters:
      modelName - the model to build the request for
      uriInfo - the uri info
      allowedPaths - a set of paths, if this set is passed (e.g. != null) only paths in this set will be added
      Returns:
      a builder prefilled with the passed arguments
    • buildCountRequestFromUri

      public SearchRequest.Builder buildCountRequestFromUri(String modelName, jakarta.ws.rs.core.UriInfo uriInfo)
      Description copied from interface: RestSearchService
      build a SearchRequest from arguments passed to the URI to count entities
      Specified by:
      buildCountRequestFromUri in interface RestSearchService
      Parameters:
      modelName - the model to build the request for
      uriInfo - the uri info
      Returns:
      a builder prefilled with the passed arguments
    • buildSearchRequestFromBean

      public SearchRequest.Builder buildSearchRequestFromBean(String modelName, EntitySearchBean searchBean, @Nullable @Nullable Set<String> allowedPaths)
      Description copied from interface: RestSearchService
      build a SearchRequest from a search bean to search entities
      Specified by:
      buildSearchRequestFromBean in interface RestSearchService
      Parameters:
      modelName - the model to build the request for
      searchBean - the search bean
      allowedPaths - a set of paths, if this set is passed (e.g. != null) only paths in this set will be added
      Returns:
      a builder prefilled with the passed arguments
    • buildCountRequestFromBean

      public SearchRequest.Builder buildCountRequestFromBean(String modelName, EntitySearchBean searchBean)
      Description copied from interface: RestSearchService
      build a SearchRequest from a search bean to count entities
      Specified by:
      buildCountRequestFromBean in interface RestSearchService
      Parameters:
      modelName - the model to build the request for
      searchBean - the search bean
      Returns:
      a builder prefilled with the passed arguments
    • executeSearchRequest

      public SearchResult executeSearchRequest(SearchRequest searchRequest)
      Description copied from interface: RestSearchService
      execute a search but don't wrap result in bean yet
      Specified by:
      executeSearchRequest in interface RestSearchService
      Parameters:
      searchRequest - the search request
      Returns:
      the search result
    • executeSearchRequest

      public CollectionBean executeSearchRequest(SearchRequest searchRequest, jakarta.ws.rs.core.UriBuilder uriBuilder)
      Description copied from interface: RestSearchService
      execute a search
      Specified by:
      executeSearchRequest in interface RestSearchService
      Parameters:
      searchRequest - the search request
      uriBuilder - the uri builder used for paging
      Returns:
      the collection bean filled with the result
    • executeSearchRequestWithSelectors

      public CollectionBean executeSearchRequestWithSelectors(SearchRequest searchRequest, jakarta.ws.rs.core.UriBuilder uriBuilder)
      Description copied from interface: RestSearchService
      execute a path search request with selector support
      Specified by:
      executeSearchRequestWithSelectors in interface RestSearchService
      Parameters:
      searchRequest - the search request
      uriBuilder - the uri builder used for paging
      Returns:
      the collection bean filled with the result
    • createCollectionBean

      public CollectionBean createCollectionBean(SearchResult searchResult, jakarta.ws.rs.core.UriBuilder uriBuilder)
      Specified by:
      createCollectionBean in interface RestSearchService
    • executeCountRequest

      public CountBean executeCountRequest(SearchRequest searchRequest)
      Description copied from interface: RestSearchService
      execute a count
      Specified by:
      executeCountRequest in interface RestSearchService
      Parameters:
      searchRequest - the count request
      Returns:
      the count bean filled with the result
    • getPagination

      public Pagination getPagination(jakarta.ws.rs.core.UriInfo uriInfo)
      Description copied from interface: RestSearchService
      get pagination from uri info (offset and limit)
      Specified by:
      getPagination in interface RestSearchService
      Parameters:
      uriInfo - the uri info
      Returns:
      the pagination with the given offset and limit (or with the defaults)
    • setMaxLimit

      @Value("${rest.paging.maxLimit}") public void setMaxLimit(Integer maxLimit)
    • setDisableLimitCheck

      @Value("${rest.paging.disableLimitCheck}") public void setDisableLimitCheck(boolean disableLimitCheck)