Class DefaultSubscriptionItemAdjustmentService<P extends SubscriptionItemAdjustment>
java.lang.Object
com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P>
com.broadleafcommerce.subscription.service.impl.DefaultSubscriptionItemAdjustmentService<P>
- All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P>,SubscriptionItemAdjustmentService<P>
public class DefaultSubscriptionItemAdjustmentService<P extends SubscriptionItemAdjustment>
extends com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P>
implements SubscriptionItemAdjustmentService<P>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected SubscriptionItemAdjustmentRepository<com.broadleafcommerce.data.tracking.core.Trackable>protected SubscriptionItemService<SubscriptionItem>protected com.broadleafcommerce.data.tracking.core.messaging.TransitionListener -
Constructor Summary
ConstructorsConstructorDescriptionDefaultSubscriptionItemAdjustmentService(SubscriptionItemAdjustmentRepository<com.broadleafcommerce.data.tracking.core.Trackable> repo, com.broadleafcommerce.data.tracking.core.service.CrudEntityHelper helper) -
Method Summary
Modifier and TypeMethodDescriptionbulkRemoveSubscriptionItemAdjustments(@NonNull RemoveSubscriptionItemAdjustmentRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) RemovesSubscriptionItemAdjustmentwith the provided ids.voidcommit(String subscriptionId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Apply any uncommitted changes to the production state.findAllByIds(Collection<String> ids, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) findAllBySubscriptionItemIdsIn(@NonNull Collection<String> ids, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Reads all of theSubscriptionItemAdjustmentsfor all the providedIDs.findById(String itemAdjustmentId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) findBySubscriptionItemId(String subscriptionItemId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected SubscriptionLockServiceprotected com.broadleafcommerce.common.extension.TypeFactoryprotected voidremoveSubscriptionItemAdjustments(@NonNull String subscriptionId, @NonNull List<String> itemAdjustmentIds, @NonNull RemoveSubscriptionItemAdjustmentResponse removalResponse, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) removeSubscriptionItemAdjustments(@NonNull List<String> itemAdjustmentIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) voidrevert(String subscriptionId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Revert any uncommitted changes.voidsetSubscriptionLockService(SubscriptionLockService subscriptionLockService) voidsetTypeFactory(com.broadleafcommerce.common.extension.TypeFactory typeFactory) Methods inherited from class com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService
convertFromPersistentDomain, convertToPersistentDomain, create, createAll, createAllAllowingPartialSuccess, delete, 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, delete, readAll, readAll, readAll, readAllByContextId, readByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, update, updateAll, updateAllAllowingPartialSuccess, updateSortMethods inherited from interface com.broadleafcommerce.subscription.service.SubscriptionItemAdjustmentService
addItemAdjustment, findAllByIds, findById, findForSubscriptionItemId, removeItemAdjustment
-
Field Details
-
repo
protected SubscriptionItemAdjustmentRepository<com.broadleafcommerce.data.tracking.core.Trackable> repo -
subscriptionItemService
-
transitionListener
@Autowired(required=false) protected com.broadleafcommerce.data.tracking.core.messaging.TransitionListener transitionListener
-
-
Constructor Details
-
DefaultSubscriptionItemAdjustmentService
public DefaultSubscriptionItemAdjustmentService(SubscriptionItemAdjustmentRepository<com.broadleafcommerce.data.tracking.core.Trackable> repo, com.broadleafcommerce.data.tracking.core.service.CrudEntityHelper helper)
-
-
Method Details
-
findById
public Optional<P> findById(String itemAdjustmentId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) - Specified by:
findByIdin interfaceSubscriptionItemAdjustmentService<P extends SubscriptionItemAdjustment>
-
findAllByIds
public List<P> findAllByIds(Collection<String> ids, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) - Specified by:
findAllByIdsin interfaceSubscriptionItemAdjustmentService<P extends SubscriptionItemAdjustment>
-
findAllBySubscriptionItemIdsIn
public List<P> findAllBySubscriptionItemIdsIn(@NonNull @NonNull Collection<String> ids, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:SubscriptionItemAdjustmentServiceReads all of theSubscriptionItemAdjustmentsfor all the providedIDs.- Specified by:
findAllBySubscriptionItemIdsInin interfaceSubscriptionItemAdjustmentService<P extends SubscriptionItemAdjustment>- Parameters:
ids- TheSubscriptionItem IDswhoseSubscriptionItemAdjustmentsshould be read.contextInfo- Additional sandbox and multitenant info- Returns:
- All of the
SubscriptionItemAdjustmentsfor all the providedIDs.
-
findBySubscriptionItemId
public List<P> findBySubscriptionItemId(String subscriptionItemId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) - Specified by:
findBySubscriptionItemIdin interfaceSubscriptionItemAdjustmentService<P extends SubscriptionItemAdjustment>
-
commit
public void commit(String subscriptionId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:SubscriptionItemAdjustmentServiceApply 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 interfaceSubscriptionItemAdjustmentService<P extends SubscriptionItemAdjustment>- 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:SubscriptionItemAdjustmentServiceRevert 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 interfaceSubscriptionItemAdjustmentService<P extends SubscriptionItemAdjustment>- Parameters:
subscriptionId- the subscription to revertcontextInfo- context information around multi-tenant state- See Also:
-
bulkRemoveSubscriptionItemAdjustments
public RemoveSubscriptionItemAdjustmentResponse bulkRemoveSubscriptionItemAdjustments(@NonNull @NonNull RemoveSubscriptionItemAdjustmentRequest request, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:SubscriptionItemAdjustmentServiceRemovesSubscriptionItemAdjustmentwith the provided ids.- Specified by:
bulkRemoveSubscriptionItemAdjustmentsin interfaceSubscriptionItemAdjustmentService<P extends SubscriptionItemAdjustment>- Parameters:
request- theRemoveSubscriptionItemAdjustmentRequestto remove the item adjustmentscontextInfo- context information around multi-tenant state- Returns:
- the
RemoveSubscriptionItemAdjustmentResponsethat contains an information about removedSubscriptionItemAdjustments
-
removeSubscriptionItemAdjustments
protected void removeSubscriptionItemAdjustments(@NonNull @NonNull String subscriptionId, @NonNull @NonNull List<String> itemAdjustmentIds, @NonNull @NonNull RemoveSubscriptionItemAdjustmentResponse removalResponse, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
removeSubscriptionItemAdjustments
-
getSubscriptionLockService
-
setSubscriptionLockService
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory() -
setTypeFactory
@Autowired public void setTypeFactory(com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-