Interface ProductService<P extends Product>

All Superinterfaces:
com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P>, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>
All Known Implementing Classes:
DefaultProductService

public interface ProductService<P extends Product> extends com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>
Author:
Jeff Fischer, Samarth Dhruva (samarthd)
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    existsById(String id, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Returns whether there is a product with the given context ID in the data store.
     
    org.springframework.data.domain.Page<P>
    readAllByCategoryContextId(String categoryContextId, Boolean isSorted, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Finds all products in a given category.
    readAllByContextIds(Collection<String> productIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Return all of the products with IDs in the supplied collection.
    org.springframework.data.domain.Page<P>
    readAllByContextIds(Collection<String> productIds, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    Return all of the products with IDs in the supplied list.
    readAllByExternalIds(Collection<String> externalIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Fetches products based on the provided external IDs.
    readAllByFiltersExcluding(cz.jirutka.rsql.parser.ast.Node filters, List<String> exclusions, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Returns all of the products matching the given filters, excluding any products whose IDs match any of the values in exclusions.
    org.springframework.data.domain.Page<P>
    readAllByName(String name, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
     
    readAllByUris(Iterable<String> uris, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Finds the product matching the uris.
    readAllSkusByProduct(P product, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    Reads all the SKUs for the the specified product.
    readAllSkusByProductId(String productId, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    Reads all the SKUs for the the specified product ID.
    readAllSkusByProductIdAndQuery(String productId, String sku, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    Reads all the SKUs for the the specified product ID and SKU identifier.
    readAllUniqueIds(int page, cz.jirutka.rsql.parser.ast.Node filters)
    Return all of the unique product IDs.
    readAllUniqueIdsPerContext(int page, cz.jirutka.rsql.parser.ast.Node filters, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    Retrieves a narrowed list of unique product context IDs narrowed on a ContextInfo
    readByUri(String uri, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    Read a product by a given URI

    Methods inherited from interface com.broadleafcommerce.data.tracking.core.service.CrudEntityService

    create, createAll, createAllAllowingPartialSuccess, delete, readAll, readAll, readAll, readAllByContextId, readByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, update, updateAll, updateAllAllowingPartialSuccess, updateSort

    Methods inherited from interface com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService

    readAll, readAll, readAll, readAll
  • Method Details

    • existsById

      boolean existsById(String id, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Returns whether there is a product with the given context ID in the data store.
      Parameters:
      id - the ID to search for
      contextInfo - context information around sandboxing and multitenant state
      Returns:
      true if a product exists matching the given ID, false otherwise
    • readAllByName

      org.springframework.data.domain.Page<P> readAllByName(@Nullable String name, @Nullable cz.jirutka.rsql.parser.ast.Node filters, @Nullable org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    • readAllByContextIds

      org.springframework.data.domain.Page<P> readAllByContextIds(@NonNull Collection<String> productIds, @NonNull org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Return all of the products with IDs in the supplied list.
      Parameters:
      productIds - the product context IDs to search for
      page - the requested page of results from the database
      context - the context to perform the operation in
      Returns:
      the products that matched with the IDs in the given list
    • readAllByFiltersExcluding

      Stream<P> readAllByFiltersExcluding(@NonNull cz.jirutka.rsql.parser.ast.Node filters, @Nullable List<String> exclusions, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Returns all of the products matching the given filters, excluding any products whose IDs match any of the values in exclusions.
      Parameters:
      filters - the RSQL Node used to restrict results, must not be null
      exclusions - a list of product IDs that should be excluded from the results
      contextInfo - context information surrounding sandboxing and multitenant state
      Returns:
      all of the products matching the given filters, excluding any products whose IDs match any of the values in exclusions
    • readAllByContextIds

      List<P> readAllByContextIds(@NonNull Collection<String> productIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Return all of the products with IDs in the supplied collection.
      Parameters:
      productIds - the product context IDs to search for
      contextInfo - context information surrounding sandboxing and multitenant state
      Returns:
      the products that matched with the IDs in the given collection
    • readByUri

      Optional<P> readByUri(String uri, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Read a product by a given URI
      Parameters:
      uri - the URI to search for
      Returns:
      an Optional representing a found Product or an empty optional if none found
    • readAllUniqueIds

      List<String> readAllUniqueIds(int page, @NonNull cz.jirutka.rsql.parser.ast.Node filters)
      Return all of the unique product IDs.
      Parameters:
      page - the requested amount of results from the database. -1 indicates no limit.
      filters - additional filters to apply in the query. Should be EmptyNode if no additional filters should be applied.
      Returns:
      unique product IDs
    • readAllUniqueIdsPerContext

      List<String> readAllUniqueIdsPerContext(int page, @NonNull cz.jirutka.rsql.parser.ast.Node filters, @NonNull com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Retrieves a narrowed list of unique product context IDs narrowed on a ContextInfo
      Parameters:
      page - the requested amount of results from the database. -1 indicates no limit.
      filters - additional filters to apply in the query. Should be EmptyNode if no additional filters should be applied.
      context - The context used to help narrowing. For example, narrowing results to a particular catalog.
      Returns:
      The narrowed list of unique product context IDs
    • readAllSkusByProductId

      List<SKUContainer> readAllSkusByProductId(@NonNull String productId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Reads all the SKUs for the the specified product ID.
      Parameters:
      productId - the product ID
      context - the information surrounding sandboxing and multitenant state
      Returns:
      the list of SKUContainer for the specified product ID
      See Also:
    • readAllSkusByProduct

      List<SKUContainer> readAllSkusByProduct(@NonNull P product, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Reads all the SKUs for the the specified product. This method is the same as readAllSkusByProductId(String, ContextInfo) except it does not perform any query for Product and directly uses the POJO's id and sku for producing the result.
      Parameters:
      product - the Product
      context - the information surrounding sandboxing and multitenant state
      Returns:
      the list of SKUContainer for the specified product ID
    • readAllSkusByProductIdAndQuery

      List<SKUContainer> readAllSkusByProductIdAndQuery(@NonNull String productId, @NonNull String sku, @Nullable cz.jirutka.rsql.parser.ast.Node filters, @Nullable org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Reads all the SKUs for the the specified product ID and SKU identifier.
      Parameters:
      productId - the product ID
      sku - the SKU identifier to search
      filters - the RSQL Node used to restrict result
      page - the requested page of results from the database
      context - the information surrounding sandboxing and multitenant state
      Returns:
      the list of SKUContainer for the specified Product id
    • getRepositoryDomain

      @NonNull String getRepositoryDomain()
    • readAllByUris

      List<P> readAllByUris(@NonNull Iterable<String> uris, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Finds the product matching the uris.
      Parameters:
      uris - URIs to match
      contextInfo - the information surrounding sandboxing and multitenant state
      Returns:
      The product matching the uris
    • readAllByExternalIds

      List<P> readAllByExternalIds(@NonNull Collection<String> externalIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Fetches products based on the provided external IDs.
      Parameters:
      externalIds - a collection of external IDs
      contextInfo - the information surrounding sandboxing and multitenant state
      Returns:
      Products matching the provided external IDs
    • readAllByCategoryContextId

      org.springframework.data.domain.Page<P> readAllByCategoryContextId(@NonNull String categoryContextId, @Nullable Boolean isSorted, @Nullable cz.jirutka.rsql.parser.ast.Node filters, @NonNull org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Finds all products in a given category.
      Parameters:
      categoryContextId - the context id of the category.
      isSorted - – Whether to return CategoryProducts where CategoryProduct.sorted is true, else false.
      filters - additional filters to apply in the query. Should be EmptyNode if no additional filters should be applied.
      page - the requested amount of results from the database. -1 indicates no limit.
      contextInfo - Request context information around sandbox and multitenant state
      Returns:
      All the products in the given category