Class DefaultVendorService<P extends Vendor>

java.lang.Object
com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P>
com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService<P>
com.broadleafcommerce.vendor.service.DefaultVendorService<P>
All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P>, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>, VendorService<P>

public class DefaultVendorService<P extends Vendor> extends com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService<P> implements VendorService<P>
Author:
Jon Fleschler (jfleschler)
  • Constructor Summary

    Constructors
    Constructor
    Description
    DefaultVendorService(VendorRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.common.extension.TypeFactory typeFactory, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityHelper helper)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    createVendorFromRequest(VendorCreationRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Create a vendor from the given VendorCreationRequest.
    protected VendorRepository<com.broadleafcommerce.data.tracking.core.Trackable>
     
     
    protected com.broadleafcommerce.common.extension.TypeFactory
     
    protected P
    Responsible for creating a vendor entity from the passed in request.
    org.springframework.data.domain.Page<P>
    readAllByName(String nameQuery, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    Read all vendors, optionally filtered by name.
    readByVendorRef(String vendorRef, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Finds the vendor with the given reference key (should only be one result, as vendor keys are unique).

    Methods inherited from class com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService

    getRsqlHelper, readAll, readAll, readAll, readAll

    Methods inherited from class com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService

    convertFromPersistentDomain, convertToPersistentDomain, create, createAll, createAllAllowingPartialSuccess, delete, getHelper, getSortPositionStrategy, readAll, readAll, readAll, readAllByContextId, readByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, setSortPositionStrategy, update, updateAll, updateAllAllowingPartialSuccess, updateSort

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    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
  • Constructor Details

    • DefaultVendorService

      public DefaultVendorService(VendorRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.common.extension.TypeFactory typeFactory, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityHelper helper)
  • Method Details

    • readAllByName

      public org.springframework.data.domain.Page<P> readAllByName(@Nullable String nameQuery, @NonNull cz.jirutka.rsql.parser.ast.Node filters, @Nullable org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Description copied from interface: VendorService
      Read all vendors, optionally filtered by name.
      Specified by:
      readAllByName in interface VendorService<P extends Vendor>
      Parameters:
      nameQuery - (optional) the vendor name to filter by
      filters - additional filters to apply in the query, can be null
      page - the requested page of results from the database
      context - context information surrounding multitenant state
      Returns:
      all vendors, optionally filtered by name
    • readByVendorRef

      public Optional<P> readByVendorRef(@NonNull String vendorRef, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: VendorService
      Finds the vendor with the given reference key (should only be one result, as vendor keys are unique).
      Specified by:
      readByVendorRef in interface VendorService<P extends Vendor>
      Parameters:
      vendorRef - the reference key of the vendor that should be retrieved
      contextInfo - context information surrounding multitenant state
      Returns:
      an Optional containing the vendor with the given reference key, empty if not found
    • createVendorFromRequest

      public P createVendorFromRequest(@NonNull VendorCreationRequest request, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: VendorService
      Create a vendor from the given VendorCreationRequest.
      Specified by:
      createVendorFromRequest in interface VendorService<P extends Vendor>
      Parameters:
      request - the request containing requiried vendor data.
      contextInfo - context information surrounding multitenant state.
      Returns:
      a new vendor.
    • getVendorFromRequest

      protected P getVendorFromRequest(@NonNull VendorCreationRequest request)
      Responsible for creating a vendor entity from the passed in request.
      Parameters:
      request - The request containing new vendor information.
      Returns:
      a Vendor entity populated from the request.
    • getRepositoryDomain

      @NonNull public String getRepositoryDomain()
      Specified by:
      getRepositoryDomain in interface VendorService<P extends Vendor>
    • getRepository

      @NonNull protected VendorRepository<com.broadleafcommerce.data.tracking.core.Trackable> getRepository()
      Overrides:
      getRepository in class com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P extends Vendor>
    • getTypeFactory

      protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()