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
ConstructorDescriptionDefaultBusinessTypeService
(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 TypeMethodDescriptionvoid
protected BusinessTypeModifiedEventProducer
Deprecated.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 byBusinessType.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 interfaceBusinessTypeService<P extends BusinessType>
- Parameters:
name
- The name to filter byfilters
- additional filters to apply in the query. Should beEmptyNode
if no additional filters should be applied.page
- the requested page of results from the databasecontextInfo
- 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 byBusinessType.getTypeKey()
.- Specified by:
readByTypeKey
in interfaceBusinessTypeService<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 interfaceBusinessTypeService<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 interfacecom.broadleafcommerce.data.tracking.core.service.CrudEntityService<P extends BusinessType>
- Overrides:
create
in classcom.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 interfacecom.broadleafcommerce.data.tracking.core.service.CrudEntityService<P extends BusinessType>
- Overrides:
update
in classcom.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 interfacecom.broadleafcommerce.data.tracking.core.service.CrudEntityService<P extends BusinessType>
- Overrides:
replace
in classcom.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 interfacecom.broadleafcommerce.data.tracking.core.service.CrudEntityService<P extends BusinessType>
- Overrides:
delete
in classcom.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P extends BusinessType>
-
sendBusinessTypeModifiedEvent
-
getRepository
protected BusinessTypeRepository<com.broadleafcommerce.data.tracking.core.Trackable> getRepository()- Overrides:
getRepository
in classcom.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 usingsender
.Message producer used when a business type is modified.Nullable since messaging might be disabled in some flex package configurations.
-
sender
.