Class DefaultAugmentationService<P extends Augmentation>

  • All Implemented Interfaces:
    com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P>, AugmentationService<P>

    public class DefaultAugmentationService<P extends Augmentation>
    extends com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P>
    implements AugmentationService<P>
    The default service implementation used for doing CRUD on `Augmentation`.
    Author:
    Nick Crum (ncrum)
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      P create​(P businessInstance, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)  
      void delete​(Augmentation augmentation, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)  
      org.springframework.data.domain.Page<P> findAugmentationsByContainerKey​(String containerKey, org.springframework.data.domain.Pageable pageable, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)  
      org.springframework.data.domain.Page<P> findAugmentationsByContainerKeyLike​(String containerKey, org.springframework.data.domain.Pageable pageable, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)  
      protected AugmentationModifiedEventProducer getAugmentationModifiedEventProducer()  
      protected AugmentationRepository<com.broadleafcommerce.data.tracking.core.Trackable> getRepository()  
      protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()  
      P replace​(String id, P businessInstance, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)  
      protected void sendAugmentationModifiedEvent​(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, P augmentation)  
      • Methods inherited from class com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService

        convertFromPersistentDomain, convertToPersistentDomain, createAll, createAllAllowingPartialSuccess, delete, getHelper, getSortPositionStrategy, readAll, readAll, readAll, readAllByContextId, readByContextId, replaceAll, replaceAllAllowingPartialSuccess, setSortPositionStrategy, update, updateAll, updateAllAllowingPartialSuccess, updateSort
      • Methods inherited from interface com.broadleafcommerce.data.tracking.core.service.CrudEntityService

        createAll, createAllAllowingPartialSuccess, delete, readAll, readAll, readAll, readAllByContextId, readByContextId, replaceAll, replaceAllAllowingPartialSuccess, update, updateAll, updateAllAllowingPartialSuccess, updateSort
    • Constructor Detail

      • DefaultAugmentationService

        public DefaultAugmentationService​(AugmentationRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository,
                                          com.broadleafcommerce.data.tracking.core.service.CrudEntityHelper helper,
                                          com.broadleafcommerce.common.extension.TypeFactory typeFactory,
                                          AugmentationModifiedEventProducer augmentationModifiedEventProducer)
    • Method Detail

      • findAugmentationsByContainerKey

        public org.springframework.data.domain.Page<P> findAugmentationsByContainerKey​(String containerKey,
                                                                                       org.springframework.data.domain.Pageable pageable,
                                                                                       com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Specified by:
        findAugmentationsByContainerKey in interface AugmentationService<P extends Augmentation>
      • findAugmentationsByContainerKeyLike

        public org.springframework.data.domain.Page<P> findAugmentationsByContainerKeyLike​(String containerKey,
                                                                                           org.springframework.data.domain.Pageable pageable,
                                                                                           com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Specified by:
        findAugmentationsByContainerKeyLike in interface AugmentationService<P extends Augmentation>
      • create

        @CacheEvict(cacheNames="metadataComponentCacheByComponentIdTenantIdApplicationId",
                    keyGenerator="metadataAugmentationCacheKeyGenerator")
        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 Augmentation>
        Overrides:
        create in class com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P extends Augmentation>
      • replace

        @CacheEvict(cacheNames="metadataComponentCacheByComponentIdTenantIdApplicationId",
                    keyGenerator="metadataAugmentationCacheKeyGenerator")
        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 Augmentation>
        Overrides:
        replace in class com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P extends Augmentation>
      • delete

        @CacheEvict(cacheNames="metadataComponentCacheByComponentIdTenantIdApplicationId",
                    keyGenerator="metadataAugmentationCacheKeyGenerator")
        public void delete​(@NonNull
                           Augmentation augmentation,
                           @Nullable
                           com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
        Specified by:
        delete in interface AugmentationService<P extends Augmentation>
      • sendAugmentationModifiedEvent

        protected void sendAugmentationModifiedEvent​(com.broadleafcommerce.data.tracking.core.context.ContextInfo context,
                                                     P augmentation)
      • getRepository

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

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