Class DefaultSubscriptionFinderService<Q extends SubscriptionWithItemsAndAdjustments>
java.lang.Object
com.broadleafcommerce.subscription.job.service.impl.DefaultSubscriptionFinderService<Q>
- All Implemented Interfaces:
SubscriptionFinder<Q>
public class DefaultSubscriptionFinderService<Q extends SubscriptionWithItemsAndAdjustments>
extends Object
implements SubscriptionFinder<Q>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.broadleafcommerce.data.tracking.core.service.CrudEntityHelperprotected SubscriptionItemService<SubscriptionItem>protected com.broadleafcommerce.common.extension.TypeFactory -
Constructor Summary
ConstructorsConstructorDescriptionDefaultSubscriptionFinderService(SubscriptionRepository<com.broadleafcommerce.data.tracking.core.Trackable> subscriptionRepository) -
Method Summary
Modifier and TypeMethodDescriptionbuildWithItemsAndAdjustments(List<Subscription> subscriptions, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected org.springframework.data.domain.Page<Q>buildWithItemsAndAdjustments(org.springframework.data.domain.Page<Subscription> subscriptions, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) findActiveOrPausedSubscriptionsAndBillDateOrStatusChangeDateBefore(Date nextBillDate, Integer recordLimit, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find subscriptions withSubscriptionStatusEnum.ACTIVEorSubscriptionStatusEnum.PAUSEDsubscriptionStatus, the nextBillDate before the provided date or null and the statusChangeDate before the provided date, and their lastBillingOperationStatusPaymentStatusEnum.SUCCESS,PaymentStatusEnum.ABORTED, or null.findActiveOrPausedSubscriptionsAndBillDateOrStatusChangeDateOrEndOfTermDateBefore(Date nextBillDate, Integer recordLimit, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find subscriptions withSubscriptionStatusEnum.ACTIVEorSubscriptionStatusEnum.PAUSEDsubscriptionStatus, the nextBillDate before the provided date or the statusChangeDate before the provided date or the endOfTermDate before the provided date, and their lastBillingOperationStatusPaymentStatusEnum.SUCCESS,PaymentStatusEnum.ABORTED, or null.org.springframework.data.domain.Page<Q>findActiveOrPausedSubscriptionsAndBillDateOrStatusChangeDateOrEndOfTermDateBefore(Date nextBillDate, org.springframework.data.domain.Pageable pageable, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find subscriptions withSubscriptionStatusEnum.ACTIVEorSubscriptionStatusEnum.PAUSEDsubscriptionStatus, the nextBillDate before the provided date or the statusChangeDate before the provided date or the endOfTermDate before the provided date, and their lastBillingOperationStatusPaymentStatusEnum.SUCCESS,PaymentStatusEnum.ABORTED, or null.protected Map<String,Set<SubscriptionItem>> getAllSubscriptionItemsGroupedBySubscriptionId(Set<String> subscriptionIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected intMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.broadleafcommerce.subscription.job.service.SubscriptionFinder
findSubscriptionsByStatusAndBillingOperationStatus
-
Field Details
-
subscriptionItemService
-
subscriptionAdjustmentService
@Autowired protected SubscriptionAdjustmentService<SubscriptionAdjustment> subscriptionAdjustmentService -
typeFactory
@Autowired protected com.broadleafcommerce.common.extension.TypeFactory typeFactory -
helper
@Autowired protected com.broadleafcommerce.data.tracking.core.service.CrudEntityHelper helper
-
-
Constructor Details
-
DefaultSubscriptionFinderService
public DefaultSubscriptionFinderService(SubscriptionRepository<com.broadleafcommerce.data.tracking.core.Trackable> subscriptionRepository)
-
-
Method Details
-
findActiveOrPausedSubscriptionsAndBillDateOrStatusChangeDateBefore
public List<Q> findActiveOrPausedSubscriptionsAndBillDateOrStatusChangeDateBefore(Date nextBillDate, Integer recordLimit, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:SubscriptionFinderFind subscriptions withSubscriptionStatusEnum.ACTIVEorSubscriptionStatusEnum.PAUSEDsubscriptionStatus, the nextBillDate before the provided date or null and the statusChangeDate before the provided date, and their lastBillingOperationStatusPaymentStatusEnum.SUCCESS,PaymentStatusEnum.ABORTED, or null. The last clause prevents double-processing of a given subscription by multiple concurrent jobs.Then, pull their items and adjustments into the wrapper object.
- Specified by:
findActiveOrPausedSubscriptionsAndBillDateOrStatusChangeDateBeforein interfaceSubscriptionFinder<Q extends SubscriptionWithItemsAndAdjustments>- Returns:
- list of subscriptions
-
findActiveOrPausedSubscriptionsAndBillDateOrStatusChangeDateOrEndOfTermDateBefore
public List<Q> findActiveOrPausedSubscriptionsAndBillDateOrStatusChangeDateOrEndOfTermDateBefore(Date nextBillDate, Integer recordLimit, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:SubscriptionFinderFind subscriptions withSubscriptionStatusEnum.ACTIVEorSubscriptionStatusEnum.PAUSEDsubscriptionStatus, the nextBillDate before the provided date or the statusChangeDate before the provided date or the endOfTermDate before the provided date, and their lastBillingOperationStatusPaymentStatusEnum.SUCCESS,PaymentStatusEnum.ABORTED, or null. The last clause prevents double-processing of a given subscription by multiple concurrent jobs.Then, pull their items and adjustments into the wrapper object.
- Specified by:
findActiveOrPausedSubscriptionsAndBillDateOrStatusChangeDateOrEndOfTermDateBeforein interfaceSubscriptionFinder<Q extends SubscriptionWithItemsAndAdjustments>- Returns:
- list of subscriptions
-
findActiveOrPausedSubscriptionsAndBillDateOrStatusChangeDateOrEndOfTermDateBefore
public org.springframework.data.domain.Page<Q> findActiveOrPausedSubscriptionsAndBillDateOrStatusChangeDateOrEndOfTermDateBefore(Date nextBillDate, org.springframework.data.domain.Pageable pageable, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:SubscriptionFinderFind subscriptions withSubscriptionStatusEnum.ACTIVEorSubscriptionStatusEnum.PAUSEDsubscriptionStatus, the nextBillDate before the provided date or the statusChangeDate before the provided date or the endOfTermDate before the provided date, and their lastBillingOperationStatusPaymentStatusEnum.SUCCESS,PaymentStatusEnum.ABORTED, or null. The last clause prevents double-processing of a given subscription by multiple concurrent jobs.Then, pull their items and adjustments into the wrapper object.
- Specified by:
findActiveOrPausedSubscriptionsAndBillDateOrStatusChangeDateOrEndOfTermDateBeforein interfaceSubscriptionFinder<Q extends SubscriptionWithItemsAndAdjustments>- Parameters:
nextBillDate- next bill datepageable- Describes the page of results to returncontextInfo- context information surrounding sandboxing and multitenant state- Returns:
- A
Pageof subscriptions
-
buildWithItemsAndAdjustments
protected List<Q> buildWithItemsAndAdjustments(List<Subscription> subscriptions, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
buildWithItemsAndAdjustments
protected org.springframework.data.domain.Page<Q> buildWithItemsAndAdjustments(org.springframework.data.domain.Page<Subscription> subscriptions, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
getAllSubscriptionItemsGroupedBySubscriptionId
-
getDefaultPageSize
protected int getDefaultPageSize() -
getSubscriptionStatuses
-