Class DefaultSubscriptionLockService
java.lang.Object
com.broadleafcommerce.subscription.service.impl.DefaultSubscriptionLockService
- All Implemented Interfaces:
SubscriptionLockService
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefaultSubscriptionLockService(SubscriptionLockRepository<JpaSubscriptionLock> lockRepository) -
Method Summary
Modifier and TypeMethodDescriptionReleases all locks on the subscription, including all child locks.createToken(@NonNull String subscriptionId, String childIdentifier) Creates a child lock on the subscription's existing lock.protected SubscriptionLockRepository<JpaSubscriptionLock>lockSubscription(@NonNull SubscriptionLockRequest request) Attempts to apply a lock to theSubscriptionidentified bySubscriptionLockRequest.getSubscriptionId()unlockToken(@NonNull String subscriptionId, @NonNull String token, boolean propagate) Releases a specific child lock on the subscriptionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.broadleafcommerce.subscription.service.SubscriptionLockService
lockSubscription
-
Field Details
-
lockRepository
-
-
Constructor Details
-
DefaultSubscriptionLockService
public DefaultSubscriptionLockService(SubscriptionLockRepository<JpaSubscriptionLock> lockRepository)
-
-
Method Details
-
lockSubscription
Description copied from interface:SubscriptionLockServiceAttempts to apply a lock to theSubscriptionidentified bySubscriptionLockRequest.getSubscriptionId()- Specified by:
lockSubscriptionin interfaceSubscriptionLockService- Parameters:
request- Request describing the lock to apply to the subscription- Returns:
- A
LockStatusdescribing the result of the attempted lock
-
clearLock
Description copied from interface:SubscriptionLockServiceReleases all locks on the subscription, including all child locks. Along with releasing the subscription lock, this will also deploy or revert sandbox changes to the subscription based on theisRevertparameter.- Specified by:
clearLockin interfaceSubscriptionLockService- Parameters:
subscriptionId- The id of the subscription that is lockedisRevert- Whether to revert (isRevert == true) or deploy (isRevert == false) the subscription's sandbox changes.- Returns:
- A
LockStatusdescribing the state of the lock
-
createToken
public LockStatus createToken(@NonNull @NonNull String subscriptionId, @Nullable String childIdentifier) Description copied from interface:SubscriptionLockServiceCreates a child lock on the subscription's existing lock.- Specified by:
createTokenin interfaceSubscriptionLockService- Parameters:
subscriptionId- The id of the subscription for which to apply a child lockchildIdentifier- The identifier of the child lock that is to be created.- Returns:
- A
LockStatusdescribing the state of the lock
-
unlockToken
public LockStatus unlockToken(@NonNull @NonNull String subscriptionId, @NonNull @NonNull String token, boolean propagate) Description copied from interface:SubscriptionLockServiceReleases a specific child lock on the subscription- Specified by:
unlockTokenin interfaceSubscriptionLockService- Parameters:
subscriptionId- The id of the subscription that is lockedtoken- The token used to identify the child lockpropagate- Whether to propagate the token unlock to the parent lock- Returns:
- A
LockStatusdescribing the state of the lock
-
getLockRepository
-