Class DefaultBusinessTypeService<P extends BusinessType>

java.lang.Object
com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P>
com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService<P>
com.broadleafcommerce.catalog.service.product.businessType.DefaultBusinessTypeService<P>
All Implemented Interfaces:
BusinessTypeService<P>, com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P>, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>

public class DefaultBusinessTypeService<P extends BusinessType> extends com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService<P> implements BusinessTypeService<P>
  • Constructor Summary

    Constructors
    Constructor
    Description
    DefaultBusinessTypeService(BusinessTypeRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityHelper helper, com.broadleafcommerce.data.tracking.core.filtering.fetch.FilterParser<cz.jirutka.rsql.parser.ast.Node> parser, com.broadleafcommerce.common.extension.TypeFactory typeFactory, BusinessTypeModifiedEventProducer businessTypeModifiedEventProducer)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    create(P businessInstance, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
     
    void
    delete(String id, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
     
    Deprecated.
    Notifications sent using sender.
    protected com.broadleafcommerce.data.tracking.core.filtering.fetch.FilterParser<cz.jirutka.rsql.parser.ast.Node>
     
    protected BusinessTypeRepository<com.broadleafcommerce.data.tracking.core.Trackable>
     
    protected com.broadleafcommerce.common.messaging.notification.DetachedDurableMessageSender
     
    protected com.broadleafcommerce.common.extension.TypeFactory
     
    org.springframework.data.domain.Page<P>
    readAllByNameLike(String name, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Read all business types filtered by name.
    readAllExcludingTemplates(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Reads all business types that are not templates.
    readByTypeKey(String typeKey, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Reads a business type by BusinessType.getTypeKey().
    replace(String id, P businessInstance, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
     
    protected void
    sendBusinessTypeModifiedEvent(P businessType, @NonNull String modificationType, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
     
    void
    setSender(com.broadleafcommerce.common.messaging.notification.DetachedDurableMessageSender sender)
     
    update(String id, P businessInstance, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
     

    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, createAll, createAllAllowingPartialSuccess, getHelper, getSortPositionStrategy, readAll, readAll, readAll, readAllByContextId, readByContextId, replaceAll, replaceAllAllowingPartialSuccess, setSortPositionStrategy, 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

    createAll, createAllAllowingPartialSuccess, readAll, readAll, readAll, readAllByContextId, readByContextId, replaceAll, replaceAllAllowingPartialSuccess, updateAll, updateAllAllowingPartialSuccess, updateSort

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

    readAll, readAll, readAll, readAll
  • Constructor Details

    • DefaultBusinessTypeService

      public DefaultBusinessTypeService(BusinessTypeRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityHelper helper, com.broadleafcommerce.data.tracking.core.filtering.fetch.FilterParser<cz.jirutka.rsql.parser.ast.Node> parser, com.broadleafcommerce.common.extension.TypeFactory typeFactory, @Nullable BusinessTypeModifiedEventProducer businessTypeModifiedEventProducer)
  • Method Details

    • readAllByNameLike

      public org.springframework.data.domain.Page<P> readAllByNameLike(@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 contextInfo)
      Description copied from interface: BusinessTypeService
      Read all business types filtered by name.
      Specified by:
      readAllByNameLike in interface BusinessTypeService<P extends BusinessType>
      Parameters:
      name - The name to filter by
      filters - additional filters to apply in the query. Should be EmptyNode if no additional filters should be applied.
      page - the requested page of results from the database
      contextInfo - Request context information around sandbox and multitenant state
      Returns:
      all business types filtered by name.
    • readByTypeKey

      public Optional<P> readByTypeKey(@NonNull String typeKey, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: BusinessTypeService
      Reads a business type by BusinessType.getTypeKey().
      Specified by:
      readByTypeKey in interface BusinessTypeService<P extends BusinessType>
      Parameters:
      typeKey - The type key to use.
      contextInfo - Additional context info.
      Returns:
      The business type or empty.
    • readAllExcludingTemplates

      public List<P> readAllExcludingTemplates(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: BusinessTypeService
      Reads all business types that are not templates.
      Specified by:
      readAllExcludingTemplates in interface BusinessTypeService<P extends BusinessType>
      Parameters:
      contextInfo - Request context information around sandbox and multitenant state
      Returns:
      all business types that are not templates.
    • create

      public P create(@NonNull P businessInstance, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Specified by:
      create in interface com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P extends BusinessType>
      Overrides:
      create in class com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P extends BusinessType>
    • update

      public P update(@NonNull String id, @NonNull P businessInstance, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Specified by:
      update in interface com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P extends BusinessType>
      Overrides:
      update in class com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P extends BusinessType>
    • replace

      public P replace(@NonNull String id, @NonNull P businessInstance, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Specified by:
      replace in interface com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P extends BusinessType>
      Overrides:
      replace in class com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P extends BusinessType>
    • delete

      public void delete(@NonNull String id, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Specified by:
      delete in interface com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P extends BusinessType>
      Overrides:
      delete in class com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P extends BusinessType>
    • sendBusinessTypeModifiedEvent

      protected void sendBusinessTypeModifiedEvent(@NonNull P businessType, @NonNull @NonNull String modificationType, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    • getRepository

      protected BusinessTypeRepository<com.broadleafcommerce.data.tracking.core.Trackable> getRepository()
      Overrides:
      getRepository in class com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P extends BusinessType>
    • getParser

      protected com.broadleafcommerce.data.tracking.core.filtering.fetch.FilterParser<cz.jirutka.rsql.parser.ast.Node> getParser()
    • getTypeFactory

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

      @Nullable protected com.broadleafcommerce.common.messaging.notification.DetachedDurableMessageSender getSender()
      Since:
      2.1.0-GA
    • setSender

      @Autowired(required=false) public void setSender(@Nullable com.broadleafcommerce.common.messaging.notification.DetachedDurableMessageSender sender)
      Since:
      2.1.0-GA
    • getBusinessTypeModifiedEventProducer

      @Deprecated @Nullable protected BusinessTypeModifiedEventProducer getBusinessTypeModifiedEventProducer()
      Deprecated.
      Notifications sent using sender.
      Message producer used when a business type is modified.

      Nullable since messaging might be disabled in some flex package configurations.