Class ValidatingItemSearchService

    • Constructor Detail

      • ValidatingItemSearchService

        public ValidatingItemSearchService​(@NotNull
                                           @NotNull ItemSearchService service)
        Instantiates this service.
        Parameters:
        service - a service to delegate search to in case when no validation problems found.
    • Method Detail

      • findUniqueItem

        public java.util.Optional<ItemModel> findUniqueItem​(ItemSearchRequest request)
        Description copied from interface: ItemSearchService
        Searches for a single Item matching the request criteria.
        Specified by:
        findUniqueItem in interface ItemSearchService
        Parameters:
        request - item search request
        Returns:
        an Optional containing the matching item model or an empty Optional, if a matching item is not found.
      • findItems

        public ItemSearchResult<ItemModel> findItems​(ItemSearchRequest request)
        Description copied from interface: ItemSearchService
        Searches for Items in the platform based on the provided request criteria.
        Specified by:
        findItems in interface ItemSearchService
        Parameters:
        request - a request containing search conditions, i.e. type of items to find, pagination parameters, etc
        Returns:
        result of the item search.
      • countItems

        public int countItems​(ItemSearchRequest request)
        Description copied from interface: ItemSearchService
        Counts how many items in the platform match the provided request conditions.
        Specified by:
        countItems in interface ItemSearchService
        Parameters:
        request - a request specifying the search criteria.
        Returns:
        number of items in the platform matching the search criteria.
      • setUniqueItemSearchValidators

        public void setUniqueItemSearchValidators​(@NotNull
                                                  @NotNull java.util.List<ItemSearchRequestValidator> validators)
        Provides validators to be used for validating item search requests when findUniqueItem(ItemSearchRequest) is called. The validators can be configured programmatically or by overriding integrationServicesUniqueItemSearchValidators list definition in the Spring configuration.
        Parameters:
        validators - validators to use. If empty or this method is not called, then findUniqueItem(ItemSearchRequest) will be called unconditionally.
      • setItemsSearchValidators

        public void setItemsSearchValidators​(@NotNull
                                             @NotNull java.util.List<ItemSearchRequestValidator> validators)
        Provides validators to be used for validating item search requests when findItems(ItemSearchRequest) is called. The validators can be configured programmatically or by overriding integrationServicesItemsSearchValidators list definition in the Spring configuration.
        Parameters:
        validators - validators to use. If empty or this method is not called, then findItems(ItemSearchRequest) will be called unconditionally.
      • setCountSearchValidators

        public void setCountSearchValidators​(@NotNull
                                             @NotNull java.util.List<ItemSearchRequestValidator> validators)
        Provides validators to be used for validating item search requests when countItems(ItemSearchRequest) is called. The validators can be configured programmatically or by overriding integrationServicesCountSearchValidators list definition in the Spring configuration.
        Parameters:
        validators - validators to use. If empty or this method is not called, then countItems(ItemSearchRequest) will be called unconditionally.
      • setUniqueItemSearchEnrichers

        public void setUniqueItemSearchEnrichers​(@NotNull
                                                 @NotNull java.util.List<ItemSearchRequestEnricher> enrichers)
        Provides enrichers to be used for enriching item search requests when findUniqueItem(ItemSearchRequest) is called. The enrichers can be configured programmatically or by overriding integrationServicesUniqueItemSearchEnrichers list definition in the Spring configuration.
        Parameters:
        enrichers - enrichers to use. If empty or this method is not called, then findUniqueItem(ItemSearchRequest) will be called unconditionally.
      • setItemsSearchEnrichers

        public void setItemsSearchEnrichers​(@NotNull
                                            @NotNull java.util.List<ItemSearchRequestEnricher> enrichers)
        Provides enrichers to be used for enriching item search requests when findItems(ItemSearchRequest) is called. The enrichers can be configured programmatically or by overriding integrationServicesItemsSearchEnrichers list definition in the Spring configuration.
        Parameters:
        enrichers - enrichers to use. If empty or this method is not called, then findItems(ItemSearchRequest) will be called unconditionally.
      • setCountSearchEnrichers

        public void setCountSearchEnrichers​(@NotNull
                                            @NotNull java.util.List<ItemSearchRequestEnricher> enrichers)
        Provides enrichers to be used for enriching item search requests when countItems(ItemSearchRequest) is called. The enrichers can be configured programmatically or by overriding integrationServicesCountSearchEnrichers list definition in the Spring configuration.
        Parameters:
        enrichers - enrichers to use. If empty or this method is not called, then countItems(ItemSearchRequest) will be called unconditionally.