Class ValidatingItemSearchService
java.lang.Object
de.hybris.platform.integrationservices.search.impl.ValidatingItemSearchService
- All Implemented Interfaces:
ItemSearchService
This implementation validates
ItemSearchRequest before performing a search. If request is valid, then
processing is delegated to DefaultItemSearchService, otherwise the search is vetoed by throwing an exception.-
Constructor Summary
ConstructorsConstructorDescriptionValidatingItemSearchService(@NotNull ItemSearchService service) Instantiates this service. -
Method Summary
Modifier and TypeMethodDescriptionintcountItems(ItemSearchRequest request) Counts how many items in the platform match the provided request conditions.findItems(ItemSearchRequest request) Searches forItems in the platform based on the provided request criteria.findUniqueItem(ItemSearchRequest request) Searches for a singleItemmatching therequestcriteria.voidsetCountSearchEnrichers(@NotNull List<ItemSearchRequestEnricher> enrichers) Provides enrichers to be used for enriching item search requests whencountItems(ItemSearchRequest)is called.voidsetCountSearchValidators(@NotNull List<ItemSearchRequestValidator> validators) Provides validators to be used for validating item search requests whencountItems(ItemSearchRequest)is called.voidsetItemsSearchEnrichers(@NotNull List<ItemSearchRequestEnricher> enrichers) Provides enrichers to be used for enriching item search requests whenfindItems(ItemSearchRequest)is called.voidsetItemsSearchValidators(@NotNull List<ItemSearchRequestValidator> validators) Provides validators to be used for validating item search requests whenfindItems(ItemSearchRequest)is called.voidsetUniqueItemSearchEnrichers(@NotNull List<ItemSearchRequestEnricher> enrichers) Provides enrichers to be used for enriching item search requests whenfindUniqueItem(ItemSearchRequest)is called.voidsetUniqueItemSearchValidators(@NotNull List<ItemSearchRequestValidator> validators) Provides validators to be used for validating item search requests whenfindUniqueItem(ItemSearchRequest)is called.
-
Constructor Details
-
ValidatingItemSearchService
Instantiates this service.- Parameters:
service- a service to delegate search to in case when no validation problems found.
-
-
Method Details
-
findUniqueItem
Description copied from interface:ItemSearchServiceSearches for a singleItemmatching therequestcriteria.- Specified by:
findUniqueItemin interfaceItemSearchService- 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
Description copied from interface:ItemSearchServiceSearches forItems in the platform based on the provided request criteria.- Specified by:
findItemsin interfaceItemSearchService- Parameters:
request- a request containing search conditions, i.e. type of items to find, pagination parameters, etc- Returns:
- result of the item search.
-
countItems
Description copied from interface:ItemSearchServiceCounts how many items in the platform match the provided request conditions.- Specified by:
countItemsin interfaceItemSearchService- 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 List<ItemSearchRequestValidator> validators) Provides validators to be used for validating item search requests whenfindUniqueItem(ItemSearchRequest)is called. The validators can be configured programmatically or by overridingintegrationServicesUniqueItemSearchValidatorslist definition in the Spring configuration.- Parameters:
validators- validators to use. If empty or this method is not called, thenfindUniqueItem(ItemSearchRequest)will be called unconditionally.
-
setItemsSearchValidators
Provides validators to be used for validating item search requests whenfindItems(ItemSearchRequest)is called. The validators can be configured programmatically or by overridingintegrationServicesItemsSearchValidatorslist definition in the Spring configuration.- Parameters:
validators- validators to use. If empty or this method is not called, thenfindItems(ItemSearchRequest)will be called unconditionally.
-
setCountSearchValidators
Provides validators to be used for validating item search requests whencountItems(ItemSearchRequest)is called. The validators can be configured programmatically or by overridingintegrationServicesCountSearchValidatorslist definition in the Spring configuration.- Parameters:
validators- validators to use. If empty or this method is not called, thencountItems(ItemSearchRequest)will be called unconditionally.
-
setUniqueItemSearchEnrichers
public void setUniqueItemSearchEnrichers(@NotNull @NotNull List<ItemSearchRequestEnricher> enrichers) Provides enrichers to be used for enriching item search requests whenfindUniqueItem(ItemSearchRequest)is called. The enrichers can be configured programmatically or by overridingintegrationServicesUniqueItemSearchEnricherslist definition in the Spring configuration.- Parameters:
enrichers- enrichers to use. If empty or this method is not called, thenfindUniqueItem(ItemSearchRequest)will be called unconditionally.
-
setItemsSearchEnrichers
Provides enrichers to be used for enriching item search requests whenfindItems(ItemSearchRequest)is called. The enrichers can be configured programmatically or by overridingintegrationServicesItemsSearchEnricherslist definition in the Spring configuration.- Parameters:
enrichers- enrichers to use. If empty or this method is not called, thenfindItems(ItemSearchRequest)will be called unconditionally.
-
setCountSearchEnrichers
Provides enrichers to be used for enriching item search requests whencountItems(ItemSearchRequest)is called. The enrichers can be configured programmatically or by overridingintegrationServicesCountSearchEnricherslist definition in the Spring configuration.- Parameters:
enrichers- enrichers to use. If empty or this method is not called, thencountItems(ItemSearchRequest)will be called unconditionally.
-