Class MockAsSearchProvider

  • All Implemented Interfaces:
    AsSearchProvider, org.springframework.beans.factory.InitializingBean

    public class MockAsSearchProvider
    extends java.lang.Object
    implements AsSearchProvider, org.springframework.beans.factory.InitializingBean
    Mock implementation for AsSearchProvider
    • Field Detail

      • INDEX_CONFIGURATION

        protected static final java.lang.String INDEX_CONFIGURATION
        See Also:
        Constant Field Values
      • INDEX_TYPE_NO_CATALOG_VERSION

        protected static final java.lang.String INDEX_TYPE_NO_CATALOG_VERSION
        See Also:
        Constant Field Values
      • SCORE_EXPRESSION

        protected static final java.lang.String SCORE_EXPRESSION
        See Also:
        Constant Field Values
      • INDEX_PROPERTY_CODE1

        protected static final java.lang.String INDEX_PROPERTY_CODE1
        See Also:
        Constant Field Values
      • INDEX_PROPERTY_CODE2

        protected static final java.lang.String INDEX_PROPERTY_CODE2
        See Also:
        Constant Field Values
      • INDEX_PROPERTY_CODE3

        protected static final java.lang.String INDEX_PROPERTY_CODE3
        See Also:
        Constant Field Values
      • INDEX_PROPERTY_CODE4

        protected static final java.lang.String INDEX_PROPERTY_CODE4
        See Also:
        Constant Field Values
    • Constructor Detail

      • MockAsSearchProvider

        public MockAsSearchProvider()
    • Method Detail

      • afterPropertiesSet

        public void afterPropertiesSet()
        Specified by:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      • getSupportedFeatures

        public java.util.Set<AsFeatureFlag> getSupportedFeatures​(java.lang.String indexType)
        Description copied from interface: AsSearchProvider
        Returns a list of supported features.
        Specified by:
        getSupportedFeatures in interface AsSearchProvider
        Parameters:
        indexType - - the index type code
        Returns:
        the supported features
      • getIndexTypes

        public java.util.List<AsIndexTypeData> getIndexTypes​(java.lang.String indexConfiguration)
        Description copied from interface: AsSearchProvider
        Returns a list of index types for a given index configuration.
        Specified by:
        getIndexTypes in interface AsSearchProvider
        Parameters:
        indexConfiguration - - the index configuration code
        Returns:
        the index types
      • getIndexTypeForCode

        public java.util.Optional<AsIndexTypeData> getIndexTypeForCode​(java.lang.String code)
        Description copied from interface: AsSearchProvider
        Returns the index type for the provided code.
        Specified by:
        getIndexTypeForCode in interface AsSearchProvider
        Parameters:
        code - - the index type code
        Returns:
        the index type
      • getIndexProperties

        public java.util.List<AsIndexPropertyData> getIndexProperties​(java.lang.String indexType)
        Description copied from interface: AsSearchProvider
        Returns a list of index properties for a given index type.
        Specified by:
        getIndexProperties in interface AsSearchProvider
        Parameters:
        indexType - - the index type code
        Returns:
        the index properties
      • getIndexPropertyForCode

        public java.util.Optional<AsIndexPropertyData> getIndexPropertyForCode​(java.lang.String indexType,
                                                                               java.lang.String code)
        Description copied from interface: AsSearchProvider
        Returns the index property for the provided code.
        Specified by:
        getIndexPropertyForCode in interface AsSearchProvider
        code - - the index property code
        Returns:
        the index property
      • getSupportedCatalogVersions

        public java.util.List<CatalogVersionModel> getSupportedCatalogVersions​(java.lang.String indexConfiguration,
                                                                               java.lang.String indexType)
        Description copied from interface: AsSearchProvider
        Returns a list of catalog versions for a given index configuration and type.
        Specified by:
        getSupportedCatalogVersions in interface AsSearchProvider
        Parameters:
        indexConfiguration - - the index configuration
        indexType - - the index type
        Returns:
        the catalog versions
      • getSupportedLanguages

        public java.util.List<LanguageModel> getSupportedLanguages​(java.lang.String indexConfiguration,
                                                                   java.lang.String indexType)
        Description copied from interface: AsSearchProvider
        Returns a list of languages for a given index configuration and type.
        Specified by:
        getSupportedLanguages in interface AsSearchProvider
        Parameters:
        indexConfiguration - - the index configuration
        indexType - - the index type
        Returns:
        the languages
      • getSupportedCurrencies

        public java.util.List<CurrencyModel> getSupportedCurrencies​(java.lang.String indexConfiguration,
                                                                    java.lang.String indexType)
        Description copied from interface: AsSearchProvider
        Returns a list of currencies for a given index configuration and type.
        Specified by:
        getSupportedCurrencies in interface AsSearchProvider
        Parameters:
        indexConfiguration - - the index configuration
        indexType - - the index type
        Returns:
        the currencies
      • getSupportedFacetIndexProperties

        public java.util.List<AsIndexPropertyData> getSupportedFacetIndexProperties​(java.lang.String indexType)
        Description copied from interface: AsSearchProvider
        Returns a list of index properties for a given index type that can be used for facets.
        Specified by:
        getSupportedFacetIndexProperties in interface AsSearchProvider
        Parameters:
        indexType - - the index type code
        Returns:
        the index properties
      • isValidFacetIndexProperty

        public boolean isValidFacetIndexProperty​(java.lang.String indexType,
                                                 java.lang.String code)
        Description copied from interface: AsSearchProvider
        Checks is a given index property can be used for facets.
        Specified by:
        isValidFacetIndexProperty in interface AsSearchProvider
        Parameters:
        indexType - - the index type code
        code - - the code of the index property
        Returns:
        true if the index property can be used for facets, false otherwise
      • getSupportedFacetExpressions

        public java.util.List<AsExpressionData> getSupportedFacetExpressions​(java.lang.String indexType)
        Description copied from interface: AsSearchProvider
        Returns a list of expressions for a given index type that can be used for facets.
        Specified by:
        getSupportedFacetExpressions in interface AsSearchProvider
        Parameters:
        indexType - - the index type code
        Returns:
        the expressions
      • isValidFacetExpression

        public boolean isValidFacetExpression​(java.lang.String indexType,
                                              java.lang.String expression)
        Description copied from interface: AsSearchProvider
        Checks if a given index property can be used for facets.
        Specified by:
        isValidFacetExpression in interface AsSearchProvider
        Parameters:
        indexType - - the index type code
        expression - - the facet expression
        Returns:
        true if expression can be used for facets, false otherwise
      • getSupportedFacetTypes

        public java.util.List<AsFacetType> getSupportedFacetTypes​(java.lang.String indexType)
        Description copied from interface: AsSearchProvider
        Returns a list of facet types for a given index type.
        Specified by:
        getSupportedFacetTypes in interface AsSearchProvider
        Parameters:
        indexType - - the index type code
        Returns:
        the facet types
      • isValidFacetType

        public boolean isValidFacetType​(java.lang.String indexType,
                                        AsFacetType facetType)
        Description copied from interface: AsSearchProvider
        Checks if a given facet type can be used for a given index type.
        Specified by:
        isValidFacetType in interface AsSearchProvider
        Parameters:
        indexType - - the index type code
        facetType - - the facet type
        Returns:
        true if facet type can be used, false otherwise
      • getSupportedFacetSorts

        public java.util.List<AsFacetSortData> getSupportedFacetSorts​(java.lang.String indexType)
        Description copied from interface: AsSearchProvider
        Returns a list of facet sorts for a given index type.
        Specified by:
        getSupportedFacetSorts in interface AsSearchProvider
        Parameters:
        indexType - - the index type code
        Returns:
        the facet sorts
      • isValidFacetSort

        public boolean isValidFacetSort​(java.lang.String indexType,
                                        java.lang.String sort)
        Description copied from interface: AsSearchProvider
        Checks if a given sort can be used for facets.
        Specified by:
        isValidFacetSort in interface AsSearchProvider
        Parameters:
        indexType - - the index type code
        sort - - the sort
        Returns:
        true if sort can be used for facets, false otherwise
      • getSupportedBoostTypes

        public java.util.List<AsBoostType> getSupportedBoostTypes​(java.lang.String indexType)
        Description copied from interface: AsSearchProvider
        Returns a list of boost types for a given index type.
        Specified by:
        getSupportedBoostTypes in interface AsSearchProvider
        Parameters:
        indexType - - the index type code
        Returns:
        the boost types
      • isValidBoostType

        public boolean isValidBoostType​(java.lang.String indexType,
                                        AsBoostType boostType)
        Description copied from interface: AsSearchProvider
        Checks if a given boost type can be used for a given index type.
        Specified by:
        isValidBoostType in interface AsSearchProvider
        Parameters:
        indexType - - the index type code
        boostType - - the boost type
        Returns:
        true if boost type can be used, false otherwise
      • getSupportedSortExpressions

        public java.util.List<AsExpressionData> getSupportedSortExpressions​(java.lang.String indexType)
        Description copied from interface: AsSearchProvider
        Returns a list of expressions for a given index type that can be used for sorts.
        Specified by:
        getSupportedSortExpressions in interface AsSearchProvider
        Parameters:
        indexType - - the index type code
        Returns:
        the expressions
      • isValidSortExpression

        public boolean isValidSortExpression​(java.lang.String indexType,
                                             java.lang.String expression)
        Description copied from interface: AsSearchProvider
        Checks if a given expression can be used for sorts.
        Specified by:
        isValidSortExpression in interface AsSearchProvider
        Parameters:
        indexType - - the index type code
        expression - - the sort expression
        Returns:
        true if expression can be used for sorts, false otherwise
      • getSupportedGroupExpressions

        public java.util.List<AsExpressionData> getSupportedGroupExpressions​(java.lang.String indexType)
        Description copied from interface: AsSearchProvider
        Returns a list of expressions for a given index type that can be used for groups.
        Specified by:
        getSupportedGroupExpressions in interface AsSearchProvider
        Parameters:
        indexType - - the index type code
        Returns:
        the expressions
      • isValidGroupExpression

        public boolean isValidGroupExpression​(java.lang.String indexType,
                                              java.lang.String expression)
        Description copied from interface: AsSearchProvider
        Checks if a given expression can be used for groups.
        Specified by:
        isValidGroupExpression in interface AsSearchProvider
        Parameters:
        indexType - - the index type code
        expression - - the sort expression
        Returns:
        true if expression can be used for groups, false otherwise
      • getAvailableQualifiers

        public java.util.List<java.lang.String> getAvailableQualifiers​(java.lang.String indexType,
                                                                       java.lang.String indexPropertyCode)
                                                                throws AsException
        Description copied from interface: AsSearchProvider
        Return list of qualifiers for index property.
        Specified by:
        getAvailableQualifiers in interface AsSearchProvider
        Parameters:
        indexType - - the index type code
        indexPropertyCode - - the index property code
        Returns:
        the qualifiers
        Throws:
        AsException