Class DefaultSubscriptionAdjustmentService<P extends SubscriptionAdjustment>
java.lang.Object
com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P>
com.broadleafcommerce.subscription.service.impl.DefaultSubscriptionAdjustmentService<P>
- All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P>,SubscriptionAdjustmentService<P>
public class DefaultSubscriptionAdjustmentService<P extends SubscriptionAdjustment>
extends com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P>
implements SubscriptionAdjustmentService<P>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected SubscriptionAdjustmentRepository<com.broadleafcommerce.data.tracking.core.Trackable>protected com.broadleafcommerce.data.tracking.core.messaging.TransitionListener -
Constructor Summary
ConstructorsConstructorDescriptionDefaultSubscriptionAdjustmentService(SubscriptionAdjustmentRepository<com.broadleafcommerce.data.tracking.core.Trackable> repo, com.broadleafcommerce.data.tracking.core.service.CrudEntityHelper helper) -
Method Summary
Modifier and TypeMethodDescriptionvoidcommit(String subscriptionId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Apply any uncommitted changes to the production state.voiddelete(String adjustmentId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) findAllByIds(Collection<String> ids, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) findAllBySubscriptionIdsIn(@NonNull Collection<String> ids, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Reads all of theSubscriptionAdjustmentsfor all the providedIDs.findById(String adjustmentId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) findBySubscriptionId(String subscriptionId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) voidrevert(String subscriptionId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Revert any uncommitted changes.Methods inherited from class com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService
convertFromPersistentDomain, convertToPersistentDomain, create, createAll, createAllAllowingPartialSuccess, getHelper, getRepository, getSortPositionStrategy, readAll, readAll, readAll, readAllByContextId, readByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, setSortPositionStrategy, update, updateAll, updateAllAllowingPartialSuccess, updateSortMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.broadleafcommerce.data.tracking.core.service.CrudEntityService
create, createAll, createAllAllowingPartialSuccess, readAll, readAll, readAll, readAllByContextId, readByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, update, updateAll, updateAllAllowingPartialSuccess, updateSortMethods inherited from interface com.broadleafcommerce.subscription.service.SubscriptionAdjustmentService
addAdjustment, findAllByIds, findById, findForSubscriptionId, removeAdjustment
-
Field Details
-
repo
-
transitionListener
@Autowired(required=false) protected com.broadleafcommerce.data.tracking.core.messaging.TransitionListener transitionListener
-
-
Constructor Details
-
DefaultSubscriptionAdjustmentService
public DefaultSubscriptionAdjustmentService(SubscriptionAdjustmentRepository<com.broadleafcommerce.data.tracking.core.Trackable> repo, com.broadleafcommerce.data.tracking.core.service.CrudEntityHelper helper)
-
-
Method Details
-
findById
public Optional<P> findById(String adjustmentId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) - Specified by:
findByIdin interfaceSubscriptionAdjustmentService<P extends SubscriptionAdjustment>
-
findAllBySubscriptionIdsIn
public List<P> findAllBySubscriptionIdsIn(@NonNull @NonNull Collection<String> ids, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:SubscriptionAdjustmentServiceReads all of theSubscriptionAdjustmentsfor all the providedIDs.- Specified by:
findAllBySubscriptionIdsInin interfaceSubscriptionAdjustmentService<P extends SubscriptionAdjustment>- Parameters:
ids- TheSubscription IDswhoseSubscriptionAdjustmentsshould be read.contextInfo- Additional sandbox and multitenant info- Returns:
- All of the
SubscriptionAdjustmentsfor all the providedIDs.
-
findAllByIds
public List<P> findAllByIds(Collection<String> ids, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) - Specified by:
findAllByIdsin interfaceSubscriptionAdjustmentService<P extends SubscriptionAdjustment>
-
findBySubscriptionId
public List<P> findBySubscriptionId(String subscriptionId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) - Specified by:
findBySubscriptionIdin interfaceSubscriptionAdjustmentService<P extends SubscriptionAdjustment>
-
delete
public void delete(String adjustmentId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) - Specified by:
deletein interfacecom.broadleafcommerce.data.tracking.core.service.CrudEntityService<P extends SubscriptionAdjustment>- Overrides:
deletein classcom.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P extends SubscriptionAdjustment>
-
commit
public void commit(String subscriptionId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:SubscriptionAdjustmentServiceApply any uncommitted changes to the production state. Subscriptions are not only locked during a modification flow, but changes are also stored in a temporary modification state. When the modification flow is complete, this method is called to finalize the changes.Special note, during the modification flow, any retrieval of the subscription (and dependents) will return the modified state. However, the billing view of the subscription will continue to see the unmodified state until this method is called and the changes are finalized.
- Specified by:
commitin interfaceSubscriptionAdjustmentService<P extends SubscriptionAdjustment>- Parameters:
subscriptionId- the subscription to commitcontextInfo- context information around multi-tenant state
-
revert
public void revert(String subscriptionId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:SubscriptionAdjustmentServiceRevert any uncommitted changes. This will remove any changes that have been made during the modification flow and leave the production state untouched.- Specified by:
revertin interfaceSubscriptionAdjustmentService<P extends SubscriptionAdjustment>- Parameters:
subscriptionId- the subscription to revertcontextInfo- context information around multi-tenant state- See Also:
-