Class DefaultReturnAuthorizationService<P extends com.broadleafcommerce.order.client.domain.ReturnAuthorization>

  • Type Parameters:
    P - The projection domain type, a subtype of ReturnAuthorization
    All Implemented Interfaces:
    com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P>, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>, ReturnAuthorizationService<P>

    public class DefaultReturnAuthorizationService<P extends com.broadleafcommerce.order.client.domain.ReturnAuthorization>
    extends com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService<P>
    implements ReturnAuthorizationService<P>
    Default implementation of ReturnAuthorizationService
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected List<P> createReturnAuthorizations​(List<P> returnAuthorizations, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)  
      protected ReturnAuthorizationRepository<com.broadleafcommerce.data.tracking.core.Trackable> getRepository()  
      org.springframework.data.domain.Page<P> readAllByOrderId​(String orderId, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Retrieve return authorizations for the given order ID.
      List<P> readAllByOrderIdAndStatusNot​(String orderId, String status, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Reads all ReturnAuthorizations by orderId filtering out ones with status.
      org.springframework.data.domain.Page<P> readAllByOrderIds​(Collection<String> orderIds, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Retrieve return authorizations for the given collection of order IDs.
      List<P> replaceOrCreateAll​(Collection<P> returnAuthorizations, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Replace all of the given return authorizations which already exist, or create them.
      protected List<P> replaceReturnAuthorizations​(List<P> returnAuthorizations, 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, create, createAll, createAllAllowingPartialSuccess, delete, getHelper, getSortPositionStrategy, readAll, readAll, readAll, readAllByContextId, readByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, setSortPositionStrategy, update, updateAll, updateAllAllowingPartialSuccess, updateSort
      • 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 Detail

      • DefaultReturnAuthorizationService

        public DefaultReturnAuthorizationService​(ReturnAuthorizationRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository,
                                                 com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityHelper helper)
    • Method Detail

      • readAllByOrderId

        public org.springframework.data.domain.Page<P> readAllByOrderId​(String orderId,
                                                                        cz.jirutka.rsql.parser.ast.Node filters,
                                                                        org.springframework.data.domain.Pageable page,
                                                                        @Nullable
                                                                        com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Description copied from interface: ReturnAuthorizationService
        Retrieve return authorizations for the given order ID.
        Specified by:
        readAllByOrderId in interface ReturnAuthorizationService<P extends com.broadleafcommerce.order.client.domain.ReturnAuthorization>
        Parameters:
        orderId - the ID of the order to search for
        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 - context information around sandbox and multitenant state
        Returns:
        a page of the return authorizations associated with the given order ID
      • readAllByOrderIds

        public org.springframework.data.domain.Page<P> readAllByOrderIds​(Collection<String> orderIds,
                                                                         cz.jirutka.rsql.parser.ast.Node filters,
                                                                         org.springframework.data.domain.Pageable page,
                                                                         com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Description copied from interface: ReturnAuthorizationService
        Retrieve return authorizations for the given collection of order IDs.
        Specified by:
        readAllByOrderIds in interface ReturnAuthorizationService<P extends com.broadleafcommerce.order.client.domain.ReturnAuthorization>
        Parameters:
        orderIds - the IDs of the orders to search for
        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 - context information around sandbox and multitenant state
        Returns:
        a page of the return authorizations associated with the given order IDs
      • replaceOrCreateAll

        @Transactional
        public List<P> replaceOrCreateAll​(Collection<P> returnAuthorizations,
                                          @Nullable
                                          com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
        Description copied from interface: ReturnAuthorizationService
        Replace all of the given return authorizations which already exist, or create them.
        Specified by:
        replaceOrCreateAll in interface ReturnAuthorizationService<P extends com.broadleafcommerce.order.client.domain.ReturnAuthorization>
        Parameters:
        returnAuthorizations - the return authorizations to replace or create
        context - context information surrounding sandboxing and multitenant state
        Returns:
        the replaced and created return authorizations
      • readAllByOrderIdAndStatusNot

        public List<P> readAllByOrderIdAndStatusNot​(String orderId,
                                                    String status,
                                                    @Nullable
                                                    com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Description copied from interface: ReturnAuthorizationService
        Reads all ReturnAuthorizations by orderId filtering out ones with status.
        Specified by:
        readAllByOrderIdAndStatusNot in interface ReturnAuthorizationService<P extends com.broadleafcommerce.order.client.domain.ReturnAuthorization>
        Parameters:
        orderId - ID of the parent Order
        status - Status of the returns to filter by
        contextInfo - Additional sandbox and tenant info
        Returns:
        All ReturnAuthorizations associated to the given orderId.
      • replaceReturnAuthorizations

        protected List<P> replaceReturnAuthorizations​(List<P> returnAuthorizations,
                                                      @Nullable
                                                      com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      • createReturnAuthorizations

        protected List<P> createReturnAuthorizations​(List<P> returnAuthorizations,
                                                     @Nullable
                                                     com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      • getRepository

        protected ReturnAuthorizationRepository<com.broadleafcommerce.data.tracking.core.Trackable> getRepository()
        Overrides:
        getRepository in class com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P extends com.broadleafcommerce.order.client.domain.ReturnAuthorization>